summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2021-02-16 11:37:33 -0500
committer John Reck <jreck@google.com> 2021-02-18 14:42:23 -0500
commitc00c669cbc76f201879ebf2e0ce60d386a0fa483 (patch)
treecf0ba5cc37d82f5d0d62845fffcc979b07998ac9 /services/surfaceflinger/Layer.cpp
parent93be444a3d8e6e2d0ef73f82b0e42104ad4462bc (diff)
StretchEffect changes
Bug: 179047472 Test: StretchySurfaceViewActivity in HwAccelerationTests Change-Id: Ia1fcd6136a380bb7099fae08ceb024eae4f79ac8
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 237aaffa1f..cc7b2e7c1c 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -488,7 +488,7 @@ void Layer::prepareBasicGeometryCompositionState() {
compositionState->alpha = alpha;
compositionState->backgroundBlurRadius = drawingState.backgroundBlurRadius;
compositionState->blurRegions = drawingState.blurRegions;
- compositionState->stretchEffect = drawingState.stretchEffect;
+ compositionState->stretchEffect = getStretchEffect();
}
void Layer::prepareGeometryCompositionState() {
@@ -558,7 +558,7 @@ void Layer::preparePerFrameCompositionState() {
// Force client composition for special cases known only to the front-end.
if (isHdrY410() || usesRoundedCorners || drawShadows() || drawingState.blurRegions.size() > 0 ||
- drawingState.stretchEffect.hasEffect()) {
+ compositionState->stretchEffect.hasEffect()) {
compositionState->forceClientComposition = true;
}
}
@@ -1436,6 +1436,22 @@ bool Layer::setStretchEffect(const StretchEffect& effect) {
return true;
}
+StretchEffect Layer::getStretchEffect() const {
+ if (mDrawingState.stretchEffect.hasEffect()) {
+ return mDrawingState.stretchEffect;
+ }
+
+ sp<Layer> parent = getParent();
+ if (parent != nullptr) {
+ auto effect = parent->getStretchEffect();
+ if (effect.hasEffect()) {
+ // TODO(b/179047472): Map it? Or do we make the effect be in global space?
+ return effect;
+ }
+ }
+ return StretchEffect{};
+}
+
void Layer::updateTreeHasFrameRateVote() {
const auto traverseTree = [&](const LayerVector::Visitor& visitor) {
auto parent = getParent();
@@ -1740,6 +1756,7 @@ LayerDebugInfo Layer::getLayerDebugInfo(const DisplayDevice* display) const {
info.mRefreshPending = isBufferLatched();
info.mIsOpaque = isOpaque(ds);
info.mContentDirty = contentDirty;
+ info.mStretchEffect = getStretchEffect();
return info;
}