summaryrefslogtreecommitdiff
path: root/libs/surfaceflinger/LayerBase.cpp
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2009-09-29 22:39:22 -0700
committer Mathias Agopian <mathias@google.com> 2009-09-29 22:44:28 -0700
commite1b6f24423d61b7892e4a59f5a65b04231526712 (patch)
tree13ee13a164bea9004a05a76a0d751cbc66b226e7 /libs/surfaceflinger/LayerBase.cpp
parent8851617aea7d2cd61fd8a8585bd4414a14d71653 (diff)
introduce the notion of the requested size in the Layer state
Diffstat (limited to 'libs/surfaceflinger/LayerBase.cpp')
-rw-r--r--libs/surfaceflinger/LayerBase.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp
index 28ef27c1076e..df1407d4a106 100644
--- a/libs/surfaceflinger/LayerBase.cpp
+++ b/libs/surfaceflinger/LayerBase.cpp
@@ -83,12 +83,14 @@ void LayerBase::initStates(uint32_t w, uint32_t h, uint32_t flags)
if (flags & ISurfaceComposer::eNonPremultiplied)
mPremultipliedAlpha = false;
- mCurrentState.z = 0;
- mCurrentState.w = w;
- mCurrentState.h = h;
- mCurrentState.alpha = 0xFF;
- mCurrentState.flags = layerFlags;
- mCurrentState.sequence = 0;
+ mCurrentState.z = 0;
+ mCurrentState.w = w;
+ mCurrentState.h = h;
+ mCurrentState.requested_w = w;
+ mCurrentState.requested_h = h;
+ mCurrentState.alpha = 0xFF;
+ mCurrentState.flags = layerFlags;
+ mCurrentState.sequence = 0;
mCurrentState.transform.set(0, 0);
// drawing state & current state are identical
@@ -132,10 +134,10 @@ bool LayerBase::setLayer(uint32_t z) {
return true;
}
bool LayerBase::setSize(uint32_t w, uint32_t h) {
- if (mCurrentState.w == w && mCurrentState.h == h)
+ if (mCurrentState.requested_w == w && mCurrentState.requested_h == h)
return false;
- mCurrentState.w = w;
- mCurrentState.h = h;
+ mCurrentState.requested_w = w;
+ mCurrentState.requested_h = h;
requestTransaction();
return true;
}
@@ -192,13 +194,19 @@ uint32_t LayerBase::doTransaction(uint32_t flags)
const Layer::State& front(drawingState());
const Layer::State& temp(currentState());
+ if ((front.requested_w != temp.requested_w) ||
+ (front.requested_h != temp.requested_h)) {
+ // resize the layer, set the physical size to the requested size
+ Layer::State& editTemp(currentState());
+ editTemp.w = temp.requested_w;
+ editTemp.h = temp.requested_h;
+ }
+
if (temp.sequence != front.sequence) {
// invalidate and recompute the visible regions if needed
flags |= eVisibleRegion;
this->contentDirty = true;
- }
- if (temp.sequence != front.sequence) {
const bool linearFiltering = mUseLinearFiltering;
mUseLinearFiltering = false;
if (!(mFlags & DisplayHardware::SLOW_CONFIG)) {