summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
diff options
context:
space:
mode:
authorChris Gross <chrisgross@google.com>2021-05-19 11:39:13 -0700
committerScott Lobdell <slobdell@google.com>2021-05-21 00:34:23 +0000
commit219787565ff982848d596fa8743cd132af113e6b (patch)
tree93bd3c94771fb966fdf611d38865e712fb83e969 /libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
parent7b4a006d559a571313e36799d93af7e3c6b69c82 (diff)
parent75eb1dd292d1800d660c5146464264b25854d318 (diff)
Merge SP1A.210513.004
Change-Id: Ic23aece12c3bbd2b4dcf3205fdbcdd1601deabec
Diffstat (limited to 'libs/hwui/pipeline/skia/RenderNodeDrawable.cpp')
-rw-r--r--libs/hwui/pipeline/skia/RenderNodeDrawable.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
index 1ae06d082744..1c5515c7deee 100644
--- a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
+++ b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
@@ -175,7 +175,7 @@ static bool layerNeedsPaint(const sk_sp<SkImage>& snapshotImage, const LayerProp
float alphaMultiplier, SkPaint* paint) {
if (alphaMultiplier < 1.0f || properties.alpha() < 255 ||
properties.xferMode() != SkBlendMode::kSrcOver || properties.getColorFilter() != nullptr ||
- properties.getImageFilter() != nullptr || !properties.getStretchEffect().isEmpty()) {
+ properties.getImageFilter() != nullptr || properties.getStretchEffect().requiresLayer()) {
paint->setAlpha(properties.alpha() * alphaMultiplier);
paint->setBlendMode(properties.xferMode());
paint->setColorFilter(sk_ref_sp(properties.getColorFilter()));
@@ -247,7 +247,8 @@ void RenderNodeDrawable::drawContent(SkCanvas* canvas) const {
}
const StretchEffect& stretch = properties.layerProperties().getStretchEffect();
- if (stretch.isEmpty()) {
+ if (stretch.isEmpty() ||
+ Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale) {
// If we don't have any stretch effects, issue the filtered
// canvas draw calls to make sure we still punch a hole
// with the same canvas transformation + clip into the target
@@ -326,6 +327,13 @@ void RenderNodeDrawable::setViewProperties(const RenderProperties& properties, S
canvas->concat(*properties.getTransformMatrix());
}
}
+ if (Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale) {
+ const StretchEffect& stretch = properties.layerProperties().getStretchEffect();
+ if (!stretch.isEmpty()) {
+ canvas->concat(
+ stretch.makeLinearStretch(properties.getWidth(), properties.getHeight()));
+ }
+ }
const bool isLayer = properties.effectiveLayerType() != LayerType::None;
int clipFlags = properties.getClippingFlags();
if (properties.getAlpha() < 1) {