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

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

Issue 794323004: Emit dummy display item when recorded picture is empty (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add a missed "override" 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/DisplayItem.h ('k') | Source/platform/graphics/paint/DrawingDisplayItem.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/paint/DisplayItem.cpp
diff --git a/Source/platform/graphics/paint/DisplayItem.cpp b/Source/platform/graphics/paint/DisplayItem.cpp
index cd1d1516b233c900aa2f58ff9ab27050fd9654fc..429fbe92972a230bb4c506aa2162489b292d7cb9 100644
--- a/Source/platform/graphics/paint/DisplayItem.cpp
+++ b/Source/platform/graphics/paint/DisplayItem.cpp
@@ -7,6 +7,25 @@
namespace blink {
+namespace {
pdr. 2014/12/12 18:39:04 Does this need to be in a namespace block?
+
+class DummyDisplayItem : public DisplayItem {
+public:
+ DummyDisplayItem(DisplayItemClient client, Type type) : DisplayItem(client, type) { }
+
+private:
+ virtual void replay(GraphicsContext*) override final { }
+ virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override final { }
+ virtual const char* name() const override final { return "Dummy"; }
+};
+
+} // namespace
+
+PassOwnPtr<DisplayItem> DisplayItem::createDummy(DisplayItemClient client, Type type)
+{
+ return adoptPtr(new DummyDisplayItem(client, type));
+}
+
#ifndef NDEBUG
WTF::String DisplayItem::typeAsDebugString(DisplayItem::Type type)
@@ -74,13 +93,14 @@ WTF::String DisplayItem::asDebugString() const
void DisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuilder) const
{
+ stringBuilder.append("name: \"");
+ stringBuilder.append(name());
+ stringBuilder.append("\", ");
if (!clientDebugString().isEmpty()) {
stringBuilder.append(clientDebugString());
stringBuilder.append(", ");
}
stringBuilder.append("type: \"");
- if (isCached())
pdr. 2014/12/12 18:39:04 Any reason for removing this?
Xianzhu 2014/12/12 19:11:17 Now the new "name" attribute can show the same inf
- stringBuilder.append("Cached-");
stringBuilder.append(typeAsDebugString(type()));
stringBuilder.append('"');
}
« no previous file with comments | « Source/platform/graphics/paint/DisplayItem.h ('k') | Source/platform/graphics/paint/DrawingDisplayItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698