Loading core/java/android/view/ViewRootImpl.java +20 −1 Original line number Diff line number Diff line Loading @@ -2289,6 +2289,7 @@ public final class ViewRootImpl implements ViewParent, surfaceChanged |= surfaceSizeChanged; final boolean alwaysConsumeNavBarChanged = mPendingAlwaysConsumeNavBar != mAttachInfo.mAlwaysConsumeNavBar; final boolean colorModeChanged = hasColorModeChanged(lp.getColorMode()); if (contentInsetsChanged) { mAttachInfo.mContentInsets.set(mPendingContentInsets); if (DEBUG_LAYOUT) Log.v(mTag, "Content insets changing to: " Loading Loading @@ -2335,6 +2336,10 @@ public final class ViewRootImpl implements ViewParent, if (DEBUG_LAYOUT) Log.v(mTag, "Visible insets changing to: " + mAttachInfo.mVisibleInsets); } if (colorModeChanged && mAttachInfo.mThreadedRenderer != null) { mAttachInfo.mThreadedRenderer.setWideGamut( lp.getColorMode() == ActivityInfo.COLOR_MODE_WIDE_COLOR_GAMUT); } if (!hadSurface) { if (mSurface.isValid()) { Loading Loading @@ -2387,7 +2392,7 @@ public final class ViewRootImpl implements ViewParent, mAttachInfo.mThreadedRenderer.destroy(); } } else if ((surfaceGenerationId != mSurface.getGenerationId() || surfaceSizeChanged || windowRelayoutWasForced) || surfaceSizeChanged || windowRelayoutWasForced || colorModeChanged) && mSurfaceHolder == null && mAttachInfo.mThreadedRenderer != null) { mFullRedrawNeeded = true; Loading Loading @@ -4009,6 +4014,20 @@ public final class ViewRootImpl implements ViewParent, } } private boolean hasColorModeChanged(int colorMode) { if (mAttachInfo.mThreadedRenderer == null) { return false; } final boolean isWideGamut = colorMode == ActivityInfo.COLOR_MODE_WIDE_COLOR_GAMUT; if (mAttachInfo.mThreadedRenderer.isWideGamut() == isWideGamut) { return false; } if (isWideGamut && !mContext.getResources().getConfiguration().isScreenWideColorGamut()) { return false; } return true; } @Override public void requestChildFocus(View child, View focused) { if (DEBUG_INPUT_RESIZE) { Loading graphics/java/android/graphics/HardwareRenderer.java +7 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ public class HardwareRenderer { private boolean mOpaque = true; private boolean mForceDark = false; private FrameInfo mScratchInfo; private boolean mIsWideGamut = false; /** * Creates a new instance of a HardwareRenderer. The HardwareRenderer will default Loading Loading @@ -498,6 +499,7 @@ public class HardwareRenderer { * @hide */ public void setWideGamut(boolean wideGamut) { mIsWideGamut = wideGamut; nSetWideGamut(mNativeProxy, wideGamut); } Loading Loading @@ -673,6 +675,11 @@ public class HardwareRenderer { nSetPictureCaptureCallback(mNativeProxy, callback); } /** @hide */ public boolean isWideGamut() { return mIsWideGamut; } /** called by native */ static void invokePictureCapturedCallback(long picturePtr, PictureCapturedCallback callback) { Picture picture = new Picture(picturePtr); Loading Loading
core/java/android/view/ViewRootImpl.java +20 −1 Original line number Diff line number Diff line Loading @@ -2289,6 +2289,7 @@ public final class ViewRootImpl implements ViewParent, surfaceChanged |= surfaceSizeChanged; final boolean alwaysConsumeNavBarChanged = mPendingAlwaysConsumeNavBar != mAttachInfo.mAlwaysConsumeNavBar; final boolean colorModeChanged = hasColorModeChanged(lp.getColorMode()); if (contentInsetsChanged) { mAttachInfo.mContentInsets.set(mPendingContentInsets); if (DEBUG_LAYOUT) Log.v(mTag, "Content insets changing to: " Loading Loading @@ -2335,6 +2336,10 @@ public final class ViewRootImpl implements ViewParent, if (DEBUG_LAYOUT) Log.v(mTag, "Visible insets changing to: " + mAttachInfo.mVisibleInsets); } if (colorModeChanged && mAttachInfo.mThreadedRenderer != null) { mAttachInfo.mThreadedRenderer.setWideGamut( lp.getColorMode() == ActivityInfo.COLOR_MODE_WIDE_COLOR_GAMUT); } if (!hadSurface) { if (mSurface.isValid()) { Loading Loading @@ -2387,7 +2392,7 @@ public final class ViewRootImpl implements ViewParent, mAttachInfo.mThreadedRenderer.destroy(); } } else if ((surfaceGenerationId != mSurface.getGenerationId() || surfaceSizeChanged || windowRelayoutWasForced) || surfaceSizeChanged || windowRelayoutWasForced || colorModeChanged) && mSurfaceHolder == null && mAttachInfo.mThreadedRenderer != null) { mFullRedrawNeeded = true; Loading Loading @@ -4009,6 +4014,20 @@ public final class ViewRootImpl implements ViewParent, } } private boolean hasColorModeChanged(int colorMode) { if (mAttachInfo.mThreadedRenderer == null) { return false; } final boolean isWideGamut = colorMode == ActivityInfo.COLOR_MODE_WIDE_COLOR_GAMUT; if (mAttachInfo.mThreadedRenderer.isWideGamut() == isWideGamut) { return false; } if (isWideGamut && !mContext.getResources().getConfiguration().isScreenWideColorGamut()) { return false; } return true; } @Override public void requestChildFocus(View child, View focused) { if (DEBUG_INPUT_RESIZE) { Loading
graphics/java/android/graphics/HardwareRenderer.java +7 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ public class HardwareRenderer { private boolean mOpaque = true; private boolean mForceDark = false; private FrameInfo mScratchInfo; private boolean mIsWideGamut = false; /** * Creates a new instance of a HardwareRenderer. The HardwareRenderer will default Loading Loading @@ -498,6 +499,7 @@ public class HardwareRenderer { * @hide */ public void setWideGamut(boolean wideGamut) { mIsWideGamut = wideGamut; nSetWideGamut(mNativeProxy, wideGamut); } Loading Loading @@ -673,6 +675,11 @@ public class HardwareRenderer { nSetPictureCaptureCallback(mNativeProxy, callback); } /** @hide */ public boolean isWideGamut() { return mIsWideGamut; } /** called by native */ static void invokePictureCapturedCallback(long picturePtr, PictureCapturedCallback callback) { Picture picture = new Picture(picturePtr); Loading