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

Unified Diff: Source/core/paint/EmbeddedObjectPainter.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/EmbeddedObjectPainter.cpp
diff --git a/Source/core/paint/EmbeddedObjectPainter.cpp b/Source/core/paint/EmbeddedObjectPainter.cpp
index 86a3490c710e6ebfe16ce8c29566999145f7ac33..8dd5c5bc11ca175a8a1fe3f24088692756a54064 100644
--- a/Source/core/paint/EmbeddedObjectPainter.cpp
+++ b/Source/core/paint/EmbeddedObjectPainter.cpp
@@ -44,12 +44,12 @@ void EmbeddedObjectPainter::paintReplaced(const PaintInfo& paintInfo, const Layo
return;
GraphicsContext* context = paintInfo.context;
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*context, m_layoutEmbeddedObject, paintInfo.phase))
+ return;
+
FloatRect contentRect = m_layoutEmbeddedObject.contentBoxRect();
contentRect.moveBy(roundedIntPoint(paintOffset));
LayoutObjectDrawingRecorder drawingRecorder(*context, m_layoutEmbeddedObject, paintInfo.phase, contentRect);
- if (drawingRecorder.canUseCachedDrawing())
- return;
-
GraphicsContextStateSaver stateSaver(*context);
context->clip(contentRect);

Powered by Google App Engine
This is Rietveld 408576698