| Index: third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
|
| diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h b/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
|
| index d5f344e605f4b55ad17dfdc5ccdad84f39636a49..61bd2e45e257b12281350348fed9980a9aea68c7 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
|
| +++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
|
| @@ -20,7 +20,7 @@
|
| namespace blink {
|
|
|
| class GraphicsContext;
|
| -class IntRect;
|
| +class LayoutSize;
|
| class WebDisplayItemList;
|
|
|
| class PLATFORM_EXPORT DisplayItem {
|
| @@ -199,6 +199,7 @@ class PLATFORM_EXPORT DisplayItem {
|
|
|
| DisplayItem(const DisplayItemClient& client, Type type, size_t derived_size)
|
| : client_(&client),
|
| + visual_rect_(client.VisualRect()),
|
| type_(type),
|
| derived_size_(derived_size),
|
| skipped_cache_(false)
|
| @@ -233,6 +234,12 @@ class PLATFORM_EXPORT DisplayItem {
|
| DCHECK(client_);
|
| return *client_;
|
| }
|
| +
|
| + // This equals to Client().VisualRect() as long as the client is alive and is
|
| + // not invalidated. Otherwise it saves the previous visual rect of the client.
|
| + // See DisplayItemClient::VisualRect() about its coordinate space.
|
| + const LayoutRect& VisualRect() const { return visual_rect_; }
|
| +
|
| Type GetType() const { return type_; }
|
|
|
| // Size of this object in memory, used to move it with memcpy.
|
| @@ -246,9 +253,11 @@ class PLATFORM_EXPORT DisplayItem {
|
| void SetSkippedCache() { skipped_cache_ = true; }
|
| bool SkippedCache() const { return skipped_cache_; }
|
|
|
| - // TODO(wkorman): Only DrawingDisplayItem needs the visual rect argument.
|
| - // Consider refactoring class hierarchy to make this more explicit.
|
| - virtual void AppendToWebDisplayItemList(const IntRect&,
|
| + // Appends this display item to the WebDisplayItemList, if applicable.
|
| + // |visual_rect_offset| is the offset between the space of the GraphicsLayer
|
| + // which owns the display item and the coordinate space of VisualRect().
|
| + // TODO(wangxianzhu): Remove the parameter for slimming paint v2.
|
| + virtual void AppendToWebDisplayItemList(const LayoutSize& visual_rect_offset,
|
| WebDisplayItemList*) const {}
|
|
|
| // See comments of enum Type for usage of the following macros.
|
| @@ -351,6 +360,7 @@ class PLATFORM_EXPORT DisplayItem {
|
| // constructed at the source location.
|
| template <typename T, unsigned alignment>
|
| friend class ContiguousContainer;
|
| + friend class DisplayItemList;
|
|
|
| DisplayItem()
|
| : client_(nullptr),
|
| @@ -359,6 +369,8 @@ class PLATFORM_EXPORT DisplayItem {
|
| skipped_cache_(false) {}
|
|
|
| const DisplayItemClient* client_;
|
| + LayoutRect visual_rect_;
|
| +
|
| static_assert(kTypeLast < (1 << 16),
|
| "DisplayItem::Type should fit in 16 bits");
|
| const Type type_ : 16;
|
|
|