Loading libs/hwui/renderthread/EglManager.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ // Android-specific addition that is used to show when frames began in systrace EGLAPI void EGLAPIENTRY eglBeginFrame(EGLDisplay dpy, EGLSurface surface); static constexpr auto P3_XRB = static_cast<android_dataspace>( ADATASPACE_STANDARD_DCI_P3 | ADATASPACE_TRANSFER_SRGB | ADATASPACE_RANGE_EXTENDED); namespace android { namespace uirenderer { namespace renderthread { Loading Loading @@ -497,9 +500,7 @@ Result<EGLSurface, EGLint> EglManager::createSurface(EGLNativeWindowType window, // This relies on knowing that EGL will not re-set the dataspace after the call to // eglCreateWindowSurface. Since the handling of the colorspace extension is largely // implemented in libEGL in the platform, we can safely assume this is the case int32_t err = ANativeWindow_setBuffersDataSpace( window, static_cast<android_dataspace>(STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_EXTENDED)); int32_t err = ANativeWindow_setBuffersDataSpace(window, P3_XRB); LOG_ALWAYS_FATAL_IF(err, "Failed to ANativeWindow_setBuffersDataSpace %d", err); } Loading libs/hwui/renderthread/VulkanSurface.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -29,6 +29,9 @@ namespace android { namespace uirenderer { namespace renderthread { static constexpr auto P3_XRB = static_cast<android_dataspace>( ADATASPACE_STANDARD_DCI_P3 | ADATASPACE_TRANSFER_SRGB | ADATASPACE_RANGE_EXTENDED); static int InvertTransform(int transform) { switch (transform) { case ANATIVEWINDOW_TRANSFORM_ROTATE_90: Loading Loading @@ -214,8 +217,7 @@ bool VulkanSurface::InitializeWindowInfoStruct(ANativeWindow* window, ColorMode outWindowInfo->colorMode = colorMode; if (colorMode == ColorMode::Hdr || colorMode == ColorMode::Hdr10) { outWindowInfo->dataspace = static_cast<android_dataspace>(STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_EXTENDED); outWindowInfo->dataspace = P3_XRB; } else { outWindowInfo->dataspace = ColorSpaceToADataSpace(colorSpace.get(), colorType); } Loading Loading @@ -541,8 +543,7 @@ void VulkanSurface::setColorSpace(sk_sp<SkColorSpace> colorSpace) { } if (mWindowInfo.colorMode == ColorMode::Hdr || mWindowInfo.colorMode == ColorMode::Hdr10) { mWindowInfo.dataspace = static_cast<android_dataspace>(STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_EXTENDED); mWindowInfo.dataspace = P3_XRB; } else { mWindowInfo.dataspace = ColorSpaceToADataSpace( mWindowInfo.colorspace.get(), BufferFormatToColorType(mWindowInfo.bufferFormat)); Loading Loading
libs/hwui/renderthread/EglManager.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ // Android-specific addition that is used to show when frames began in systrace EGLAPI void EGLAPIENTRY eglBeginFrame(EGLDisplay dpy, EGLSurface surface); static constexpr auto P3_XRB = static_cast<android_dataspace>( ADATASPACE_STANDARD_DCI_P3 | ADATASPACE_TRANSFER_SRGB | ADATASPACE_RANGE_EXTENDED); namespace android { namespace uirenderer { namespace renderthread { Loading Loading @@ -497,9 +500,7 @@ Result<EGLSurface, EGLint> EglManager::createSurface(EGLNativeWindowType window, // This relies on knowing that EGL will not re-set the dataspace after the call to // eglCreateWindowSurface. Since the handling of the colorspace extension is largely // implemented in libEGL in the platform, we can safely assume this is the case int32_t err = ANativeWindow_setBuffersDataSpace( window, static_cast<android_dataspace>(STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_EXTENDED)); int32_t err = ANativeWindow_setBuffersDataSpace(window, P3_XRB); LOG_ALWAYS_FATAL_IF(err, "Failed to ANativeWindow_setBuffersDataSpace %d", err); } Loading
libs/hwui/renderthread/VulkanSurface.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -29,6 +29,9 @@ namespace android { namespace uirenderer { namespace renderthread { static constexpr auto P3_XRB = static_cast<android_dataspace>( ADATASPACE_STANDARD_DCI_P3 | ADATASPACE_TRANSFER_SRGB | ADATASPACE_RANGE_EXTENDED); static int InvertTransform(int transform) { switch (transform) { case ANATIVEWINDOW_TRANSFORM_ROTATE_90: Loading Loading @@ -214,8 +217,7 @@ bool VulkanSurface::InitializeWindowInfoStruct(ANativeWindow* window, ColorMode outWindowInfo->colorMode = colorMode; if (colorMode == ColorMode::Hdr || colorMode == ColorMode::Hdr10) { outWindowInfo->dataspace = static_cast<android_dataspace>(STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_EXTENDED); outWindowInfo->dataspace = P3_XRB; } else { outWindowInfo->dataspace = ColorSpaceToADataSpace(colorSpace.get(), colorType); } Loading Loading @@ -541,8 +543,7 @@ void VulkanSurface::setColorSpace(sk_sp<SkColorSpace> colorSpace) { } if (mWindowInfo.colorMode == ColorMode::Hdr || mWindowInfo.colorMode == ColorMode::Hdr10) { mWindowInfo.dataspace = static_cast<android_dataspace>(STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_EXTENDED); mWindowInfo.dataspace = P3_XRB; } else { mWindowInfo.dataspace = ColorSpaceToADataSpace( mWindowInfo.colorspace.get(), BufferFormatToColorType(mWindowInfo.bufferFormat)); Loading