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

Unified Diff: Source/web/PageWidgetDelegate.cpp

Issue 1220583004: Refactor DrawingRecorders to check for cached drawings earlier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix some !'s and &&'s. De Morgan would be proud. Created 5 years, 6 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: Source/web/PageWidgetDelegate.cpp
diff --git a/Source/web/PageWidgetDelegate.cpp b/Source/web/PageWidgetDelegate.cpp
index 74437cd62d55069b697132de06d21735aada426c..def3549942eda46213ad1ee85ab105f0adfb9ad0 100644
--- a/Source/web/PageWidgetDelegate.cpp
+++ b/Source/web/PageWidgetDelegate.cpp
@@ -95,9 +95,10 @@ void PageWidgetDelegate::paint(Page& page, PageOverlayList* overlays, WebCanvas*
if (overlays)
overlays->paintWebFrame(paintContext);
} else {
- DrawingRecorder drawingRecorder(paintContext, root, DisplayItem::PageWidgetDelegateBackgroundFallback, dirtyRect);
- if (!drawingRecorder.canUseCachedDrawing())
+ if (!DrawingRecorder::useCachedDrawingIfPossible(paintContext, root, DisplayItem::PageWidgetDelegateBackgroundFallback)) {
Xianzhu 2015/07/03 01:24:42 Nit: can use 'else if' to avoid indentation change
pdr. 2015/07/03 02:38:05 Done.
+ DrawingRecorder drawingRecorder(paintContext, root, DisplayItem::PageWidgetDelegateBackgroundFallback, dirtyRect);
paintContext.fillRect(dirtyRect, Color::white);
+ }
}
}
pictureBuilder.endRecording()->playback(canvas);

Powered by Google App Engine
This is Rietveld 408576698