diff options
20 files changed, 67 insertions, 1 deletions
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.h b/third_party/WebKit/Source/core/frame/LocalFrame.h index 8c6d3c2..6ba7cbc 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.h +++ b/third_party/WebKit/Source/core/frame/LocalFrame.h @@ -180,7 +180,10 @@ public: void clearWeakMembers(Visitor*); #endif + // DisplayItemClient methods String debugName() const final { return "LocalFrame"; } + // TODO(chrishtr): fix this. + IntRect visualRect() const override { return IntRect(); } bool shouldThrottleRendering() const; diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp index b642d8b..13f6274 100644 --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp @@ -1139,6 +1139,11 @@ String LayoutObject::debugName() const return name.toString(); } +IntRect LayoutObject::visualRect() const +{ + return enclosingIntRect(previousPaintInvalidationRect()); +} + bool LayoutObject::isPaintInvalidationContainer() const { return hasLayer() && toLayoutBoxModelObject(this)->layer()->isPaintInvalidationContainer(); diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h index c771308..928bf82 100644 --- a/third_party/WebKit/Source/core/layout/LayoutObject.h +++ b/third_party/WebKit/Source/core/layout/LayoutObject.h @@ -220,7 +220,8 @@ public: // along with extra information about the layout object state (e.g. positioning). String decoratedName() const; - // Returns the decorated name along with the debug information from the associated Node object. + // DisplayItemClient methods. + IntRect visualRect() const override; String debugName() const final; LayoutObject* parent() const { return m_parent; } diff --git a/third_party/WebKit/Source/core/layout/line/InlineBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineBox.cpp index 9dfa6b0..485c3f9 100644 --- a/third_party/WebKit/Source/core/layout/line/InlineBox.cpp +++ b/third_party/WebKit/Source/core/layout/line/InlineBox.cpp @@ -94,6 +94,12 @@ String InlineBox::debugName() const return boxName(); } +IntRect InlineBox::visualRect() const +{ + // TODO(chrishtr): tighten these bounds. + return layoutObject().visualRect(); +} + #ifndef NDEBUG void InlineBox::showTreeForThis() const { diff --git a/third_party/WebKit/Source/core/layout/line/InlineBox.h b/third_party/WebKit/Source/core/layout/line/InlineBox.h index 04cba3c..c52995b 100644 --- a/third_party/WebKit/Source/core/layout/line/InlineBox.h +++ b/third_party/WebKit/Source/core/layout/line/InlineBox.h @@ -103,7 +103,10 @@ public: #endif virtual const char* boxName() const; + + // DisplayItemClient methods String debugName() const override; + IntRect visualRect() const override; bool isText() const { return m_bitfields.isText(); } void setIsText(bool isText) { m_bitfields.setIsText(isText); } diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp index 3c85171..964ade1 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp @@ -184,6 +184,11 @@ String PaintLayer::debugName() const return layoutObject()->debugName(); } +IntRect PaintLayer::visualRect() const +{ + return m_layoutObject->visualRect(); +} + PaintLayerCompositor* PaintLayer::compositor() const { if (!layoutObject()->view()) diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.h b/third_party/WebKit/Source/core/paint/PaintLayer.h index d2d6ad4..e02293d 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayer.h +++ b/third_party/WebKit/Source/core/paint/PaintLayer.h @@ -162,7 +162,9 @@ public: PaintLayer(LayoutBoxModelObject*, PaintLayerType); ~PaintLayer(); + // DisplayItemClient methods String debugName() const final; + IntRect visualRect() const override; LayoutBoxModelObject* layoutObject() const { return m_layoutObject; } LayoutBox* layoutBox() const { return m_layoutObject && m_layoutObject->isBox() ? toLayoutBox(m_layoutObject) : 0; } diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp index 430607e..a58ec2a 100644 --- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp +++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp @@ -81,6 +81,12 @@ SVGImage::~SVGImage() ASSERT(!m_chromeClient || !m_chromeClient->image()); } +IntRect SVGImage::visualRect() const +{ + // TODO(chrishtr): fix this. + return IntRect(); +} + bool SVGImage::isInSVGImage(const Node* node) { ASSERT(node); diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h index 6eade3f..cd54d2c 100644 --- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.h +++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.h @@ -77,7 +77,9 @@ public: void updateUseCounters(Document&) const; + // DisplayItemClient methods. String debugName() const final { return "SVGImage"; } + IntRect visualRect() const override; private: friend class AXLayoutObject; diff --git a/third_party/WebKit/Source/platform/exported/WebScrollbarThemeClientImpl.h b/third_party/WebKit/Source/platform/exported/WebScrollbarThemeClientImpl.h index 5121b40..3585c43 100644 --- a/third_party/WebKit/Source/platform/exported/WebScrollbarThemeClientImpl.h +++ b/third_party/WebKit/Source/platform/exported/WebScrollbarThemeClientImpl.h @@ -83,7 +83,11 @@ public: void setTrackNeedsRepaint(bool) override; bool thumbNeedsRepaint() const override; void setThumbNeedsRepaint(bool) override; + + // DisplayItemClient methods. String debugName() const final; + // TODO(chrishtr): fix this. + IntRect visualRect() const override { return IntRect(); } private: WebScrollbar& m_scrollbar; diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp index cea4553..cde702f 100644 --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp @@ -158,6 +158,11 @@ GraphicsLayer::~GraphicsLayer() ASSERT(!m_parent); } +IntRect GraphicsLayer::visualRect() const +{ + return enclosingIntRect(FloatRect(FloatPoint(0, 0), size())); +} + void GraphicsLayer::setDrawDebugRedFillForTesting(bool enabled) { s_drawDebugRedFill = enabled; diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h index c0aaded..8fbd829 100644 --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h @@ -267,7 +267,9 @@ public: static void setDrawDebugRedFillForTesting(bool); ContentLayerDelegate* contentLayerDelegateForTesting() const { return m_contentLayerDelegate.get(); } + // DisplayItemClient methods String debugName() const final { return m_client->debugName(this); } + IntRect visualRect() const override; protected: String debugName(cc::Layer*) const; diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h index eb2bc41..4ed7200 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h +++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h @@ -6,6 +6,7 @@ #define DisplayItemClient_h #include "platform/PlatformExport.h" +#include "platform/geometry/IntRect.h" #include "wtf/text/WTFString.h" namespace blink { @@ -16,6 +17,9 @@ public: virtual ~DisplayItemClient() { } virtual String debugName() const = 0; + + // The visual rect of this DisplayItemClient, in the space of its containing GraphicsLayer. + virtual IntRect visualRect() const = 0; }; inline bool operator==(const DisplayItemClient& client1, const DisplayItemClient& client2) { return &client1 == &client2; } diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvasTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvasTest.cpp index e4753e1..47510bf 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvasTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvasTest.cpp @@ -68,6 +68,7 @@ public: SkColor color() const { return m_color; } PassRefPtr<SkPicture> makePicture() const { return pictureWithRect(m_rect, m_color); } String debugName() const final { return "<dummy>"; } + IntRect visualRect() const override { return IntRect(); } private: SkRect m_rect; diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp index c375021..633ad04 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp @@ -50,6 +50,7 @@ public: { } String debugName() const final { return m_name; } + IntRect visualRect() const override { return IntRect(); } private: String m_name; diff --git a/third_party/WebKit/Source/platform/scroll/Scrollbar.h b/third_party/WebKit/Source/platform/scroll/Scrollbar.h index 835d584..820b1a1 100644 --- a/third_party/WebKit/Source/platform/scroll/Scrollbar.h +++ b/third_party/WebKit/Source/platform/scroll/Scrollbar.h @@ -149,7 +149,10 @@ public: bool overlapsResizer() const { return m_overlapsResizer; } void setOverlapsResizer(bool overlapsResizer) { m_overlapsResizer = overlapsResizer; } + // DisplayItemClient methods. String debugName() const final { return m_orientation == HorizontalScrollbar ? "HorizontalScrollbar" : "VerticalScrollbar"; } + // TODO(chrishtr): fix this. + IntRect visualRect() const override { return IntRect(); } void setNeedsPaintInvalidation(); diff --git a/third_party/WebKit/Source/web/PageOverlay.h b/third_party/WebKit/Source/web/PageOverlay.h index c1a021b..4595137 100644 --- a/third_party/WebKit/Source/web/PageOverlay.h +++ b/third_party/WebKit/Source/web/PageOverlay.h @@ -65,7 +65,11 @@ public: void update(); GraphicsLayer* graphicsLayer() const { return m_layer.get(); } + + // DisplayItemClient methods. String debugName() const final { return "PageOverlay"; } + // TODO(chrishtr): fix this. + IntRect visualRect() const override { return IntRect(); } // GraphicsLayerClient implementation IntRect computeInterestRect(const GraphicsLayer*, const IntRect&) const override; diff --git a/third_party/WebKit/Source/web/WebFontImpl.cpp b/third_party/WebKit/Source/web/WebFontImpl.cpp index ac7a0b8..f0ee40c 100644 --- a/third_party/WebKit/Source/web/WebFontImpl.cpp +++ b/third_party/WebKit/Source/web/WebFontImpl.cpp @@ -56,6 +56,12 @@ WebFontImpl::WebFontImpl(const FontDescription& desc) m_font.update(nullptr); } +IntRect WebFontImpl::visualRect() const +{ + // TODO(chrishtr): fix this. + return IntRect(); +} + WebFontDescription WebFontImpl::fontDescription() const { return WebFontDescription(m_font.fontDescription()); diff --git a/third_party/WebKit/Source/web/WebFontImpl.h b/third_party/WebKit/Source/web/WebFontImpl.h index 2929dcf..d3ca362 100644 --- a/third_party/WebKit/Source/web/WebFontImpl.h +++ b/third_party/WebKit/Source/web/WebFontImpl.h @@ -60,6 +60,7 @@ public: int height, int from = 0, int to = -1) const override; String debugName() const final { return "WebFontImpl"; } + IntRect visualRect() const override; private: Font m_font; diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp index 0f6ae15..eeb6509 100644 --- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp +++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp @@ -436,7 +436,9 @@ public: pictureBuilder.endRecording()->playback(canvas); } + // DisplayItemClient methods String debugName() const final { return "ChromePrintContext"; } + IntRect visualRect() const override { ASSERT_NOT_REACHED(); return IntRect(); } protected: // Spools the printed page, a subrect of frame(). Skip the scale step. |