Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a74777a authored by Liangliang Sui's avatar Liangliang Sui
Browse files

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: default avatarLiangliang Sui <coolsui.coding@gmail.com>
parent 77ff5996
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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();
        }
+1 −0
Original line number Diff line number Diff line
@@ -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,