diff options
author | Mathias Agopian <mathias@google.com> | 2012-11-21 16:02:13 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2012-11-21 16:03:52 -0800 |
commit | 8430095879d2fa6878e68f8f12da4e704815ac09 (patch) | |
tree | 9e390872accbfdfd1e6d16b9c9e9e537d024ae78 /services/surfaceflinger/Layer.cpp | |
parent | 764c197c6fc2bf10b038c33b320a4e95594d52d8 (diff) | |
download | frameworks_native-8430095879d2fa6878e68f8f12da4e704815ac09.zip frameworks_native-8430095879d2fa6878e68f8f12da4e704815ac09.tar.gz frameworks_native-8430095879d2fa6878e68f8f12da4e704815ac09.tar.bz2 |
make transform hint multi-display aware
if a layer is not mirrored, we now use its display
as the source for the transfrom hint calculation
instead of always using the default (main) display.
this change does two thing:
1) we make updateTransformHint take a DisplayDevice
as a parameter instead of hard-coding the
main display.
2) each time we do a transaction that could change
the hint, we go through all layers and
figure out which display should be used for their
transform hint.
Bug: 7599344
Change-Id: I9b04a95e6c372dd770bacf81d8ef6f8e31b87b83
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 064f689..7edbdc5 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -110,7 +110,8 @@ void Layer::onFirstRef() mSurfaceTexture->setDefaultMaxBufferCount(3); #endif - updateTransformHint(); + const sp<const DisplayDevice> hw(mFlinger->getDefaultDisplayDevice()); + updateTransformHint(hw); } Layer::~Layer() @@ -767,15 +768,12 @@ uint32_t Layer::getEffectiveUsage(uint32_t usage) const return usage; } -void Layer::updateTransformHint() const { +void Layer::updateTransformHint(const sp<const DisplayDevice>& hw) const { uint32_t orientation = 0; if (!mFlinger->mDebugDisableTransformHint) { - // The transform hint is used to improve performance on the main - // display -- we can only have a single transform hint, it cannot + // The transform hint is used to improve performance, but we can + // only have a single transform hint, it cannot // apply to all displays. - // This is why we use the default display here. This is not an - // oversight. - sp<const DisplayDevice> hw(mFlinger->getDefaultDisplayDevice()); const Transform& planeTransform(hw->getTransform()); orientation = planeTransform.getOrientation(); if (orientation & Transform::ROT_INVALID) { |