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

Unified Diff: Source/platform/graphics/paint/DisplayItem.h

Issue 794323004: Emit dummy display item when recorded picture is empty (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years 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/platform/graphics/paint/ClipDisplayItem.h ('k') | Source/platform/graphics/paint/DisplayItem.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/paint/DisplayItem.h
diff --git a/Source/platform/graphics/paint/DisplayItem.h b/Source/platform/graphics/paint/DisplayItem.h
index b6c5bfcd6d3b0554283b48e6197c6592ebf055ad..c8b7f53e28373c1bcc556a5d7de6526bf91c4508 100644
--- a/Source/platform/graphics/paint/DisplayItem.h
+++ b/Source/platform/graphics/paint/DisplayItem.h
@@ -7,6 +7,7 @@
#include "platform/PlatformExport.h"
#include "wtf/Assertions.h"
+#include "wtf/PassOwnPtr.h"
#ifndef NDEBUG
#include "wtf/text/StringBuilder.h"
@@ -74,15 +75,19 @@ public:
Resizer
};
+ // Create a dummy display item which just holds the id but has no display operation.
+ // It helps a CachedDisplayItem to match the corresponding original empty display item.
+ static PassOwnPtr<DisplayItem> create(DisplayItemClient client, Type type) { return adoptPtr(new DisplayItem(client, type)); }
+
virtual ~DisplayItem() { }
- virtual void replay(GraphicsContext*) = 0;
+ virtual void replay(GraphicsContext*) { }
DisplayItemClient client() const { return m_id.client; }
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; }
- virtual void appendToWebDisplayItemList(WebDisplayItemList*) const = 0;
+ virtual void appendToWebDisplayItemList(WebDisplayItemList*) const { }
#ifndef NDEBUG
static WTF::String typeAsDebugString(DisplayItem::Type);
@@ -91,6 +96,7 @@ public:
const WTF::String& clientDebugString() const { return m_clientDebugString; }
WTF::String asDebugString() const;
+ virtual const char* name() const { return "Dummy"; }
virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const;
#endif
« no previous file with comments | « Source/platform/graphics/paint/ClipDisplayItem.h ('k') | Source/platform/graphics/paint/DisplayItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698