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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "platform/graphics/paint/DisplayItem.h" 6 #include "platform/graphics/paint/DisplayItem.h"
7 7
8 namespace blink { 8 namespace blink {
9 9
10 namespace {
pdr. 2014/12/12 18:39:04 Does this need to be in a namespace block?
11
12 class DummyDisplayItem : public DisplayItem {
13 public:
14 DummyDisplayItem(DisplayItemClient client, Type type) : DisplayItem(client, type) { }
15
16 private:
17 virtual void replay(GraphicsContext*) override final { }
18 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override final { }
19 virtual const char* name() const override final { return "Dummy"; }
20 };
21
22 } // namespace
23
24 PassOwnPtr<DisplayItem> DisplayItem::createDummy(DisplayItemClient client, Type type)
25 {
26 return adoptPtr(new DummyDisplayItem(client, type));
27 }
28
10 #ifndef NDEBUG 29 #ifndef NDEBUG
11 30
12 WTF::String DisplayItem::typeAsDebugString(DisplayItem::Type type) 31 WTF::String DisplayItem::typeAsDebugString(DisplayItem::Type type)
13 { 32 {
14 switch (type) { 33 switch (type) {
15 case DisplayItem::DrawingPaintPhaseBlockBackground: return "DrawingPaintPhas eBlockBackground"; 34 case DisplayItem::DrawingPaintPhaseBlockBackground: return "DrawingPaintPhas eBlockBackground";
16 case DisplayItem::DrawingPaintPhaseChildBlockBackground: return "DrawingPain tPhaseChildBlockBackground"; 35 case DisplayItem::DrawingPaintPhaseChildBlockBackground: return "DrawingPain tPhaseChildBlockBackground";
17 case DisplayItem::DrawingPaintPhaseChildBlockBackgrounds: return "DrawingPai ntPhaseChildBlockBackgrounds"; 36 case DisplayItem::DrawingPaintPhaseChildBlockBackgrounds: return "DrawingPai ntPhaseChildBlockBackgrounds";
18 case DisplayItem::DrawingPaintPhaseFloat: return "DrawingPaintPhaseFloat"; 37 case DisplayItem::DrawingPaintPhaseFloat: return "DrawingPaintPhaseFloat";
19 case DisplayItem::DrawingPaintPhaseForeground: return "DrawingPaintPhaseFore ground"; 38 case DisplayItem::DrawingPaintPhaseForeground: return "DrawingPaintPhaseFore ground";
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 { 86 {
68 WTF::StringBuilder stringBuilder; 87 WTF::StringBuilder stringBuilder;
69 stringBuilder.append('{'); 88 stringBuilder.append('{');
70 dumpPropertiesAsDebugString(stringBuilder); 89 dumpPropertiesAsDebugString(stringBuilder);
71 stringBuilder.append('}'); 90 stringBuilder.append('}');
72 return stringBuilder.toString(); 91 return stringBuilder.toString();
73 } 92 }
74 93
75 void DisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuilder) const 94 void DisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuilder) const
76 { 95 {
96 stringBuilder.append("name: \"");
97 stringBuilder.append(name());
98 stringBuilder.append("\", ");
77 if (!clientDebugString().isEmpty()) { 99 if (!clientDebugString().isEmpty()) {
78 stringBuilder.append(clientDebugString()); 100 stringBuilder.append(clientDebugString());
79 stringBuilder.append(", "); 101 stringBuilder.append(", ");
80 } 102 }
81 stringBuilder.append("type: \""); 103 stringBuilder.append("type: \"");
82 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
83 stringBuilder.append("Cached-");
84 stringBuilder.append(typeAsDebugString(type())); 104 stringBuilder.append(typeAsDebugString(type()));
85 stringBuilder.append('"'); 105 stringBuilder.append('"');
86 } 106 }
87 107
88 #endif 108 #endif
89 109
90 } // namespace blink 110 } // namespace blink
OLDNEW
« 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