diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-09-11 20:47:28 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-09-11 20:47:28 +0000 |
| commit | 50afc5eb415c537e1cba86fb8f78ec5f53dd6979 (patch) | |
| tree | 396968b1337079a923c178da4974263f9b09530d /core/java | |
| parent | 68655ec636b52e44b5f1e8145420a2370b108274 (diff) | |
| parent | 64660bedad0dad36fa9ca9c1544701383c1f5f32 (diff) | |
Merge "Avoid global transaction in magnifier"
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/widget/Magnifier.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/java/android/widget/Magnifier.java b/core/java/android/widget/Magnifier.java index d3c69725b45b..f58b6d192fde 100644 --- a/core/java/android/widget/Magnifier.java +++ b/core/java/android/widget/Magnifier.java @@ -800,6 +800,7 @@ public final class Magnifier { // The surface we allocate for the magnifier content + shadow. private final SurfaceSession mSurfaceSession; private final SurfaceControl mSurfaceControl; + private final SurfaceControl.Transaction mTransaction = new SurfaceControl.Transaction(); private final Surface mSurface; // The renderer used for the allocated surface. private final ThreadedRenderer.SimpleRenderer mRenderer; @@ -1081,16 +1082,16 @@ public final class Magnifier { return; } // Show or move the window at the content draw frame. - SurfaceControl.openTransaction(); - mSurfaceControl.deferTransactionUntil(mSurface, frame); + mTransaction.deferTransactionUntilSurface(mSurfaceControl, mSurface, frame); if (updateWindowPosition) { - mSurfaceControl.setPosition(pendingX, pendingY); + mTransaction.setPosition(mSurfaceControl, pendingX, pendingY); } if (firstDraw) { - mSurfaceControl.setLayer(SURFACE_Z); - mSurfaceControl.show(); + mTransaction.setLayer(mSurfaceControl, SURFACE_Z) + .show(mSurfaceControl); + } - SurfaceControl.closeTransaction(); + mTransaction.apply(); }; mRenderer.setLightCenter(mDisplay, pendingX, pendingY); } else { |
