diff options
author | 2023-04-12 15:53:28 -0700 | |
---|---|---|
committer | 2023-04-13 00:04:58 -0700 | |
commit | 10f50634f9554d9d4f73fba0678f829893ee249b (patch) | |
tree | 1ccf9da11c10f76117af69d3ed8269e4858018f6 | |
parent | ddac01807c17efeee15a38ec57d414504ddbe3fd (diff) |
Fixed issue where canvas transforms were applied multiple times
in overscroll scenarios on Android Go devices.
Added save/restore around TransformCanvas that is used to replay
filtered drawing instructions to ensure hole punches are carried
through even when a RenderNode is drawn into a layer.
Previously this would end up with transforms being applied twice
during overscroll stretch situations. This caused contents to be
shifted during an overscroll at the end of a HorizontalScrollView
or ScrollView where a SurfaceView was in the scene.
Fixes: 241582783
Test: Added CTS tests to Horizontal and ScrollView tests
Change-Id: Iac1717602fd5f251d3d6fa26109a4c532a9598b5
-rw-r--r-- | libs/hwui/pipeline/skia/RenderNodeDrawable.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp index 1a47db5c8ec2..da4f66d45a70 100644 --- a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp +++ b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp @@ -293,8 +293,10 @@ void RenderNodeDrawable::drawContent(SkCanvas* canvas) const { // with the same canvas transformation + clip into the target // canvas then draw the layer on top if (renderNode->hasHolePunches()) { + canvas->save(); TransformCanvas transformCanvas(canvas, SkBlendMode::kDstOut); displayList->draw(&transformCanvas); + canvas->restore(); } canvas->drawImageRect(snapshotImage, SkRect::Make(srcBounds), SkRect::Make(dstBounds), sampling, &paint, |