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

Unified Diff: Source/core/paint/LayoutObjectDrawingRecorder.h

Issue 1220583004: Refactor DrawingRecorders to check for cached drawings earlier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 5 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
« no previous file with comments | « Source/core/paint/LayerClipRecorderTest.cpp ('k') | Source/core/paint/LayoutObjectDrawingRecorderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/LayoutObjectDrawingRecorder.h
diff --git a/Source/core/paint/LayoutObjectDrawingRecorder.h b/Source/core/paint/LayoutObjectDrawingRecorder.h
index d94ccbcc4d5123d9b60a20000de9e02ab042c949..cd79523f73d4eafbec90f131847e5889286f5cae 100644
--- a/Source/core/paint/LayoutObjectDrawingRecorder.h
+++ b/Source/core/paint/LayoutObjectDrawingRecorder.h
@@ -19,6 +19,18 @@ class GraphicsContext;
// Convenience wrapper of DrawingRecorder for LayoutObject painters.
class LayoutObjectDrawingRecorder final {
public:
+ static bool useCachedDrawingIfPossible(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type displayItemType)
+ {
+ if (layoutObject.fullPaintInvalidationReason() == PaintInvalidationDelayedFull)
+ return false;
+ return DrawingRecorder::useCachedDrawingIfPossible(context, layoutObject, displayItemType);
+ }
+
+ static bool useCachedDrawingIfPossible(GraphicsContext& context, const LayoutObject& layoutObject, PaintPhase phase)
+ {
+ return useCachedDrawingIfPossible(context, layoutObject, DisplayItem::paintPhaseToDrawingType(phase));
+ }
+
LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type displayItemType, const FloatRect& clip)
{
// We may paint a delayed-invalidation object before it's actually invalidated.
@@ -33,8 +45,6 @@ public:
LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type type, const LayoutRect& clip)
: LayoutObjectDrawingRecorder(context, layoutObject, type, pixelSnappedIntRect(clip)) { }
- bool canUseCachedDrawing() const { return m_drawingRecorder->canUseCachedDrawing(); }
-
#if ENABLE(ASSERT)
void setUnderInvalidationCheckingMode(DrawingDisplayItem::UnderInvalidationCheckingMode mode) { m_drawingRecorder->setUnderInvalidationCheckingMode(mode); }
#endif
« no previous file with comments | « Source/core/paint/LayerClipRecorderTest.cpp ('k') | Source/core/paint/LayoutObjectDrawingRecorderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698