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

Side by Side Diff: Source/platform/graphics/paint/DisplayItem.cpp

Issue 1160763005: Don't cache reflection drawings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add DisplayItemCachingSkipper.h; Restore m_scopeId Created 5 years, 6 months 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 struct SameSizeAsDisplayItem { 10 struct SameSizeAsDisplayItem {
11 virtual ~SameSizeAsDisplayItem() { } // Allocate vtable pointer. 11 virtual ~SameSizeAsDisplayItem() { } // Allocate vtable pointer.
12 void* pointers[2]; 12 void* pointers[2];
13 int m_int; // Make sure m_int and m_type are next to each other so they are packed on 64-bit. 13 int ints[2]; // Make sure other fields are packed into two ints.
14 DisplayItem::Type m_type;
15 #ifndef NDEBUG 14 #ifndef NDEBUG
16 WTF::String m_debugString; 15 WTF::String m_debugString;
17 #endif 16 #endif
18 }; 17 };
19 18
20 static_assert(sizeof(DisplayItem) == sizeof(SameSizeAsDisplayItem), "DisplayItem should stay small"); 19 static_assert(sizeof(DisplayItem) == sizeof(SameSizeAsDisplayItem), "DisplayItem should stay small");
21 static_assert(sizeof(DisplayItem::Type) <= sizeof(int), "DisplayItem::Type shoul d stay small"); 20 static_assert(sizeof(DisplayItem::Type) <= sizeof(int), "DisplayItem::Type shoul d stay small");
22 21
23 #ifndef NDEBUG 22 #ifndef NDEBUG
24 23
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 void DisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuilder) const 206 void DisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuilder) const
208 { 207 {
209 stringBuilder.append(String::format("client: \"%p", client())); 208 stringBuilder.append(String::format("client: \"%p", client()));
210 if (!clientDebugString().isEmpty()) { 209 if (!clientDebugString().isEmpty()) {
211 stringBuilder.append(' '); 210 stringBuilder.append(' ');
212 stringBuilder.append(clientDebugString()); 211 stringBuilder.append(clientDebugString());
213 } 212 }
214 stringBuilder.append("\", type: \""); 213 stringBuilder.append("\", type: \"");
215 stringBuilder.append(typeAsDebugString(type())); 214 stringBuilder.append(typeAsDebugString(type()));
216 stringBuilder.append('"'); 215 stringBuilder.append('"');
217 if (m_id.scopeContainer) 216 if (m_skippedCache)
218 stringBuilder.append(String::format(", scope: \"%p,%d\"", m_id.scopeCont ainer, m_id.scopeId)); 217 stringBuilder.append(", skippedCache: true");
218 if (m_scopeContainer)
219 stringBuilder.append(String::format(", scope: \"%p,%d\"", m_scopeContain er, m_scopeId));
219 } 220 }
220 221
221 #endif 222 #endif
222 223
223 } // namespace blink 224 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698