diff options
author | 2024-02-05 18:38:19 +0800 | |
---|---|---|
committer | 2024-02-05 16:15:17 +0000 | |
commit | 6a74777a800eea2f80bd0a8e7ded29a53aa4c43f (patch) | |
tree | 3d2103a6fbcf67e9d512d135fd29879a5f5e7349 | |
parent | 77ff5996acbe3cd2fde0f9eb559d3e77c3b48e3e (diff) |
Reduce some redundant steps
1. When |frame->pendingDirty.isEmpty()| is executed there, it must not be empty. Because the judgment has been made at the beginning of the applyRenderNodeTransform method.
2. When |dirty->isEmpty()|, |dirty->setIWH(frame.width(), frame.height());| can be returned directly after execution. There is no need to judge bufferAge, and subsequent steps are redundant. Because the maximum range of dirty is [0, 0, frame.width(), frame.height()]
Change-Id: Iccb3d39e4139c26ed5e7e24c39d1e141cb380dab
Signed-off-by: Liangliang Sui <coolsui.coding@gmail.com>
-rw-r--r-- | libs/hwui/DamageAccumulator.cpp | 2 | ||||
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/libs/hwui/DamageAccumulator.cpp b/libs/hwui/DamageAccumulator.cpp index a8d170d00ef7..f4d6b8cd9989 100644 --- a/libs/hwui/DamageAccumulator.cpp +++ b/libs/hwui/DamageAccumulator.cpp @@ -218,7 +218,7 @@ void DamageAccumulator::applyRenderNodeTransform(DirtyStack* frame) { } // Perform clipping - if (props.getClipDamageToBounds() && !frame->pendingDirty.isEmpty()) { + if (props.getClipDamageToBounds()) { if (!frame->pendingDirty.intersect(SkRect::MakeIWH(props.getWidth(), props.getHeight()))) { frame->pendingDirty.setEmpty(); } diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index f6907831e11f..bbbb0ca2ce6b 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -1031,6 +1031,7 @@ SkRect CanvasContext::computeDirtyRect(const Frame& frame, SkRect* dirty) { if (dirty->isEmpty()) { dirty->setIWH(frame.width(), frame.height()); + return *dirty; } // At this point dirty is the area of the window to update. However, |