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

Unified Diff: Source/core/paint/HTMLCanvasPainter.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/core/paint/HTMLCanvasPainter.cpp
diff --git a/Source/core/paint/HTMLCanvasPainter.cpp b/Source/core/paint/HTMLCanvasPainter.cpp
index c0c476acac87b7dffc1aaf53436d78fb9a9f19d2..a7260845271793b4abdb6977db7deaf36a5713a5 100644
--- a/Source/core/paint/HTMLCanvasPainter.cpp
+++ b/Source/core/paint/HTMLCanvasPainter.cpp
@@ -17,6 +17,8 @@ namespace blink {
void HTMLCanvasPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
GraphicsContext* context = paintInfo.context;
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*context, m_layoutHTMLCanvas, paintInfo.phase))
+ return;
LayoutRect contentRect = m_layoutHTMLCanvas.contentBoxRect();
contentRect.moveBy(paintOffset);
@@ -24,9 +26,6 @@ void HTMLCanvasPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPo
paintRect.moveBy(paintOffset);
LayoutObjectDrawingRecorder drawingRecorder(*context, m_layoutHTMLCanvas, paintInfo.phase, contentRect);
- if (drawingRecorder.canUseCachedDrawing())
- return;
-
#if ENABLE(ASSERT)
// The drawing may be in display list mode or image mode, producing different pictures for the same result.
drawingRecorder.setUnderInvalidationCheckingMode(DrawingDisplayItem::CheckBitmap);

Powered by Google App Engine
This is Rietveld 408576698