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

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

Issue 723103002: Revert "Move ViewDisplayList to GraphicsLayer" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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/DrawingRecorderTest.cpp ('k') | Source/core/paint/ViewDisplayList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/ViewDisplayList.h
diff --git a/Source/platform/graphics/paint/DisplayItem.h b/Source/core/paint/ViewDisplayList.h
similarity index 60%
rename from Source/platform/graphics/paint/DisplayItem.h
rename to Source/core/paint/ViewDisplayList.h
index f47dda81fe99a6ce1fa5e46d63d873a7da9de11d..4002c81f0f4188a2b8e0304d30fd5ed366b1f56c 100644
--- a/Source/platform/graphics/paint/DisplayItem.h
+++ b/Source/core/paint/ViewDisplayList.h
@@ -2,22 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef DisplayItem_h
-#define DisplayItem_h
+#ifndef ViewDisplayList_h
+#define ViewDisplayList_h
-#include "platform/PlatformExport.h"
-
-#ifndef NDEBUG
-#include "wtf/text/WTFString.h"
-#endif
+#include "core/rendering/PaintPhase.h"
+#include "wtf/HashSet.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/Vector.h"
namespace blink {
class GraphicsContext;
+class RenderObject;
-typedef void* DisplayItemClient;
-
-class PLATFORM_EXPORT DisplayItem {
+class DisplayItem {
public:
enum Type {
// DisplayItem types must be kept in sync with PaintPhase.
@@ -55,39 +53,58 @@ public:
virtual void replay(GraphicsContext*) = 0;
- DisplayItemClient client() const { return m_id.client; }
+ const RenderObject* renderer() const { return m_id.renderer; }
Type type() const { return m_id.type; }
- bool idsEqual(const DisplayItem& other) const { return m_id.client == other.m_id.client && m_id.type == other.m_id.type; }
+ bool idsEqual(const DisplayItem& other) const { return m_id.renderer == other.m_id.renderer && m_id.type == other.m_id.type; }
#ifndef NDEBUG
static WTF::String typeAsDebugString(DisplayItem::Type);
-
- void setClientDebugString(const WTF::String& clientDebugString) { m_clientDebugString = clientDebugString; }
- const WTF::String& clientDebugString() const { return m_clientDebugString; }
-
+ static WTF::String rendererDebugString(const RenderObject*);
virtual WTF::String asDebugString() const;
#endif
protected:
- DisplayItem(DisplayItemClient client, Type type)
- : m_id(client, type)
+ DisplayItem(const RenderObject* renderer, Type type)
+ : m_id(renderer, type)
{ }
private:
struct Id {
- Id(DisplayItemClient c, Type t)
- : client(c)
+ Id(const RenderObject* r, Type t)
+ : renderer(r)
, type(t)
{ }
- const DisplayItemClient client;
+ const RenderObject* renderer;
const Type type;
} m_id;
+};
+
+typedef Vector<OwnPtr<DisplayItem> > PaintList;
+
+class ViewDisplayList {
+public:
+ ViewDisplayList() { };
+
+ const PaintList& paintList();
+ void add(WTF::PassOwnPtr<DisplayItem>);
+ void invalidate(const RenderObject*);
+
#ifndef NDEBUG
- WTF::String m_clientDebugString;
+ void showDebugData() const;
#endif
+
+private:
+ PaintList::iterator findDisplayItem(PaintList::iterator, const DisplayItem&);
+ bool wasInvalidated(const DisplayItem&) const;
+ void updatePaintList();
+
+ PaintList m_paintList;
+ HashSet<const RenderObject*> m_paintListRenderers;
+ HashSet<const RenderObject*> m_invalidated;
+ PaintList m_newPaints;
};
-}
+} // namespace blink
-#endif // DisplayItem_h
+#endif // ViewDisplayList_h
« no previous file with comments | « Source/core/paint/DrawingRecorderTest.cpp ('k') | Source/core/paint/ViewDisplayList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698