summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-09-26 15:44:41 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-26 15:44:41 -0700
commit892ac4155a7e2f2c824ee9898d4c5cef4bbe1afc (patch)
treed5d97dcf4a0a4bef27a68ed4aa523b27fc5e003e /services
parent3780d38010f50ccce508871058d54c1921936e0c (diff)
parent8d46849341c774b67424cc0f755a7b219f6fa141 (diff)
downloadframeworks_base-892ac4155a7e2f2c824ee9898d4c5cef4bbe1afc.zip
frameworks_base-892ac4155a7e2f2c824ee9898d4c5cef4bbe1afc.tar.gz
frameworks_base-892ac4155a7e2f2c824ee9898d4c5cef4bbe1afc.tar.bz2
Merge "(DO NOT MERGE) SurfaceFlinger: fix isOpaque check in lockPageFlip" into ics-factoryrom
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/Layer.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 74ea4c7..49d2c55 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -404,7 +404,9 @@ bool Layer::isCropped() const {
void Layer::lockPageFlip(bool& recomputeVisibleRegions)
{
if (mQueuedFrames > 0) {
+ // Capture the old state of the layer for comparisons later
const bool oldOpacity = isOpaque();
+ sp<GraphicBuffer> oldActiveBuffer = mActiveBuffer;
// signal another event if we have more frames pending
if (android_atomic_dec(&mQueuedFrames) > 1) {
@@ -417,7 +419,8 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
return;
}
- sp<GraphicBuffer> newFrontBuffer(mSurfaceTexture->getCurrentBuffer());
+ // update the active buffer
+ mActiveBuffer = mSurfaceTexture->getCurrentBuffer();
const Rect crop(mSurfaceTexture->getCurrentCrop());
const uint32_t transform(mSurfaceTexture->getCurrentTransform());
@@ -439,16 +442,16 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
mFlinger->invalidateHwcGeometry();
}
- uint32_t bufWidth = newFrontBuffer->getWidth();
- uint32_t bufHeight = newFrontBuffer->getHeight();
- if (mActiveBuffer != NULL) {
- if (bufWidth != uint32_t(mActiveBuffer->width) ||
- bufHeight != uint32_t(mActiveBuffer->height)) {
+ uint32_t bufWidth = mActiveBuffer->getWidth();
+ uint32_t bufHeight = mActiveBuffer->getHeight();
+ if (oldActiveBuffer != NULL) {
+ if (bufWidth != uint32_t(oldActiveBuffer->width) ||
+ bufHeight != uint32_t(oldActiveBuffer->height)) {
mFlinger->invalidateHwcGeometry();
}
}
- mCurrentOpacity = getOpacityForFormat(newFrontBuffer->format);
+ mCurrentOpacity = getOpacityForFormat(mActiveBuffer->format);
if (oldOpacity != isOpaque()) {
recomputeVisibleRegions = true;
}
@@ -462,9 +465,6 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
// FIXME: mPostedDirtyRegion = dirty & bounds
mPostedDirtyRegion.set(front.w, front.h);
- // update active buffer
- mActiveBuffer = newFrontBuffer;
-
if ((front.w != front.requested_w) ||
(front.h != front.requested_h))
{