Index: Source/core/paint/ViewDisplayList.h |
diff --git a/Source/core/paint/ViewDisplayList.h b/Source/core/paint/ViewDisplayList.h |
index 9f6fb5720ba618cb29e97da7705f7cb8f79b0ec0..20202acda1d9e5e61645cdc57d693e8c3875f6e9 100644 |
--- a/Source/core/paint/ViewDisplayList.h |
+++ b/Source/core/paint/ViewDisplayList.h |
@@ -6,6 +6,7 @@ |
#define ViewDisplayList_h |
#include "core/rendering/PaintPhase.h" |
+#include "platform/geometry/RoundedRect.h" |
#include "platform/graphics/DisplayList.h" |
#include "wtf/HashSet.h" |
#include "wtf/OwnPtr.h" |
@@ -13,13 +14,48 @@ |
namespace blink { |
+class ClipRect; |
class GraphicsContext; |
class RenderObject; |
+class RenderLayer; |
struct AtomicPaintChunk; |
-typedef Vector<OwnPtr<AtomicPaintChunk> > PaintCommandList; |
-struct AtomicPaintChunk { |
+struct DisplayItem { |
+ virtual void replay(GraphicsContext*) = 0; |
+ |
+ virtual ~DisplayItem() { } |
+}; |
+ |
+struct ClipDisplayItem : DisplayItem { |
+ RenderLayer* layer; |
+ enum ClipType { |
+ LayerOverflowControls, |
+ LayerBackground, |
+ LayerParent, |
+ LayerFilter, |
+ LayerForeground, |
+ LayerFragmentFloat, |
+ LayerFragmentForeground, |
+ LayerFragmentChildOutline, |
+ LayerFragmentOutline, |
+ LayerFragmentMask, |
+ LayerFragmentClippingMask, |
+ LayerFragmentParent |
+ }; |
+ ClipType clipType; |
+ IntRect clipRect; |
+ Vector<RoundedRect> roundedRectClips; |
+ |
+ virtual void replay(GraphicsContext*); |
+}; |
+ |
+struct EndClipDisplayItem : DisplayItem { |
+ RenderLayer* layer; |
+ virtual void replay(GraphicsContext*); |
+}; |
+ |
+struct AtomicPaintChunk : DisplayItem { |
AtomicPaintChunk(PassRefPtr<DisplayList> inDisplayList, RenderObject* inRenderer, PaintPhase inPhase) |
: displayList(inDisplayList), renderer(inRenderer), phase(inPhase) { }; |
@@ -28,8 +64,12 @@ struct AtomicPaintChunk { |
// This auxillary data can be moved off the chunk if needed. |
RenderObject* renderer; |
PaintPhase phase; |
+ |
+ virtual void replay(GraphicsContext*); |
}; |
+typedef Vector<OwnPtr<DisplayItem> > PaintList; |
+ |
class PaintCommandRecorder { |
public: |
explicit PaintCommandRecorder(GraphicsContext*, RenderObject*, PaintPhase, const FloatRect&); |
@@ -41,22 +81,35 @@ private: |
PaintPhase m_phase; |
}; |
+class ClipRecorder { |
+public: |
+ explicit ClipRecorder(RenderLayer*, GraphicsContext*, ClipDisplayItem::ClipType, const ClipRect&); |
+ void addRoundedRectClip(const RoundedRect&); |
+ |
+ ~ClipRecorder(); |
+ |
+private: |
+ OwnPtr<ClipDisplayItem> m_clipDisplayItem; |
+ GraphicsContext* m_graphicsContext; |
+ RenderLayer* m_renderLayer; |
+}; |
+ |
class ViewDisplayList { |
public: |
ViewDisplayList() { }; |
- const PaintCommandList& paintCommandList(); |
- void add(WTF::PassOwnPtr<AtomicPaintChunk>); |
+ const PaintList& paintList(); |
+ void add(WTF::PassOwnPtr<DisplayItem>); |
void invalidate(const RenderObject*); |
private: |
- bool isRepaint(PaintCommandList::iterator, const AtomicPaintChunk&); |
+ bool isRepaint(PaintList::iterator, const DisplayItem&); |
// Update m_paintList with any invalidations or new paints. |
- void updatePaintCommandList(); |
+ void updatePaintList(); |
- PaintCommandList m_paintList; |
+ PaintList m_paintList; |
HashSet<const RenderObject*> m_invalidated; |
- PaintCommandList m_newPaints; |
+ PaintList m_newPaints; |
}; |
} // namespace blink |