Loading core/java/android/view/ViewRootImpl.java +2 −2 Original line number Diff line number Diff line Loading @@ -2716,11 +2716,11 @@ public final class ViewRootImpl implements ViewParent, mAttachInfo.mHardwareRenderer.setStopped(false); } mAttachInfo.mHardwareRenderer.draw(mView, mAttachInfo, this); if (updated) { requestDrawWindow(); } mAttachInfo.mHardwareRenderer.draw(mView, mAttachInfo, this); } else { // If we get here with a disabled & requested hardware renderer, something went // wrong (an invalidate posted right before we destroyed the hardware surface Loading core/java/com/android/internal/policy/BackdropFrameRenderer.java +26 −26 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.internal.policy; import static android.view.WindowCallbacks.RESIZE_MODE_FREEFORM; import android.graphics.Rect; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; Loading Loading @@ -102,9 +100,6 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame mOldSystemInsets.set(systemInsets); mOldStableInsets.set(stableInsets); mResizeMode = resizeMode; synchronized (this) { redrawLocked(initialBounds, fullscreen, mSystemInsets, mStableInsets); } // Kick off our draw thread. start(); Loading Loading @@ -160,7 +155,7 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame mSystemInsets.set(systemInsets); mStableInsets.set(stableInsets); // Notify of a bounds change. pingRenderLocked(); pingRenderLocked(false /* drawImmediate */); } } Loading @@ -172,7 +167,7 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame if (mRenderer != null) { // Enforce a window redraw. mOldTargetRect.set(0, 0, 0, 0); pingRenderLocked(); pingRenderLocked(false /* drawImmediate */); } } } Loading @@ -197,7 +192,7 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame mRenderer = null; // Exit the renderer loop. pingRenderLocked(); pingRenderLocked(false /* drawImmediate */); } } } Loading @@ -208,9 +203,6 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame Looper.prepare(); synchronized (this) { mChoreographer = Choreographer.getInstance(); // Draw at least once. mChoreographer.postFrameCallback(this); } Looper.loop(); } finally { Loading @@ -236,6 +228,11 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame Looper.myLooper().quit(); return; } doFrameUncheckedLocked(); } } private void doFrameUncheckedLocked() { mNewTargetRect.set(mTargetRect); if (!mNewTargetRect.equals(mOldTargetRect) || mOldFullscreen != mFullscreen Loading @@ -249,7 +246,6 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame redrawLocked(mNewTargetRect, mFullscreen, mSystemInsets, mStableInsets); } } } /** * The content is about to be drawn and we got the location of where it will be shown. Loading Loading @@ -288,7 +284,7 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame synchronized (this) { mReportNextDraw = reportNextDraw; mOldTargetRect.set(0, 0, 0, 0); pingRenderLocked(); pingRenderLocked(true /* drawImmediate */); } } Loading Loading @@ -403,10 +399,14 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame * Sends a message to the renderer to wake up and perform the next action which can be * either the next rendering or the self destruction if mRenderer is null. * Note: This call must be synchronized. * * @param drawImmediate if we should draw immediately instead of scheduling a frame */ private void pingRenderLocked() { if (mChoreographer != null) { private void pingRenderLocked(boolean drawImmediate) { if (mChoreographer != null && !drawImmediate) { mChoreographer.postFrameCallback(this); } else { doFrameUncheckedLocked(); } } Loading Loading
core/java/android/view/ViewRootImpl.java +2 −2 Original line number Diff line number Diff line Loading @@ -2716,11 +2716,11 @@ public final class ViewRootImpl implements ViewParent, mAttachInfo.mHardwareRenderer.setStopped(false); } mAttachInfo.mHardwareRenderer.draw(mView, mAttachInfo, this); if (updated) { requestDrawWindow(); } mAttachInfo.mHardwareRenderer.draw(mView, mAttachInfo, this); } else { // If we get here with a disabled & requested hardware renderer, something went // wrong (an invalidate posted right before we destroyed the hardware surface Loading
core/java/com/android/internal/policy/BackdropFrameRenderer.java +26 −26 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.internal.policy; import static android.view.WindowCallbacks.RESIZE_MODE_FREEFORM; import android.graphics.Rect; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; Loading Loading @@ -102,9 +100,6 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame mOldSystemInsets.set(systemInsets); mOldStableInsets.set(stableInsets); mResizeMode = resizeMode; synchronized (this) { redrawLocked(initialBounds, fullscreen, mSystemInsets, mStableInsets); } // Kick off our draw thread. start(); Loading Loading @@ -160,7 +155,7 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame mSystemInsets.set(systemInsets); mStableInsets.set(stableInsets); // Notify of a bounds change. pingRenderLocked(); pingRenderLocked(false /* drawImmediate */); } } Loading @@ -172,7 +167,7 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame if (mRenderer != null) { // Enforce a window redraw. mOldTargetRect.set(0, 0, 0, 0); pingRenderLocked(); pingRenderLocked(false /* drawImmediate */); } } } Loading @@ -197,7 +192,7 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame mRenderer = null; // Exit the renderer loop. pingRenderLocked(); pingRenderLocked(false /* drawImmediate */); } } } Loading @@ -208,9 +203,6 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame Looper.prepare(); synchronized (this) { mChoreographer = Choreographer.getInstance(); // Draw at least once. mChoreographer.postFrameCallback(this); } Looper.loop(); } finally { Loading @@ -236,6 +228,11 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame Looper.myLooper().quit(); return; } doFrameUncheckedLocked(); } } private void doFrameUncheckedLocked() { mNewTargetRect.set(mTargetRect); if (!mNewTargetRect.equals(mOldTargetRect) || mOldFullscreen != mFullscreen Loading @@ -249,7 +246,6 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame redrawLocked(mNewTargetRect, mFullscreen, mSystemInsets, mStableInsets); } } } /** * The content is about to be drawn and we got the location of where it will be shown. Loading Loading @@ -288,7 +284,7 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame synchronized (this) { mReportNextDraw = reportNextDraw; mOldTargetRect.set(0, 0, 0, 0); pingRenderLocked(); pingRenderLocked(true /* drawImmediate */); } } Loading Loading @@ -403,10 +399,14 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame * Sends a message to the renderer to wake up and perform the next action which can be * either the next rendering or the self destruction if mRenderer is null. * Note: This call must be synchronized. * * @param drawImmediate if we should draw immediately instead of scheduling a frame */ private void pingRenderLocked() { if (mChoreographer != null) { private void pingRenderLocked(boolean drawImmediate) { if (mChoreographer != null && !drawImmediate) { mChoreographer.postFrameCallback(this); } else { doFrameUncheckedLocked(); } } Loading