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

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

Issue 1195513004: Change DontCheck under-invalidation checking mode to CacheSkipper (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix bug 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
« no previous file with comments | « Source/core/paint/BoxPainter.cpp ('k') | Source/platform/graphics/paint/DisplayItemList.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 85d61c1419a2a04e5dae63bf586aa5012820d397..d94ccbcc4d5123d9b60a20000de9e02ab042c949 100644
--- a/Source/core/paint/LayoutObjectDrawingRecorder.h
+++ b/Source/core/paint/LayoutObjectDrawingRecorder.h
@@ -8,29 +8,40 @@
#include "core/layout/LayoutObject.h"
#include "core/paint/PaintPhase.h"
#include "platform/geometry/LayoutRect.h"
+#include "platform/graphics/paint/DisplayItemCacheSkipper.h"
#include "platform/graphics/paint/DrawingRecorder.h"
+#include "wtf/Optional.h"
namespace blink {
class GraphicsContext;
-// Convenience constructors for creating DrawingRecorders.
-class LayoutObjectDrawingRecorder final : public DrawingRecorder {
+// Convenience wrapper of DrawingRecorder for LayoutObject painters.
+class LayoutObjectDrawingRecorder final {
public:
- LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type displayItemType, const LayoutRect& clip)
- : DrawingRecorder(context, layoutObject, displayItemType, pixelSnappedIntRect(clip))
+ LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type displayItemType, const FloatRect& clip)
{
-#if ENABLE(ASSERT)
+ // We may paint a delayed-invalidation object before it's actually invalidated.
if (layoutObject.fullPaintInvalidationReason() == PaintInvalidationDelayedFull)
- setUnderInvalidationCheckingMode(DrawingDisplayItem::DontCheck);
-#endif
+ m_cacheSkipper.emplace(context);
+ m_drawingRecorder.emplace(context, layoutObject, displayItemType, clip);
}
LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, PaintPhase phase, const FloatRect& clip)
- : DrawingRecorder(context, layoutObject, DisplayItem::paintPhaseToDrawingType(phase), clip) { }
+ : LayoutObjectDrawingRecorder(context, layoutObject, DisplayItem::paintPhaseToDrawingType(phase), clip) { }
+
+ 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
- LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type type, const FloatRect& clip)
- : DrawingRecorder(context, layoutObject, type, clip) { }
+private:
+ Optional<DisplayItemCacheSkipper> m_cacheSkipper;
+ Optional<DrawingRecorder> m_drawingRecorder;
};
} // namespace blink
« no previous file with comments | « Source/core/paint/BoxPainter.cpp ('k') | Source/platform/graphics/paint/DisplayItemList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698