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

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

Issue 2872793002: Notify paint for each frame (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
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

Powered by Google App Engine
This is Rietveld 408576698