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..9352aef815ea8f09efe2e9cde186bf7f57317f7c 100644 |
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp |
@@ -577,7 +577,7 @@ void PaintController::CommitNewDisplayItems( |
} |
} |
- if (!first_painted_) { |
+ if (!FirstPainted(current_frames_.back())) { |
for (const auto& item : new_display_item_list_) { |
if (item.IsDrawing() && |
// Here we ignore all document-background paintings because we don't |
@@ -586,7 +586,7 @@ void PaintController::CommitNewDisplayItems( |
// background. |
item.GetType() != DisplayItem::kDocumentBackground && |
item.DrawsContent()) { |
- first_painted_ = true; |
+ SetFirstPainted(); |
break; |
} |
} |
@@ -944,4 +944,49 @@ void PaintController::ShowDebugDataInternal(bool show_paint_records) const { |
.data()); |
} |
+bool PaintController::FirstPainted(const void* frame) const { |
+ if (first_painted_.Contains(frame)) |
+ return first_painted_.at(frame); |
+ |
+ return false; |
+} |
+ |
+void PaintController::SetFirstPainted() { |
+ DCHECK(!current_frames_.IsEmpty()); |
+ first_painted_.Set(current_frames_.back(), true); |
+} |
+ |
+bool PaintController::TextPainted(const void* frame) const { |
+ if (text_painted_.Contains(frame)) |
+ return text_painted_.at(frame); |
+ |
+ return false; |
+} |
+ |
+void PaintController::SetTextPainted() { |
+ DCHECK(!current_frames_.IsEmpty()); |
+ text_painted_.Set(current_frames_.back(), true); |
+} |
+ |
+bool PaintController::ImagePainted(const void* frame) const { |
+ if (image_painted_.Contains(frame)) |
+ return image_painted_.at(frame); |
+ |
+ return false; |
+} |
+ |
+void PaintController::SetImagePainted() { |
+ DCHECK(!current_frames_.IsEmpty()); |
+ image_painted_.Set(current_frames_.back(), true); |
+} |
+ |
+void PaintController::BeginFrame(const void* frame) { |
+ current_frames_.push_back(frame); |
+} |
+ |
+void PaintController::EndFrame(const void* frame) { |
+ DCHECK(current_frames_.back() == frame); |
+ current_frames_.pop_back(); |
+} |
+ |
} // namespace blink |