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

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

Issue 1323263002: Show debug information for invalid display items (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | Source/platform/graphics/paint/DisplayItem.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef DisplayItem_h 5 #ifndef DisplayItem_h
6 #define DisplayItem_h 6 #define DisplayItem_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/graphics/ContiguousContainer.h" 9 #include "platform/graphics/ContiguousContainer.h"
10 #include "platform/graphics/paint/DisplayItemClient.h" 10 #include "platform/graphics/paint/DisplayItemClient.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 #endif 321 #endif
322 322
323 virtual bool drawsContent() const { return false; } 323 virtual bool drawsContent() const { return false; }
324 324
325 bool isValid() const { return m_client; } 325 bool isValid() const { return m_client; }
326 void clearClientForUnderInvalidationChecking() { m_client = nullptr; } 326 void clearClientForUnderInvalidationChecking() { m_client = nullptr; }
327 327
328 #ifndef NDEBUG 328 #ifndef NDEBUG
329 static WTF::String typeAsDebugString(DisplayItem::Type); 329 static WTF::String typeAsDebugString(DisplayItem::Type);
330 const WTF::String& clientDebugString() const { return m_clientDebugString; } 330 const WTF::String& clientDebugString() const { return m_clientDebugString; }
331 void setClientDebugString(const WTF::String& s) { m_clientDebugString = s; }
331 WTF::String asDebugString() const; 332 WTF::String asDebugString() const;
332 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const; 333 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const;
333 #endif 334 #endif
334 335
335 private: 336 private:
336 // The default DisplayItem constructor is only used by 337 // The default DisplayItem constructor is only used by
337 // ContiguousContainer::appendByMoving where an invalid DisplaItem is 338 // ContiguousContainer::appendByMoving where an invalid DisplaItem is
338 // constructed at the source location. 339 // constructed at the source location.
339 template <typename T, unsigned alignment> friend class ContiguousContainer; 340 template <typename T, unsigned alignment> friend class ContiguousContainer;
340 341
341 DisplayItem() 342 DisplayItem()
342 : m_client(nullptr) 343 : m_client(nullptr)
343 , m_scope(0) 344 , m_scope(0)
344 , m_type(UninitializedType) 345 , m_type(UninitializedType)
345 , m_derivedSize(sizeof(*this)) 346 , m_derivedSize(sizeof(*this))
346 , m_skippedCache(false) 347 , m_skippedCache(false)
347 #ifndef NDEBUG
348 , m_clientDebugString("invalid")
349 #endif
350 { } 348 { }
351 349
352 DisplayItemClient m_client; 350 DisplayItemClient m_client;
353 unsigned m_scope; 351 unsigned m_scope;
354 static_assert(TypeLast < (1 << 16), "DisplayItem::Type should fit in 16 bits "); 352 static_assert(TypeLast < (1 << 16), "DisplayItem::Type should fit in 16 bits ");
355 const Type m_type : 16; 353 const Type m_type : 16;
356 unsigned m_derivedSize : 8; // size of the actual derived class 354 unsigned m_derivedSize : 8; // size of the actual derived class
357 unsigned m_skippedCache : 1; 355 unsigned m_skippedCache : 1;
358 356
359 #ifndef NDEBUG 357 #ifndef NDEBUG
(...skipping 17 matching lines...) Expand all
377 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; 375 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0;
378 #endif 376 #endif
379 377
380 private: 378 private:
381 bool isEnd() const final { return true; } 379 bool isEnd() const final { return true; }
382 }; 380 };
383 381
384 } // namespace blink 382 } // namespace blink
385 383
386 #endif // DisplayItem_h 384 #endif // DisplayItem_h
OLDNEW
« no previous file with comments | « no previous file | Source/platform/graphics/paint/DisplayItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698