summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/graphics/paint/display_item.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/platform/graphics/paint/display_item.h')
-rw-r--r--chromium/third_party/blink/renderer/platform/graphics/paint/display_item.h59
1 files changed, 35 insertions, 24 deletions
diff --git a/chromium/third_party/blink/renderer/platform/graphics/paint/display_item.h b/chromium/third_party/blink/renderer/platform/graphics/paint/display_item.h
index 320f0d0bee5..6d9a09eff7e 100644
--- a/chromium/third_party/blink/renderer/platform/graphics/paint/display_item.h
+++ b/chromium/third_party/blink/renderer/platform/graphics/paint/display_item.h
@@ -61,10 +61,10 @@ class PLATFORM_EXPORT DisplayItem {
kClippingMask,
kColumnRules,
kDebugDrawing,
+ kDocumentRootBackdrop,
kDocumentBackground,
kDragImage,
kDragCaret,
- kEmptyContentForFilters,
kForcedColorsModeBackplate,
kSVGImage,
kLinkHighlight,
@@ -100,13 +100,17 @@ class PLATFORM_EXPORT DisplayItem {
kForeignLayerDevToolsOverlay,
kForeignLayerPlugin,
kForeignLayerVideo,
- kForeignLayerWrapper,
+ kForeignLayerRemoteFrame,
kForeignLayerContentsWrapper,
kForeignLayerLinkHighlight,
kForeignLayerViewportScroll,
kForeignLayerViewportScrollbar,
kForeignLayerLast = kForeignLayerViewportScrollbar,
+ kGraphicsLayerWrapperFirst,
+ kGraphicsLayerWrapper = kGraphicsLayerWrapperFirst,
+ kGraphicsLayerWrapperLast = kGraphicsLayerWrapper,
+
kClipPaintPhaseFirst,
kClipPaintPhaseLast = kClipPaintPhaseFirst + kPaintPhaseMax,
@@ -119,26 +123,29 @@ class PLATFORM_EXPORT DisplayItem {
kSVGEffectPaintPhaseFirst,
kSVGEffectPaintPhaseLast = kSVGEffectPaintPhaseFirst + kPaintPhaseMax,
+ // The following hit test types are for paint chunks containing hit test
+ // data, when we don't have an previously set explicit chunk id when
+ // creating the paint chunk, or we need dedicated paint chunk for the hit
+ // test data.
+
// Compositor hit testing requires that layers are created and sized to
- // include content that does not paint. Hit test display items ensure
- // a layer exists and is sized properly even if no content would otherwise
- // be painted.
+ // include content that does not paint. Hit test data ensure a layer exists
+ // and is sized properly even if no content would otherwise be painted.
kHitTest,
// Used both for specifying the paint-order scroll location, and for non-
- // composited scroll hit testing (see: scroll_hit_test_display_item.h).
+ // composited scroll hit testing (see: hit_test_data.h).
kScrollHitTest,
// Used to prevent composited scrolling on the resize handle.
kResizerScrollHitTest,
// Used to prevent composited scrolling on plugins with wheel handlers.
kPluginScrollHitTest,
- kLayerChunkBackground,
- kLayerChunkNegativeZOrderChildren,
- kLayerChunkDescendantBackgrounds,
- kLayerChunkFloat,
+ // These are for paint chunks that are forced for layers.
+ kLayerChunk,
+ // This is used if a layer has any negative-z-index children. Otherwise the
+ // foreground is in the kLayerChunk chunk.
kLayerChunkForeground,
- kLayerChunkNormalFlowAndPositiveZOrderChildren,
// The following 2 types are For ScrollbarDisplayItem.
kScrollbarHorizontal,
@@ -152,7 +159,7 @@ class PLATFORM_EXPORT DisplayItem {
// later paint cycles when |client| may have been destroyed.
DisplayItem(const DisplayItemClient& client,
Type type,
- size_t derived_size,
+ wtf_size_t derived_size,
bool draws_content = false)
: client_(&client),
visual_rect_(client.VisualRect()),
@@ -161,10 +168,11 @@ class PLATFORM_EXPORT DisplayItem {
draws_content_(draws_content),
fragment_(0),
is_cacheable_(client.IsCacheable()),
- is_tombstone_(false) {
+ is_tombstone_(false),
+ is_moved_from_cached_subsequence_(false) {
// |derived_size| must fit in |derived_size_|.
// If it doesn't, enlarge |derived_size_| and fix this assert.
- SECURITY_DCHECK(derived_size < (1 << 8));
+ SECURITY_DCHECK(derived_size < (1 << 7));
SECURITY_DCHECK(derived_size >= sizeof(*this));
derived_size_ = static_cast<unsigned>(derived_size);
}
@@ -211,7 +219,7 @@ class PLATFORM_EXPORT DisplayItem {
// This is not sizeof(*this), because it needs to account for the size of
// the derived class (i.e. runtime type). Derived classes are expected to
// supply this to the DisplayItem constructor.
- size_t DerivedSize() const { return derived_size_; }
+ wtf_size_t DerivedSize() const { return derived_size_; }
// The fragment is part of the id, to uniquely identify display items in
// different fragments for the same client and type.
@@ -221,6 +229,8 @@ class PLATFORM_EXPORT DisplayItem {
fragment_ = fragment;
}
+ void SetVisualRectForTesting(const IntRect& r) { visual_rect_ = r; }
+
// See comments of enum Type for usage of the following macros.
#define DEFINE_CATEGORY_METHODS(Category) \
static constexpr bool Is##Category##Type(Type type) { \
@@ -243,20 +253,13 @@ class PLATFORM_EXPORT DisplayItem {
DEFINE_PAINT_PHASE_CONVERSION_METHOD(Drawing)
DEFINE_CATEGORY_METHODS(ForeignLayer)
+ DEFINE_CATEGORY_METHODS(GraphicsLayerWrapper)
DEFINE_PAINT_PHASE_CONVERSION_METHOD(Clip)
DEFINE_PAINT_PHASE_CONVERSION_METHOD(Scroll)
DEFINE_PAINT_PHASE_CONVERSION_METHOD(SVGTransform)
DEFINE_PAINT_PHASE_CONVERSION_METHOD(SVGEffect)
- bool IsHitTest() const { return type_ == kHitTest; }
- bool IsScrollHitTest() const {
- return type_ == kScrollHitTest || IsResizerScrollHitTest() ||
- IsPluginScrollHitTest();
- }
- bool IsResizerScrollHitTest() const { return type_ == kResizerScrollHitTest; }
- bool IsPluginScrollHitTest() const { return type_ == kPluginScrollHitTest; }
-
bool IsScrollbar() const {
return type_ == kScrollbarHorizontal || type_ == kScrollbarVertical;
}
@@ -264,6 +267,13 @@ class PLATFORM_EXPORT DisplayItem {
bool IsCacheable() const { return is_cacheable_; }
void SetUncacheable() { is_cacheable_ = false; }
+ bool IsMovedFromCachedSubsequence() const {
+ return is_moved_from_cached_subsequence_;
+ }
+ void SetMovedFromCachedSubsequence(bool b) {
+ is_moved_from_cached_subsequence_ = b;
+ }
+
virtual bool Equals(const DisplayItem& other) const {
// Failure of this DCHECK would cause bad casts in subclasses.
SECURITY_CHECK(!is_tombstone_);
@@ -304,10 +314,11 @@ class PLATFORM_EXPORT DisplayItem {
static_assert(kTypeLast < (1 << 7), "DisplayItem::Type should fit in 7 bits");
unsigned type_ : 7;
unsigned draws_content_ : 1;
- unsigned derived_size_ : 8; // size of the actual derived class
+ unsigned derived_size_ : 7; // size of the actual derived class
unsigned fragment_ : 14;
unsigned is_cacheable_ : 1;
unsigned is_tombstone_ : 1;
+ unsigned is_moved_from_cached_subsequence_ : 1;
};
inline bool operator==(const DisplayItem::Id& a, const DisplayItem::Id& b) {