Commit e03ae81b authored by Evan W. Patton's avatar Evan W. Patton Committed by Jeffrey Schiller

Make ScaledFrameLayout only save matrix

Previous versions of ScaledFrameLayout saved the entire layer. This
isn't great for performance reasons, but it also had the side effect
on Android > 8.0 of messing with how WebView draws to the screen since
it is drawing to a back buffer. This change switches to only calling
save(), which saves the various transformations without creating a
secondary buffer. This seems to make the WebView happy again.

Change-Id: I9188e68d943fdc56bca7a57a24d0d17b2f9b49e7
parent 4c3f54be
...@@ -58,11 +58,7 @@ public class ScaledFrameLayout extends ViewGroup { ...@@ -58,11 +58,7 @@ public class ScaledFrameLayout extends ViewGroup {
@Override @Override
protected void dispatchDraw(Canvas canvas) { protected void dispatchDraw(Canvas canvas) {
if (VERSION.SDK_INT < VERSION_CODES.P) { canvas.save();
canvas.saveLayer(0, 0, canvas.getWidth(), canvas.getHeight(), null, MATRIX_SAVE_FLAG);
} else {
canvas.saveLayer(0, 0, canvas.getWidth(), canvas.getHeight(), null);
}
canvas.scale(mScale, mScale); canvas.scale(mScale, mScale);
super.dispatchDraw(canvas); super.dispatchDraw(canvas);
canvas.restore(); canvas.restore();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment