diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-03-28 20:55:50 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-03-28 20:55:51 +0000 |
commit | 2f44ec6c868b220be1b566e7ccfbb251beec70ec (patch) | |
tree | 4f21a9751ca8081b44ac74b11526aa7a07a52841 /graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp | |
parent | 561b602a9984624c8459bbd3d7b8bd74853fc18d (diff) | |
parent | 66ee1771a66afae08b2b8d5aad51c86cade347ee (diff) |
Merge "Use gralloc usage conversion library" into oc-dev
Diffstat (limited to 'graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp')
-rw-r--r-- | graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp b/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp index 4b9c9e10a1..f722429724 100644 --- a/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp +++ b/graphics/allocator/2.0/default/Gralloc1On0Adapter.cpp @@ -21,6 +21,8 @@ #include "Gralloc1On0Adapter.h" #include "gralloc1-adapter.h" +#include <grallocusage/GrallocUsageConversion.h> + #include <hardware/gralloc.h> #include <utils/Log.h> @@ -240,8 +242,8 @@ gralloc1_error_t Gralloc1On0Adapter::allocate( // pointer, which only occurs when mDevice has been loaded successfully and // we are permitted to allocate - int usage = static_cast<int>(descriptor->producerUsage) | - static_cast<int>(descriptor->consumerUsage); + int usage = android_convertGralloc1To0Usage( + descriptor->producerUsage, descriptor->consumerUsage); buffer_handle_t handle = nullptr; int stride = 0; ALOGV("Calling alloc(%p, %u, %u, %i, %u)", mDevice, descriptor->width, @@ -438,7 +440,7 @@ gralloc1_error_t Gralloc1On0Adapter::lock( { if (mMinorVersion >= 3) { int result = mModule->lockAsync(mModule, buffer->getHandle(), - static_cast<int32_t>(producerUsage | consumerUsage), + android_convertGralloc1To0Usage(producerUsage, consumerUsage), accessRegion.left, accessRegion.top, accessRegion.width, accessRegion.height, outData, acquireFence); if (result != 0) { @@ -448,7 +450,7 @@ gralloc1_error_t Gralloc1On0Adapter::lock( syncWaitForever(acquireFence, "Gralloc1On0Adapter::lock"); int result = mModule->lock(mModule, buffer->getHandle(), - static_cast<int32_t>(producerUsage | consumerUsage), + android_convertGralloc1To0Usage(producerUsage, consumerUsage), accessRegion.left, accessRegion.top, accessRegion.width, accessRegion.height, outData); ALOGV("gralloc0 lock returned %d", result); |