Loading libs/hwui/RenderNode.cpp +10 −4 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ #ifdef __ANDROID__ #include "include/gpu/ganesh/SkImageGanesh.h" #endif #include "utils/ForceDark.h" #include "utils/MathUtils.h" #include "utils/StringUtils.h" Loading Loading @@ -403,16 +404,21 @@ void RenderNode::syncDisplayList(TreeObserver& observer, TreeInfo* info) { deleteDisplayList(observer, info); mDisplayList = std::move(mStagingDisplayList); if (mDisplayList) { WebViewSyncData syncData { .applyForceDark = info && !info->disableForceDark }; WebViewSyncData syncData{.applyForceDark = shouldEnableForceDark(info)}; mDisplayList.syncContents(syncData); handleForceDark(info); } } inline bool RenderNode::shouldEnableForceDark(TreeInfo* info) { return CC_UNLIKELY( info && (!info->disableForceDark || info->forceDarkType == android::uirenderer::ForceDarkType::FORCE_INVERT_COLOR_DARK)); } void RenderNode::handleForceDark(android::uirenderer::TreeInfo *info) { if (CC_LIKELY(!info || info->disableForceDark)) { if (!shouldEnableForceDark(info)) { return; } auto usage = usageHint(); Loading libs/hwui/RenderNode.h +1 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,7 @@ private: void syncProperties(); void syncDisplayList(TreeObserver& observer, TreeInfo* info); void handleForceDark(TreeInfo* info); bool shouldEnableForceDark(TreeInfo* info); void prepareTreeImpl(TreeObserver& observer, TreeInfo& info, bool functorsNeedLayer); void pushStagingPropertiesChanges(TreeInfo& info); Loading libs/hwui/TreeInfo.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ TreeInfo::TreeInfo(TraversalMode mode, renderthread::CanvasContext& canvasContex , prepareTextures(mode == MODE_FULL) , canvasContext(canvasContext) , disableForceDark(canvasContext.getForceDarkType() == ForceDarkType::NONE ? 1 : 0) , forceDarkType(canvasContext.getForceDarkType()) , screenSize(canvasContext.getNextFrameSize()) {} } // namespace android::uirenderer libs/hwui/TreeInfo.h +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include "Properties.h" #include "SkSize.h" #include "SkippedFrameInfo.h" #include "utils/ForceDark.h" #include "utils/Macros.h" namespace android { Loading Loading @@ -97,6 +98,7 @@ public: bool updateWindowPositions = false; int disableForceDark; ForceDarkType forceDarkType = ForceDarkType::NONE; const SkISize screenSize; Loading Loading
libs/hwui/RenderNode.cpp +10 −4 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ #ifdef __ANDROID__ #include "include/gpu/ganesh/SkImageGanesh.h" #endif #include "utils/ForceDark.h" #include "utils/MathUtils.h" #include "utils/StringUtils.h" Loading Loading @@ -403,16 +404,21 @@ void RenderNode::syncDisplayList(TreeObserver& observer, TreeInfo* info) { deleteDisplayList(observer, info); mDisplayList = std::move(mStagingDisplayList); if (mDisplayList) { WebViewSyncData syncData { .applyForceDark = info && !info->disableForceDark }; WebViewSyncData syncData{.applyForceDark = shouldEnableForceDark(info)}; mDisplayList.syncContents(syncData); handleForceDark(info); } } inline bool RenderNode::shouldEnableForceDark(TreeInfo* info) { return CC_UNLIKELY( info && (!info->disableForceDark || info->forceDarkType == android::uirenderer::ForceDarkType::FORCE_INVERT_COLOR_DARK)); } void RenderNode::handleForceDark(android::uirenderer::TreeInfo *info) { if (CC_LIKELY(!info || info->disableForceDark)) { if (!shouldEnableForceDark(info)) { return; } auto usage = usageHint(); Loading
libs/hwui/RenderNode.h +1 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,7 @@ private: void syncProperties(); void syncDisplayList(TreeObserver& observer, TreeInfo* info); void handleForceDark(TreeInfo* info); bool shouldEnableForceDark(TreeInfo* info); void prepareTreeImpl(TreeObserver& observer, TreeInfo& info, bool functorsNeedLayer); void pushStagingPropertiesChanges(TreeInfo& info); Loading
libs/hwui/TreeInfo.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ TreeInfo::TreeInfo(TraversalMode mode, renderthread::CanvasContext& canvasContex , prepareTextures(mode == MODE_FULL) , canvasContext(canvasContext) , disableForceDark(canvasContext.getForceDarkType() == ForceDarkType::NONE ? 1 : 0) , forceDarkType(canvasContext.getForceDarkType()) , screenSize(canvasContext.getNextFrameSize()) {} } // namespace android::uirenderer
libs/hwui/TreeInfo.h +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include "Properties.h" #include "SkSize.h" #include "SkippedFrameInfo.h" #include "utils/ForceDark.h" #include "utils/Macros.h" namespace android { Loading Loading @@ -97,6 +98,7 @@ public: bool updateWindowPositions = false; int disableForceDark; ForceDarkType forceDarkType = ForceDarkType::NONE; const SkISize screenSize; Loading