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

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

Issue 2885773002: Revert of 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 9d79a3a211b8cac0767ae97c759398b000bf464b..d2c5c3808c77c2a4a6b4324fe07145943463e63c 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
@@ -300,16 +300,6 @@
if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled())
CheckUnderInvalidation();
-
- if (!frame_first_paints_.back().first_painted && display_item.IsDrawing() &&
- // Here we ignore all document-background paintings because we don't
- // know if the background is default. ViewPainter should have called
- // setFirstPainted() if this display item is for non-default
- // background.
- display_item.GetType() != DisplayItem::kDocumentBackground &&
- display_item.DrawsContent()) {
- SetFirstPainted();
- }
}
DisplayItem& PaintController::MoveItemFromCurrentListToNewList(size_t index) {
@@ -599,6 +589,21 @@
item.Client().ClearIsJustCreated();
if (item.SkippedCache())
skipped_cache_clients.push_back(&item.Client());
+ }
+ }
+
+ if (!first_painted_) {
+ for (const auto& item : new_display_item_list_) {
+ if (item.IsDrawing() &&
+ // Here we ignore all document-background paintings because we don't
+ // know if the background is default. ViewPainter should have called
+ // setFirstPainted() if this display item is for non-default
+ // background.
+ item.GetType() != DisplayItem::kDocumentBackground &&
+ item.DrawsContent()) {
+ first_painted_ = true;
+ break;
+ }
}
}
@@ -979,27 +984,4 @@
.data());
}
-void PaintController::SetFirstPainted() {
- frame_first_paints_.back().first_painted = true;
-}
-
-void PaintController::SetTextPainted() {
- frame_first_paints_.back().text_painted = true;
-}
-
-void PaintController::SetImagePainted() {
- frame_first_paints_.back().image_painted = true;
-}
-
-void PaintController::BeginFrame(const void* frame) {
- frame_first_paints_.push_back(FrameFirstPaint(frame));
-}
-
-FrameFirstPaint PaintController::EndFrame(const void* frame) {
- FrameFirstPaint result = frame_first_paints_.back();
- DCHECK(result.frame == frame);
- frame_first_paints_.pop_back();
- return result;
-}
-
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698