summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-12-07 22:53:40 -0800
committerMathias Agopian <mathias@google.com>2010-12-07 22:53:40 -0800
commit669084dbe6f1a20517964745028eff158c2c27e3 (patch)
tree29b1c8594385e4c64fd7b0ac8f19ccc0df786781 /services
parent7f889328b70ef863529f1e882fdd331d9d765432 (diff)
parenta0f011ff499289c89535c41ebe79c8c642414dff (diff)
downloadframeworks_base-669084dbe6f1a20517964745028eff158c2c27e3.zip
frameworks_base-669084dbe6f1a20517964745028eff158c2c27e3.tar.gz
frameworks_base-669084dbe6f1a20517964745028eff158c2c27e3.tar.bz2
resolved conflicts for merge of a0f011ff to master
Change-Id: I4c17021fc269ce66c98cc345353600eda332f980
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/Layer.cpp22
-rw-r--r--services/surfaceflinger/Layer.h1
-rw-r--r--services/surfaceflinger/LayerBase.cpp12
-rw-r--r--services/surfaceflinger/LayerBase.h4
4 files changed, 18 insertions, 21 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 15df888..fe4379d 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -58,7 +58,7 @@ Layer::Layer(SurfaceFlinger* flinger,
mSecure(false),
mTextureManager(),
mBufferManager(mTextureManager),
- mWidth(0), mHeight(0), mFixedSize(false)
+ mWidth(0), mHeight(0), mNeedsScaling(false), mFixedSize(false)
{
}
@@ -274,13 +274,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
@@ -318,11 +315,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();
@@ -396,6 +392,7 @@ sp<GraphicBuffer> Layer::requestBuffer(int index,
mReqHeight = reqHeight;
mReqFormat = reqFormat;
mFixedSize = fixedSize;
+ mNeedsScaling = mWidth != mReqWidth || mHeight != mReqHeight;
lcblk->reallocateAllExcept(index);
}
@@ -519,6 +516,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 {
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 07434cf..30021d3 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -233,6 +233,7 @@ private:
uint32_t mReqWidth;
uint32_t mReqHeight;
uint32_t mReqFormat;
+ bool mNeedsScaling;
bool mFixedSize;
};
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp
index df6aa51..28b02c9 100644
--- a/services/surfaceflinger/LayerBase.cpp
+++ b/services/surfaceflinger/LayerBase.cpp
@@ -216,14 +216,10 @@ uint32_t LayerBase::doTransaction(uint32_t flags)
flags |= eVisibleRegion;
this->contentDirty = true;
- mNeedsFiltering = false;
- if (!(mFlags & DisplayHardware::SLOW_CONFIG)) {
- // we may use linear filtering, if the matrix scales us
- const uint8_t type = temp.transform.getType();
- if (!temp.transform.preserveRects() || (type >= Transform::SCALE)) {
- mNeedsFiltering = true;
- }
- }
+ // we may use linear filtering, if the matrix scales us
+ const uint8_t type = temp.transform.getType();
+ mNeedsFiltering = (!temp.transform.preserveRects() ||
+ (type >= Transform::SCALE));
}
// Commit the transaction
diff --git a/services/surfaceflinger/LayerBase.h b/services/surfaceflinger/LayerBase.h
index bdee05b..a4f1bb7 100644
--- a/services/surfaceflinger/LayerBase.h
+++ b/services/surfaceflinger/LayerBase.h
@@ -191,7 +191,9 @@ public:
/**
* needsLinearFiltering - true if this surface needs filtering
*/
- virtual bool needsFiltering() const { return mNeedsFiltering; }
+ virtual bool needsFiltering() const {
+ return (!(mFlags & DisplayHardware::SLOW_CONFIG)) && mNeedsFiltering;
+ }
/**
* isSecure - true if this surface is secure, that is if it prevents