diff options
| author | 2010-12-07 14:18:21 -0800 | |
|---|---|---|
| committer | 2010-12-07 14:18:21 -0800 | |
| commit | 05813b0eb92cb1bc79607ee402f14ca1e4b43f6d (patch) | |
| tree | b18ecaaf655f404757e4a4195d72c6e785067b64 /services/surfaceflinger/Layer.cpp | |
| parent | 4153bf3a259624a2f2dc497b77b225a1fb517abc (diff) | |
| parent | e33811512eb061338792dbb0dbd37a1b8e4e1079 (diff) | |
Merge changes I244b5469,I32044e91 into gingerbread
* changes:
  [3253328, 3171580] Treat GONE and INVISIBLE views the same when calculating transparent regions
  [3171580] Fix two typos related to fixed-size buffers
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 23 | 
1 files changed, 11 insertions, 12 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 5018fb3c437f..81cb15def5ba 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -57,7 +57,7 @@ Layer::Layer(SurfaceFlinger* flinger,          mSecure(false),          mTextureManager(),          mBufferManager(mTextureManager), -        mWidth(0), mHeight(0), mFixedSize(false) +        mWidth(0), mHeight(0), mNeedsScaling(false), mFixedSize(false)  {  } @@ -216,13 +216,10 @@ slowpath:  void Layer::drawForSreenShot() const  { -    bool currentFixedSize = mFixedSize; -    bool currentBlending = mNeedsBlending; -    const_cast<Layer*>(this)->mFixedSize = false; -    const_cast<Layer*>(this)->mFixedSize = true; +    const bool currentFiltering = mNeedsFiltering; +    const_cast<Layer*>(this)->mNeedsFiltering = true;      LayerBase::drawForSreenShot(); -    const_cast<Layer*>(this)->mFixedSize = currentFixedSize; -    const_cast<Layer*>(this)->mNeedsBlending = currentBlending; +    const_cast<Layer*>(this)->mNeedsFiltering = currentFiltering;  }  void Layer::onDraw(const Region& clip) const @@ -260,11 +257,10 @@ void Layer::onDraw(const Region& clip) const  bool Layer::needsFiltering() const  {      if (!(mFlags & DisplayHardware::SLOW_CONFIG)) { -        // NOTE: there is a race here, because mFixedSize is updated in a -        // binder transaction. however, it doesn't really matter since it is -        // evaluated each time we draw. To be perfectly correct, this flag -        // would have to be associated with a buffer. -        if (mFixedSize) +        // if our buffer is not the same size than ourselves, +        // we need filtering. +        Mutex::Autolock _l(mLock); +        if (mNeedsScaling)              return true;      }      return LayerBase::needsFiltering(); @@ -321,6 +317,7 @@ sp<GraphicBuffer> Layer::requestBuffer(int index,          Mutex::Autolock _l(mLock);          // zero means default +        mFixedSize = reqWidth && reqHeight;          if (!reqFormat) reqFormat = mFormat;          if (!reqWidth)  reqWidth = mWidth;          if (!reqHeight) reqHeight = mHeight; @@ -334,6 +331,7 @@ sp<GraphicBuffer> Layer::requestBuffer(int index,              mReqWidth  = reqWidth;              mReqHeight = reqHeight;              mReqFormat = reqFormat; +            mNeedsScaling = mWidth != mReqWidth || mHeight != mReqHeight;              lcblk->reallocateAllExcept(index);          } @@ -457,6 +455,7 @@ void Layer::setBufferSize(uint32_t w, uint32_t h) {      Mutex::Autolock _l(mLock);      mWidth = w;      mHeight = h; +    mNeedsScaling = mWidth != mReqWidth || mHeight != mReqHeight;  }  bool Layer::isFixedSize() const {  |