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

Commit 950e487

Browse files
committed
Do full repaint after removing platform view
1 parent b287247 commit 950e487

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

flow/diff_context.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@ bool DiffContext::PushCullRect(const SkRect& clip) {
162162
return !state_.matrix_clip.device_cull_rect().isEmpty();
163163
}
164164

165-
void DiffContext::ForceFullRepaint() {
166-
damage_ = SkRect::MakeIWH(frame_size_.width(), frame_size_.height());
167-
}
168-
169165
SkMatrix DiffContext::GetTransform3x3() const {
170166
return state_.matrix_clip.matrix_3x3();
171167
}
@@ -207,6 +203,12 @@ void DiffContext::AddLayerBounds(const SkRect& rect) {
207203
}
208204
}
209205

206+
void DiffContext::RepaintEntireFrame() {
207+
auto frame_rect = SkRect::MakeIWH(frame_size_.width(), frame_size_.height());
208+
rects_->push_back(frame_rect);
209+
AddDamage(frame_rect);
210+
}
211+
210212
void DiffContext::MarkSubtreeHasVolatileLayer() {
211213
// Set the has_texture flag on current state and all parent states. That
212214
// way we'll know that we can't skip diff for retained layers because

flow/diff_context.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ class DiffContext {
7777
// Pushes cull rect for current subtree
7878
bool PushCullRect(const SkRect& clip);
7979

80-
// Marks entire frame as dirty.
81-
void ForceFullRepaint();
82-
8380
// Function that adjusts layer bounds (in device coordinates) depending
8481
// on filter.
8582
using FilterBoundsAdjustment = std::function<SkRect(SkRect)>;
@@ -119,6 +116,9 @@ class DiffContext {
119116
// coordinates.
120117
void AddLayerBounds(const SkRect& rect);
121118

119+
// Marks entire frame as dirty.
120+
void RepaintEntireFrame();
121+
122122
// Add entire paint region of retained layer for current subtree. This can
123123
// only be used in subtrees that are not dirty, otherwise ancestor transforms
124124
// or clips may result in different paint region.

flow/layers/platform_view_layer.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ void PlatformViewLayer::Diff(DiffContext* context, const Layer* old_layer) {
1717
DiffContext::AutoSubtreeRestore subtree(context);
1818
// Ensure that Diff is called again even if this layer is in retained subtree.
1919
context->MarkSubtreeHasVolatileLayer();
20-
// It is not necessary to track the actual paint region for the layer due to
21-
// forced full repaint below, but the paint region carries the volatile layer
22-
// flag.
20+
// Partial repaint is disabled when platform view is present. This will also
21+
// set whole frame as the layer paint region, which will ensure full repaint
22+
// when the layer is removed.
23+
context->RepaintEntireFrame();
2324
context->SetLayerPaintRegion(this, context->CurrentSubtreeRegion());
24-
context->ForceFullRepaint();
2525
}
2626

2727
void PlatformViewLayer::Preroll(PrerollContext* context) {

0 commit comments

Comments
 (0)