diff options
| author | 2024-12-13 17:01:31 -0800 | |
|---|---|---|
| committer | 2024-12-13 17:01:31 -0800 | |
| commit | 10e260fc86f8b879e9a88610994344f30bea7520 (patch) | |
| tree | f16b3cfbd86ebc5e0723170311f2bc6c4eb3589d /libs/hwui/RenderNode.cpp | |
| parent | c04c1151c4edc9c95786cd47e823a8ac83224ee9 (diff) | |
| parent | 2e5f670c869a25175d30b3821a6ed6da432d5b66 (diff) | |
Merge 24Q4 into AOSP main
Bug: 370570306
Merged-In: I3d210caa7b15c24eaf523207e4905b20a2894260
Change-Id: Ic3c8148937e940a0258e790ff89463dae79e992c
Diffstat (limited to 'libs/hwui/RenderNode.cpp')
| -rw-r--r-- | libs/hwui/RenderNode.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp index 589abb4d87f4..2c23864317a4 100644 --- a/libs/hwui/RenderNode.cpp +++ b/libs/hwui/RenderNode.cpp @@ -404,13 +404,19 @@ void RenderNode::syncDisplayList(TreeObserver& observer, TreeInfo* info) { } } +inline bool RenderNode::isForceInvertDark(TreeInfo& info) { + return CC_UNLIKELY( + info.forceDarkType == android::uirenderer::ForceDarkType::FORCE_INVERT_COLOR_DARK); +} + inline bool RenderNode::shouldEnableForceDark(TreeInfo* info) { return CC_UNLIKELY( info && - (!info->disableForceDark || - info->forceDarkType == android::uirenderer::ForceDarkType::FORCE_INVERT_COLOR_DARK)); + (!info->disableForceDark || isForceInvertDark(*info))); } + + void RenderNode::handleForceDark(android::uirenderer::TreeInfo *info) { if (!shouldEnableForceDark(info)) { return; @@ -421,7 +427,7 @@ void RenderNode::handleForceDark(android::uirenderer::TreeInfo *info) { children.push_back(node); }); if (mDisplayList.hasText()) { - if (mDisplayList.hasFill()) { + if (isForceInvertDark(*info) && mDisplayList.hasFill()) { // Handle a special case for custom views that draw both text and background in the // same RenderNode, which would otherwise be altered to white-on-white text. usage = UsageHint::Container; |