Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2588)

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp

Issue 2874553002: [SPv2] Fix layout test crashes about raster invalidation (Closed)
Patch Set: - Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
index c5ee0d2dcc69c2d3d5ab7f4d6cfc8b4a27faec58..f39d34c64f7575a47d6ab605524dd2b3083c5cc8 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
@@ -21,7 +21,8 @@ static constexpr int kMaxNumberOfSlowPathsBeforeVeto = 5;
namespace blink {
void PaintController::SetTracksRasterInvalidations(bool value) {
- if (value) {
+ if (value ||
+ RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) {
paint_chunks_raster_invalidation_tracking_map_ =
WTF::WrapUnique(new RasterInvalidationTrackingMap<const PaintChunk>);
} else {
@@ -597,9 +598,15 @@ void PaintController::CommitNewDisplayItems(
// The new list will not be appended to again so we can release unused memory.
new_display_item_list_.ShrinkToFit();
+
+ if (paint_chunks_raster_invalidation_tracking_map_) {
+ for (const auto& chunk : current_paint_artifact_.PaintChunks())
+ paint_chunks_raster_invalidation_tracking_map_->Remove(&chunk);
+ }
current_paint_artifact_ = PaintArtifact(
std::move(new_display_item_list_), new_paint_chunks_.ReleasePaintChunks(),
num_slow_paths <= kMaxNumberOfSlowPathsBeforeVeto);
+
ResetCurrentListIndices();
out_of_order_item_indices_.clear();
out_of_order_chunk_indices_.clear();
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698