Loading core/java/android/view/ThreadedRenderer.java +8 −1 Original line number Diff line number Diff line Loading @@ -341,6 +341,7 @@ public final class ThreadedRenderer { private boolean mEnabled; private boolean mRequested = true; private boolean mIsOpaque = false; ThreadedRenderer(Context context, boolean translucent, String name) { final TypedArray a = context.obtainStyledAttributes(null, R.styleable.Lighting, 0, 0); Loading @@ -355,6 +356,7 @@ public final class ThreadedRenderer { long rootNodePtr = nCreateRootRenderNode(); mRootNode = RenderNode.adopt(rootNodePtr); mRootNode.setClipToBounds(false); mIsOpaque = !translucent; mNativeProxy = nCreateProxy(translucent, rootNodePtr); nSetName(mNativeProxy, name); Loading Loading @@ -571,7 +573,12 @@ public final class ThreadedRenderer { * Change the ThreadedRenderer's opacity */ void setOpaque(boolean opaque) { nSetOpaque(mNativeProxy, opaque && !mHasInsets); mIsOpaque = opaque && !mHasInsets; nSetOpaque(mNativeProxy, mIsOpaque); } boolean isOpaque() { return mIsOpaque; } /** Loading core/java/android/view/ViewRootImpl.java +11 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import android.content.res.CompatibilityInfo; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.PixelFormat; import android.graphics.Point; Loading Loading @@ -2651,6 +2652,15 @@ public final class ViewRootImpl implements ViewParent, @Override public void onPreDraw(DisplayListCanvas canvas) { // If mCurScrollY is not 0 then this influences the hardwareYOffset. The end result is we // can apply offsets that are not handled by anything else, resulting in underdraw as // the View is shifted (thus shifting the window background) exposing unpainted // content. To handle this with minimal glitches we just clear to BLACK if the window // is opaque. If it's not opaque then HWUI already internally does a glClear to // transparent, so there's no risk of underdraw on non-opaque surfaces. if (mCurScrollY != 0 && mHardwareYOffset != 0 && mAttachInfo.mThreadedRenderer.isOpaque()) { canvas.drawColor(Color.BLACK); } canvas.translate(-mHardwareXOffset, -mHardwareYOffset); } Loading @@ -2668,7 +2678,7 @@ public final class ViewRootImpl implements ViewParent, void outputDisplayList(View view) { view.mRenderNode.output(); if (mAttachInfo.mThreadedRenderer != null) { ((ThreadedRenderer)mAttachInfo.mThreadedRenderer).serializeDisplayListTree(); mAttachInfo.mThreadedRenderer.serializeDisplayListTree(); } } Loading Loading
core/java/android/view/ThreadedRenderer.java +8 −1 Original line number Diff line number Diff line Loading @@ -341,6 +341,7 @@ public final class ThreadedRenderer { private boolean mEnabled; private boolean mRequested = true; private boolean mIsOpaque = false; ThreadedRenderer(Context context, boolean translucent, String name) { final TypedArray a = context.obtainStyledAttributes(null, R.styleable.Lighting, 0, 0); Loading @@ -355,6 +356,7 @@ public final class ThreadedRenderer { long rootNodePtr = nCreateRootRenderNode(); mRootNode = RenderNode.adopt(rootNodePtr); mRootNode.setClipToBounds(false); mIsOpaque = !translucent; mNativeProxy = nCreateProxy(translucent, rootNodePtr); nSetName(mNativeProxy, name); Loading Loading @@ -571,7 +573,12 @@ public final class ThreadedRenderer { * Change the ThreadedRenderer's opacity */ void setOpaque(boolean opaque) { nSetOpaque(mNativeProxy, opaque && !mHasInsets); mIsOpaque = opaque && !mHasInsets; nSetOpaque(mNativeProxy, mIsOpaque); } boolean isOpaque() { return mIsOpaque; } /** Loading
core/java/android/view/ViewRootImpl.java +11 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import android.content.res.CompatibilityInfo; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.PixelFormat; import android.graphics.Point; Loading Loading @@ -2651,6 +2652,15 @@ public final class ViewRootImpl implements ViewParent, @Override public void onPreDraw(DisplayListCanvas canvas) { // If mCurScrollY is not 0 then this influences the hardwareYOffset. The end result is we // can apply offsets that are not handled by anything else, resulting in underdraw as // the View is shifted (thus shifting the window background) exposing unpainted // content. To handle this with minimal glitches we just clear to BLACK if the window // is opaque. If it's not opaque then HWUI already internally does a glClear to // transparent, so there's no risk of underdraw on non-opaque surfaces. if (mCurScrollY != 0 && mHardwareYOffset != 0 && mAttachInfo.mThreadedRenderer.isOpaque()) { canvas.drawColor(Color.BLACK); } canvas.translate(-mHardwareXOffset, -mHardwareYOffset); } Loading @@ -2668,7 +2678,7 @@ public final class ViewRootImpl implements ViewParent, void outputDisplayList(View view) { view.mRenderNode.output(); if (mAttachInfo.mThreadedRenderer != null) { ((ThreadedRenderer)mAttachInfo.mThreadedRenderer).serializeDisplayListTree(); mAttachInfo.mThreadedRenderer.serializeDisplayListTree(); } } Loading