summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-07-02 16:49:28 -0700
committerJesse Hall <jessehall@google.com>2012-07-02 16:49:28 -0700
commitc5c5a14c06de249d8e0445fd24699e1d9aa04549 (patch)
tree136f542789aa80830b870a41a8a902ce1993294d /services/surfaceflinger/Layer.cpp
parentdc5b485f74edf2d2f31c62054eb6c180421a3ade (diff)
downloadframeworks_native-c5c5a14c06de249d8e0445fd24699e1d9aa04549.zip
frameworks_native-c5c5a14c06de249d8e0445fd24699e1d9aa04549.tar.gz
frameworks_native-c5c5a14c06de249d8e0445fd24699e1d9aa04549.tar.bz2
Only set acquire fences on overlay layers
Change-Id: I08e8173f83580de5a4e43a0ba5ea03e5ec6e8782
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 5b9327d..0d1cb45 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -300,20 +300,21 @@ void Layer::setPerFrameData(HWComposer::HWCLayerInterface& layer) {
// NOTE: buffer can be NULL if the client never drew into this
// layer yet, or if we ran out of memory
layer.setBuffer(buffer);
+}
+void Layer::setAcquireFence(HWComposer::HWCLayerInterface& layer) {
+ int fenceFd = -1;
if (mNeedHwcFence) {
sp<Fence> fence = mSurfaceTexture->getCurrentFence();
if (fence.get()) {
- int fenceFd = fence->dup();
+ fenceFd = fence->dup();
if (fenceFd == -1) {
ALOGW("failed to dup layer fence, skipping sync: %d", errno);
}
- layer.setAcquireFenceFd(fenceFd);
}
mNeedHwcFence = false;
- } else {
- layer.setAcquireFenceFd(-1);
}
+ layer.setAcquireFenceFd(fenceFd);
}
void Layer::onDraw(const DisplayHardware& hw, const Region& clip) const