diff options
| author | 2009-09-30 17:27:18 -0400 | |
|---|---|---|
| committer | 2009-09-30 17:27:18 -0400 | |
| commit | 68624f2aa5a3f93a81c69d3e1a4a083056e14217 (patch) | |
| tree | 0309d9da870ce3dd513fd2d9c92893287b716d60 /libs/surfaceflinger/LayerBase.cpp | |
| parent | ee304d6925717d578ea2e2faa9d10157d566ed99 (diff) | |
| parent | df3e0b934f2822ea0a334777e51e681f04a64d7c (diff) | |
Merge changes I8851617a,Ie1b6f244,I70cab912,Ibd23e30d into eclair
* changes:
fix [2152247] Windows sometimes drawn scaled up.
invalidate the surface when the physical changes
introduce the notion of the requested size in the Layer state
remove unused code
Diffstat (limited to 'libs/surfaceflinger/LayerBase.cpp')
| -rw-r--r-- | libs/surfaceflinger/LayerBase.cpp | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp index 7692d0f716..d83c8429eb 100644 --- a/libs/surfaceflinger/LayerBase.cpp +++ b/libs/surfaceflinger/LayerBase.cpp @@ -83,26 +83,22 @@ 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 mDrawingState = mCurrentState; } -void LayerBase::commitTransaction(bool skipSize) { - const uint32_t w = mDrawingState.w; - const uint32_t h = mDrawingState.h; +void LayerBase::commitTransaction() { mDrawingState = mCurrentState; - if (skipSize) { - mDrawingState.w = w; - mDrawingState.h = h; - } } void LayerBase::forceVisibilityTransaction() { // this can be called without SurfaceFlinger.mStateLock, but if we @@ -138,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; } @@ -198,13 +194,25 @@ uint32_t LayerBase::doTransaction(uint32_t flags) const Layer::State& front(drawingState()); const Layer::State& temp(currentState()); - if (temp.sequence != front.sequence) { + 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 ((front.w != temp.w) || (front.h != temp.h)) { // invalidate and recompute the visible regions if needed - flags |= eVisibleRegion; + flags |= Layer::eVisibleRegion; this->contentDirty = true; } if (temp.sequence != front.sequence) { + // invalidate and recompute the visible regions if needed + flags |= eVisibleRegion; + this->contentDirty = true; + const bool linearFiltering = mUseLinearFiltering; mUseLinearFiltering = false; if (!(mFlags & DisplayHardware::SLOW_CONFIG)) { @@ -217,7 +225,7 @@ uint32_t LayerBase::doTransaction(uint32_t flags) } // Commit the transaction - commitTransaction(flags & eRestartTransaction); + commitTransaction(); return flags; } |