Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 7a5e736

Browse files
committed
Rename AddPaintRegion to AddExistingPaintRegion
This overload is used when reusing paint region from retained layers and name should reflect it.
1 parent a5761fe commit 7a5e736

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

flow/diff_context.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ void DiffContext::AddPaintRegion(const SkRect& rect) {
9292
}
9393
}
9494

95-
void DiffContext::AddPaintRegion(const PaintRegion& region) {
95+
void DiffContext::AddExistingPaintRegion(const PaintRegion& region) {
96+
// Adding paint region for retained layer implies that current subtree is not
97+
// dirty
98+
FML_DCHECK(!IsSubtreeDirty());
9699
FML_DCHECK(region.is_valid());
97100
rects_->insert(rects_->end(), region.begin(), region.end());
98101
}

flow/diff_context.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ class DiffContext {
134134
// Add paint region for layer; rect is in "local" (layer) coordinates
135135
void AddPaintRegion(const SkRect& rect);
136136

137-
// Add entire paint region for current subtree
138-
void AddPaintRegion(const PaintRegion& region);
137+
// Add entire paint region of retained layer for current subtree
138+
void AddExistingPaintRegion(const PaintRegion& region);
139139

140140
// The idea of readback region is that if any part of the readback region
141141
// needs to be repainted, then the whole readback region must be repainted;

flow/layers/container_layer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void ContainerLayer::DiffChildren(DiffContext* context,
8686
// previous frame; We can only do this if there is no readback in the
8787
// subtree. Layers that do readback must be able to register readback
8888
// inside Diff
89-
context->AddPaintRegion(paint_region);
89+
context->AddExistingPaintRegion(paint_region);
9090

9191
// While we don't need to diff retained layers, we still need to
9292
// associate their paint region with current layer tree so that we can

0 commit comments

Comments
 (0)