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

Unified Diff: Source/web/PageOverlayTest.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/PageOverlayTest.cpp
diff --git a/Source/web/PageOverlayTest.cpp b/Source/web/PageOverlayTest.cpp
index afbe4049ad8fc521358cc6785640f4ba6777596a..eb1b5065b06b0c143d1b7303a87a115b51f1eb79 100644
--- a/Source/web/PageOverlayTest.cpp
+++ b/Source/web/PageOverlayTest.cpp
@@ -105,10 +105,11 @@ public:
void paintPageOverlay(WebGraphicsContext* context, const WebSize& size) override
{
GraphicsContext& graphicsContext = toWebGraphicsContextImpl(context)->graphicsContext();
- FloatRect rect(0, 0, size.width, size.height);
- DrawingRecorder drawingRecorder(graphicsContext, *this, DisplayItem::PageOverlay, rect);
- if (!drawingRecorder.canUseCachedDrawing())
+ if (!DrawingRecorder::useCachedDrawingIfPossible(graphicsContext, *this, DisplayItem::PageOverlay)) {
Xianzhu 2015/07/03 01:24:42 Nit: 'if (DrawingRecorder::...) return;' seems
pdr. 2015/07/03 02:38:04 I agree. Done.
+ FloatRect rect(0, 0, size.width, size.height);
+ DrawingRecorder drawingRecorder(graphicsContext, *this, DisplayItem::PageOverlay, rect);
graphicsContext.fillRect(rect, m_color);
+ }
}
DisplayItemClient displayItemClient() const { return toDisplayItemClient(this); }

Powered by Google App Engine
This is Rietveld 408576698