diff options
author | 2012-12-20 14:05:45 -0800 | |
---|---|---|
committer | 2013-02-12 18:15:38 -0800 | |
commit | 1df8c345854155cbbcb9f80de9d12d66ea70ac08 (patch) | |
tree | 9e3eedb37edfbb45c323364366ae09ea82ba847d /libs/gui/SurfaceTextureClient.cpp | |
parent | 351c2941736039c495dd7ac849ec64fbf7f3ff05 (diff) |
libgui: disallow NULL Fence pointers
This change eliminates the uses of a NULL sp<Fence> indicating that no waiting
is required. Instead we use a non-NULL but invalid Fence object for which the
wait methods will return immediately.
Bug: 7892871
Change-Id: I5360aebe3090422ef6920d56c99fc4eedc642e48
Diffstat (limited to 'libs/gui/SurfaceTextureClient.cpp')
-rw-r--r-- | libs/gui/SurfaceTextureClient.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp index c015b812f0..5ed2e38150 100644 --- a/libs/gui/SurfaceTextureClient.cpp +++ b/libs/gui/SurfaceTextureClient.cpp @@ -216,7 +216,7 @@ int SurfaceTextureClient::dequeueBuffer(android_native_buffer_t** buffer, } } - if (fence.get()) { + if (fence->isValid()) { *fenceFd = fence->dup(); if (*fenceFd == -1) { ALOGE("dequeueBuffer: error duping fence: %d", errno); @@ -241,7 +241,7 @@ int SurfaceTextureClient::cancelBuffer(android_native_buffer_t* buffer, if (i < 0) { return i; } - sp<Fence> fence(fenceFd >= 0 ? new Fence(fenceFd) : NULL); + sp<Fence> fence(fenceFd >= 0 ? new Fence(fenceFd) : Fence::NO_FENCE); mSurfaceTexture->cancelBuffer(i, fence); return OK; } @@ -287,7 +287,7 @@ int SurfaceTextureClient::queueBuffer(android_native_buffer_t* buffer, int fence Rect crop; mCrop.intersect(Rect(buffer->width, buffer->height), &crop); - sp<Fence> fence(fenceFd >= 0 ? new Fence(fenceFd) : NULL); + sp<Fence> fence(fenceFd >= 0 ? new Fence(fenceFd) : Fence::NO_FENCE); IGraphicBufferProducer::QueueBufferOutput output; IGraphicBufferProducer::QueueBufferInput input(timestamp, crop, mScalingMode, mTransform, fence); |