Loading libs/hwui/pipeline/skia/GLFunctorDrawable.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #include "include/gpu/GpuTypes.h" // from Skia #include "utils/GLUtils.h" #include <effects/GainmapRenderer.h> #include "renderthread/CanvasContext.h" namespace android { namespace uirenderer { Loading Loading @@ -131,6 +132,8 @@ void GLFunctorDrawable::onDraw(SkCanvas* canvas) { mat4.getColMajor(&info.transform[0]); info.color_space_ptr = canvas->imageInfo().colorSpace(); info.currentHdrSdrRatio = getTargetHdrSdrRatio(info.color_space_ptr); info.fboColorType = canvas->imageInfo().colorType(); info.shouldDither = renderthread::CanvasContext::shouldDither(); // ensure that the framebuffer that the webview will render into is bound before we clear // the stencil and/or draw the functor. Loading libs/hwui/pipeline/skia/VkFunctorDrawable.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -15,22 +15,25 @@ */ #include "VkFunctorDrawable.h" #include <private/hwui/DrawVkInfo.h> #include <GrBackendDrawableInfo.h> #include <SkAndroidFrameworkUtils.h> #include <SkImage.h> #include <SkM44.h> #include <gui/TraceUtils.h> #include <private/hwui/DrawVkInfo.h> #include <utils/Color.h> #include <utils/Trace.h> #include <vk/GrVkTypes.h> #include <thread> #include "effects/GainmapRenderer.h" #include "renderthread/CanvasContext.h" #include "renderthread/RenderThread.h" #include "renderthread/VulkanManager.h" #include "thread/ThreadBase.h" #include "utils/TimeUtils.h" #include "effects/GainmapRenderer.h" namespace android { namespace uirenderer { Loading Loading @@ -75,6 +78,7 @@ void VkFunctorDrawHandler::draw(const GrBackendDrawableInfo& info) { .clip_bottom = mClip.fBottom, .is_layer = !vulkan_info.fFromSwapchainOrAndroidWindow, .currentHdrSdrRatio = getTargetHdrSdrRatio(mImageInfo.colorSpace()), .shouldDither = renderthread::CanvasContext::shouldDither(), }; mat4.getColMajor(¶ms.transform[0]); params.secondary_command_buffer = vulkan_info.fSecondaryCommandBuffer; Loading libs/hwui/private/hwui/DrawGlInfo.h +7 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define ANDROID_HWUI_DRAW_GL_INFO_H #include <SkColorSpace.h> #include <SkColorType.h> namespace android { namespace uirenderer { Loading Loading @@ -91,6 +92,12 @@ struct DrawGlInfo { // be baked into the color_space_ptr, so this is just to indicate the amount of extended // range is available if desired float currentHdrSdrRatio; // Whether or not dithering is globally enabled bool shouldDither; // The color type of the destination framebuffer SkColorType fboColorType; }; // struct DrawGlInfo } // namespace uirenderer Loading libs/hwui/private/hwui/DrawVkInfo.h +3 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,9 @@ struct VkFunctorDrawParams { // be baked into the color_space_ptr, so this is just to indicate the amount of extended // range is available if desired float currentHdrSdrRatio; // Whether or not dithering is globally enabled bool shouldDither; }; } // namespace uirenderer Loading libs/hwui/renderthread/CanvasContext.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -1078,6 +1078,12 @@ void CanvasContext::startHintSession() { mHintSessionWrapper.init(); } bool CanvasContext::shouldDither() { CanvasContext* self = getActiveContext(); if (!self) return false; return self->mColorMode != ColorMode::Default; } } /* namespace renderthread */ } /* namespace uirenderer */ } /* namespace android */ Loading
libs/hwui/pipeline/skia/GLFunctorDrawable.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #include "include/gpu/GpuTypes.h" // from Skia #include "utils/GLUtils.h" #include <effects/GainmapRenderer.h> #include "renderthread/CanvasContext.h" namespace android { namespace uirenderer { Loading Loading @@ -131,6 +132,8 @@ void GLFunctorDrawable::onDraw(SkCanvas* canvas) { mat4.getColMajor(&info.transform[0]); info.color_space_ptr = canvas->imageInfo().colorSpace(); info.currentHdrSdrRatio = getTargetHdrSdrRatio(info.color_space_ptr); info.fboColorType = canvas->imageInfo().colorType(); info.shouldDither = renderthread::CanvasContext::shouldDither(); // ensure that the framebuffer that the webview will render into is bound before we clear // the stencil and/or draw the functor. Loading
libs/hwui/pipeline/skia/VkFunctorDrawable.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -15,22 +15,25 @@ */ #include "VkFunctorDrawable.h" #include <private/hwui/DrawVkInfo.h> #include <GrBackendDrawableInfo.h> #include <SkAndroidFrameworkUtils.h> #include <SkImage.h> #include <SkM44.h> #include <gui/TraceUtils.h> #include <private/hwui/DrawVkInfo.h> #include <utils/Color.h> #include <utils/Trace.h> #include <vk/GrVkTypes.h> #include <thread> #include "effects/GainmapRenderer.h" #include "renderthread/CanvasContext.h" #include "renderthread/RenderThread.h" #include "renderthread/VulkanManager.h" #include "thread/ThreadBase.h" #include "utils/TimeUtils.h" #include "effects/GainmapRenderer.h" namespace android { namespace uirenderer { Loading Loading @@ -75,6 +78,7 @@ void VkFunctorDrawHandler::draw(const GrBackendDrawableInfo& info) { .clip_bottom = mClip.fBottom, .is_layer = !vulkan_info.fFromSwapchainOrAndroidWindow, .currentHdrSdrRatio = getTargetHdrSdrRatio(mImageInfo.colorSpace()), .shouldDither = renderthread::CanvasContext::shouldDither(), }; mat4.getColMajor(¶ms.transform[0]); params.secondary_command_buffer = vulkan_info.fSecondaryCommandBuffer; Loading
libs/hwui/private/hwui/DrawGlInfo.h +7 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define ANDROID_HWUI_DRAW_GL_INFO_H #include <SkColorSpace.h> #include <SkColorType.h> namespace android { namespace uirenderer { Loading Loading @@ -91,6 +92,12 @@ struct DrawGlInfo { // be baked into the color_space_ptr, so this is just to indicate the amount of extended // range is available if desired float currentHdrSdrRatio; // Whether or not dithering is globally enabled bool shouldDither; // The color type of the destination framebuffer SkColorType fboColorType; }; // struct DrawGlInfo } // namespace uirenderer Loading
libs/hwui/private/hwui/DrawVkInfo.h +3 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,9 @@ struct VkFunctorDrawParams { // be baked into the color_space_ptr, so this is just to indicate the amount of extended // range is available if desired float currentHdrSdrRatio; // Whether or not dithering is globally enabled bool shouldDither; }; } // namespace uirenderer Loading
libs/hwui/renderthread/CanvasContext.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -1078,6 +1078,12 @@ void CanvasContext::startHintSession() { mHintSessionWrapper.init(); } bool CanvasContext::shouldDither() { CanvasContext* self = getActiveContext(); if (!self) return false; return self->mColorMode != ColorMode::Default; } } /* namespace renderthread */ } /* namespace uirenderer */ } /* namespace android */