diff options
Diffstat (limited to 'core/java/android/view/View.java')
| -rw-r--r-- | core/java/android/view/View.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 5538007965ac..65d2e11ae0e6 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -8087,7 +8087,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * * @return A HardwareLayer ready to render, or null if an error occurred. */ - HardwareLayer getHardwareLayer(Canvas currentCanvas) { + HardwareLayer getHardwareLayer() { if (mAttachInfo == null || mAttachInfo.mHardwareRenderer == null) { return null; } @@ -8107,7 +8107,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mHardwareLayer.resize(width, height); } - final HardwareCanvas canvas = mHardwareLayer.start(mAttachInfo.mHardwareCanvas); + Canvas currentCanvas = mAttachInfo.mHardwareCanvas; + final HardwareCanvas canvas = mHardwareLayer.start(currentCanvas); + mAttachInfo.mHardwareCanvas = canvas; try { canvas.setViewport(width, height); // TODO: We should pass the dirty rect @@ -8131,7 +8133,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility canvas.restoreToCount(restoreCount); } finally { canvas.onPostDraw(); - mHardwareLayer.end(mAttachInfo.mHardwareCanvas); + mHardwareLayer.end(currentCanvas); + mAttachInfo.mHardwareCanvas = currentCanvas; } } |
