summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2021-02-10 05:42:36 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-02-10 05:42:36 +0000
commit1c69780efbb60608767a28a0887f2cb548fa2002 (patch)
treee3ac9f7ffebbd3d4ba24921f73311a09ddbf2ec8 /services/surfaceflinger/Layer.cpp
parent70091d6660ae38137971ebed061c3aedad775937 (diff)
parentcdb4ed7743f5abfa4e9a785b14a50ca25c906f3f (diff)
Merge "Add plumbing for sending stretch effect to SF" into sc-dev
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 87ca9c73c3..27b2b87d77 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -488,6 +488,7 @@ void Layer::prepareBasicGeometryCompositionState() {
compositionState->alpha = alpha;
compositionState->backgroundBlurRadius = drawingState.backgroundBlurRadius;
compositionState->blurRegions = drawingState.blurRegions;
+ compositionState->stretchEffect = drawingState.stretchEffect;
}
void Layer::prepareGeometryCompositionState() {
@@ -556,8 +557,8 @@ void Layer::preparePerFrameCompositionState() {
isOpaque(drawingState) && !usesRoundedCorners && getAlpha() == 1.0_hf;
// Force client composition for special cases known only to the front-end.
- if (isHdrY410() || usesRoundedCorners || drawShadows() ||
- getDrawingState().blurRegions.size() > 0) {
+ if (isHdrY410() || usesRoundedCorners || drawShadows() || drawingState.blurRegions.size() > 0 ||
+ drawingState.stretchEffect.hasEffect()) {
compositionState->forceClientComposition = true;
}
}
@@ -656,6 +657,7 @@ std::optional<compositionengine::LayerFE::LayerSettings> Layer::prepareClientCom
layerSettings.backgroundBlurRadius = getBackgroundBlurRadius();
layerSettings.blurRegions = getBlurRegions();
}
+ layerSettings.stretchEffect = getDrawingState().stretchEffect;
// Record the name of the layer for debugging further down the stack.
layerSettings.name = getName();
return layerSettings;
@@ -1421,6 +1423,19 @@ bool Layer::setFixedTransformHint(ui::Transform::RotationFlags fixedTransformHin
return true;
}
+bool Layer::setStretchEffect(const StretchEffect& effect) {
+ StretchEffect temp = effect;
+ temp.sanitize();
+ if (mCurrentState.stretchEffect == temp) {
+ return false;
+ }
+ mCurrentState.sequence++;
+ mCurrentState.stretchEffect = temp;
+ mCurrentState.modified = true;
+ setTransactionFlags(eTransactionNeeded);
+ return true;
+}
+
void Layer::updateTreeHasFrameRateVote() {
const auto traverseTree = [&](const LayerVector::Visitor& visitor) {
auto parent = getParent();