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

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

Issue 1978313003: Reland of Client side display item cache flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 4 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
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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 DEFINE_PAIRED_CATEGORY_METHODS(Transform3D, transform3D) 323 DEFINE_PAIRED_CATEGORY_METHODS(Transform3D, transform3D)
324 324
325 static bool isCachedType(Type type) { return isCachedDrawingType(type) || ty pe == CachedSubsequence; } 325 static bool isCachedType(Type type) { return isCachedDrawingType(type) || ty pe == CachedSubsequence; }
326 bool isCached() const { return isCachedType(m_type); } 326 bool isCached() const { return isCachedType(m_type); }
327 static bool isCacheableType(Type type) { return isDrawingType(type) || type == Subsequence; } 327 static bool isCacheableType(Type type) { return isDrawingType(type) || type == Subsequence; }
328 bool isCacheable() const { return !skippedCache() && isCacheableType(m_type) ; } 328 bool isCacheable() const { return !skippedCache() && isCacheableType(m_type) ; }
329 329
330 virtual bool isBegin() const { return false; } 330 virtual bool isBegin() const { return false; }
331 virtual bool isEnd() const { return false; } 331 virtual bool isEnd() const { return false; }
332 332
333 #if ENABLE(ASSERT) 333 #if DCHECK_IS_ON()
334 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { return false; } 334 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { return false; }
335 virtual bool equals(const DisplayItem& other) const 335 virtual bool equals(const DisplayItem& other) const
336 { 336 {
337 return m_client == other.m_client 337 return m_client == other.m_client
338 && m_scope == other.m_scope 338 && m_scope == other.m_scope
339 && m_type == other.m_type 339 && m_type == other.m_type
340 && m_derivedSize == other.m_derivedSize 340 && m_derivedSize == other.m_derivedSize
341 && m_skippedCache == other.m_skippedCache; 341 && m_skippedCache == other.m_skippedCache;
342 } 342 }
343 #endif
343 344
344 // True if the client is non-null. Because m_client is const, this should 345 // True if the client is non-null. Because m_client is const, this should
345 // never be false except when we explicitly create a tombstone/"dead display 346 // never be false except when we explicitly create a tombstone/"dead display
346 // item" as part of moving an item from one list to another (see: 347 // item" as part of moving an item from one list to another (see:
347 // DisplayItemList::appendByMoving). 348 // DisplayItemList::appendByMoving).
348 bool hasValidClient() const { return m_client; } 349 bool hasValidClient() const { return m_client; }
349 #endif
350 350
351 virtual bool drawsContent() const { return false; } 351 virtual bool drawsContent() const { return false; }
352 352
353 #ifndef NDEBUG 353 #ifndef NDEBUG
354 static WTF::String typeAsDebugString(DisplayItem::Type); 354 static WTF::String typeAsDebugString(DisplayItem::Type);
355 const WTF::String clientDebugString() const { return m_clientDebugString; } 355 const WTF::String clientDebugString() const { return m_clientDebugString; }
356 void setClientDebugString(const WTF::String& s) { m_clientDebugString = s; } 356 void setClientDebugString(const WTF::String& s) { m_clientDebugString = s; }
357 WTF::String asDebugString() const; 357 WTF::String asDebugString() const;
358 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const; 358 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const;
359 #endif 359 #endif
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; 400 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0;
401 #endif 401 #endif
402 402
403 private: 403 private:
404 bool isEnd() const final { return true; } 404 bool isEnd() const final { return true; }
405 }; 405 };
406 406
407 } // namespace blink 407 } // namespace blink
408 408
409 #endif // DisplayItem_h 409 #endif // DisplayItem_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698