Changeset 147204 in webkit


Ignore:
Timestamp:
Mar 29, 2013 2:44:53 AM (11 years ago)
Author:
caseq@chromium.org
Message:

Web Inspector: timeline paint rectangles are off for transformed layers
https://bugs.webkit.org/show_bug.cgi?id=112919

Reviewed by Pavel Feldman.

Source/WebCore:

  • pass RenderObject instead of Frame to InspectorInstrumentation::didPaint;
  • take transforms into account and convert paint clip rect into quad;
  • emit quads, not rects as Paint and Layout record data;
  • adjust client to using quads, compute width/height from quad coords.
  • inspector/InspectorInstrumentation.cpp: Pass RenderObject, not frame to {will,did}Paint.

(WebCore):
(WebCore::InspectorInstrumentation::willPaintImpl):
(WebCore::InspectorInstrumentation::didPaintImpl):
(WebCore::InspectorInstrumentation::instrumentingAgentsForRenderer): Added.

  • inspector/InspectorInstrumentation.h:

(WebCore):
(InspectorInstrumentation):
(WebCore::InspectorInstrumentation::willPaint):
(WebCore::InspectorInstrumentation::didPaint):

  • inspector/InspectorTimelineAgent.cpp:

(WebCore::InspectorTimelineAgent::didLayout):
(WebCore::InspectorTimelineAgent::didPaint):
(WebCore::InspectorTimelineAgent::localToPageQuad): Convert local clip rect to transformed quad.
(WebCore):

  • inspector/InspectorTimelineAgent.h:

(WebCore):
(InspectorTimelineAgent):

  • inspector/TimelineRecordFactory.cpp: Emit quads as Paint and Layout records data.

(WebCore::createQuad):
(WebCore):
(WebCore::TimelineRecordFactory::createPaintData):
(WebCore::TimelineRecordFactory::createLayoutData):

  • inspector/TimelineRecordFactory.h:

(WebCore):
(TimelineRecordFactory):

  • inspector/front-end/TimelinePanel.js: Highlight a quad iff formatted record has highlightQuad field.

(WebInspector.TimelinePanel.prototype._mouseOut):
(WebInspector.TimelinePanel.prototype._mouseMove):
(WebInspector.TimelinePanel.prototype._highlightQuad):
(WebInspector.TimelinePanel.prototype._hideQuadHighlight):

  • inspector/front-end/TimelinePresentationModel.js:

(WebInspector.TimelinePresentationModel.Record): Set highlightQuad for Paint and Layout
(WebInspector.TimelinePresentationModel.Record.prototype._generatePopupContentWithImagePreview):
(WebInspector.TimelinePresentationModel.Record.prototype._getRecordDetails):
(WebInspector.TimelinePresentationModel.quadWidth):
(WebInspector.TimelinePresentationModel.quadHeight):

  • page/FrameView.cpp:

(WebCore::FrameView::paintContents):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::paintContents):

LayoutTests:

  • adjust to changed record format;
  • simplify test using InspectorTest.evaluateWithTimeline().
  • http/tests/inspector/timeline-test.js:
  • inspector/timeline/timeline-layout-expected.txt:
  • inspector/timeline/timeline-paint-expected.txt:
  • inspector/timeline/timeline-paint.html:
Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147203 r147204  
     12013-03-22  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Web Inspector: timeline paint rectangles are off for transformed layers
     4        https://bugs.webkit.org/show_bug.cgi?id=112919
     5
     6        Reviewed by Pavel Feldman.
     7
     8        - adjust to changed record format;
     9        - simplify test using InspectorTest.evaluateWithTimeline().
     10
     11        * http/tests/inspector/timeline-test.js:
     12        * inspector/timeline/timeline-layout-expected.txt:
     13        * inspector/timeline/timeline-paint-expected.txt:
     14        * inspector/timeline/timeline-paint.html:
     15
    1162013-03-29  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
    217
  • trunk/LayoutTests/http/tests/inspector/timeline-test.js

    r147097 r147204  
    55    children: "formatAsTypeName",
    66    endTime: "formatAsTypeName",
    7     height: "formatAsTypeName",
    87    requestId: "formatAsTypeName",
    98    startTime: "formatAsTypeName",
    10     width: "formatAsTypeName",
    119    stackTrace: "formatAsTypeName",
    1210    url: "formatAsTypeName",
     
    2220    frameId: "formatAsTypeName",
    2321    encodedDataLength: "formatAsTypeName",
    24     identifier: "formatAsTypeName"   
     22    identifier: "formatAsTypeName",
     23    clip: "formatAsTypeName",
     24    root: "formatAsTypeName",
    2525};
    2626
  • trunk/LayoutTests/inspector/timeline/timeline-layout-expected.txt

    r128184 r147204  
    77    counters : <object>
    88    data : {
    9         height : <number>
    10         width : <number>
    11         x : 0
    12         y : 0
     9        root : <object>
    1310    }
    1411    endTime : <number>
  • trunk/LayoutTests/inspector/timeline/timeline-paint-expected.txt

    r146476 r147204  
    77    counters : <object>
    88    data : {
    9         height : <number>
    10         width : <number>
    11         x : 0
    12         y : 0
     9        clip : <object>
    1310    }
    1411    endTime : <number>
  • trunk/LayoutTests/inspector/timeline/timeline-paint.html

    r146476 r147204  
    2020function test()
    2121{
    22     InspectorTest.startTimeline(step1);
     22    step1();
     23
    2324    function step1()
    2425    {
    25         InspectorTest.evaluateInPage("display()", step2);
     26        InspectorTest.evaluateWithTimeline("display()", step2);
    2627    }
    2728
    28     function step2()
    29     {
    30         InspectorTest.stopTimeline(step3);
    31     }
    32 
    33     function step3(records)
     29    function step2(records)
    3430    {
    3531        for (var i = 0; i < records.length; ++i) {
     
    4036            }
    4137        }
    42         InspectorTest.startTimeline(step4);
     38        InspectorTest.evaluateWithTimeline("updateSubframeAndDisplay()", step3);
    4339    }
    4440
    45     function step4()
    46     {
    47         InspectorTest.evaluateInPage("updateSubframeAndDisplay()", step5);
    48     }
    49 
    50     function step5()
    51     {
    52         InspectorTest.stopTimeline(step6);
    53     }
    54 
    55     function step6(records)
     41    function step3(records)
    5642    {
    5743        var paintRecord;
     
    6450        }
    6551        InspectorTest.assertTrue(paintRecord, "Paint record with subframe paint not found");
     52        var topQuad = paintRecord.data.clip;
    6653        var subframePaint = paintRecord.children[0];
    67         InspectorTest.assertGreaterOrEqual(subframePaint.data.x, paintRecord.data.x);
    68         InspectorTest.assertGreaterOrEqual(subframePaint.data.y, paintRecord.data.y);
    69         InspectorTest.assertGreaterOrEqual(paintRecord.data.x + paintRecord.data.width, subframePaint.data.x + subframePaint.data.width);
    70         InspectorTest.assertGreaterOrEqual(paintRecord.data.y + paintRecord.data.height, subframePaint.data.y + subframePaint.data.height);
     54        var subframeQuad = subframePaint.data.clip;
     55        InspectorTest.assertEquals(8, topQuad.length);
     56        InspectorTest.assertEquals(8, subframeQuad.length);
     57        InspectorTest.assertGreaterOrEqual(subframeQuad[0], topQuad[0]);
     58        InspectorTest.assertGreaterOrEqual(subframeQuad[1], topQuad[1]);
     59        InspectorTest.assertGreaterOrEqual(topQuad[2], subframeQuad[2]);
     60        InspectorTest.assertGreaterOrEqual(subframeQuad[3], topQuad[3]);
     61        InspectorTest.assertGreaterOrEqual(topQuad[4], subframeQuad[4]);
     62        InspectorTest.assertGreaterOrEqual(topQuad[5], subframeQuad[5]);
     63        InspectorTest.assertGreaterOrEqual(subframeQuad[6], topQuad[6]);
     64        InspectorTest.assertGreaterOrEqual(topQuad[7], subframeQuad[7]);
     65
    7166        InspectorTest.completeTest();
    7267    }
  • trunk/Source/WebCore/ChangeLog

    r147202 r147204  
     12013-03-22  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Web Inspector: timeline paint rectangles are off for transformed layers
     4        https://bugs.webkit.org/show_bug.cgi?id=112919
     5
     6        Reviewed by Pavel Feldman.
     7
     8        - pass RenderObject instead of Frame to InspectorInstrumentation::didPaint;
     9        - take transforms into account and convert paint clip rect into quad;
     10        - emit quads, not rects as Paint and Layout record data;
     11        - adjust client to using quads, compute width/height from quad coords.
     12
     13        * inspector/InspectorInstrumentation.cpp: Pass RenderObject, not frame to {will,did}Paint.
     14        (WebCore):
     15        (WebCore::InspectorInstrumentation::willPaintImpl):
     16        (WebCore::InspectorInstrumentation::didPaintImpl):
     17        (WebCore::InspectorInstrumentation::instrumentingAgentsForRenderer): Added.
     18        * inspector/InspectorInstrumentation.h:
     19        (WebCore):
     20        (InspectorInstrumentation):
     21        (WebCore::InspectorInstrumentation::willPaint):
     22        (WebCore::InspectorInstrumentation::didPaint):
     23        * inspector/InspectorTimelineAgent.cpp:
     24        (WebCore::InspectorTimelineAgent::didLayout):
     25        (WebCore::InspectorTimelineAgent::didPaint):
     26        (WebCore::InspectorTimelineAgent::localToPageQuad): Convert local clip rect to transformed quad.
     27        (WebCore):
     28        * inspector/InspectorTimelineAgent.h:
     29        (WebCore):
     30        (InspectorTimelineAgent):
     31        * inspector/TimelineRecordFactory.cpp: Emit quads as Paint and Layout records data.
     32        (WebCore::createQuad):
     33        (WebCore):
     34        (WebCore::TimelineRecordFactory::createPaintData):
     35        (WebCore::TimelineRecordFactory::createLayoutData):
     36        * inspector/TimelineRecordFactory.h:
     37        (WebCore):
     38        (TimelineRecordFactory):
     39        * inspector/front-end/TimelinePanel.js: Highlight a quad iff formatted record has highlightQuad field.
     40        (WebInspector.TimelinePanel.prototype._mouseOut):
     41        (WebInspector.TimelinePanel.prototype._mouseMove):
     42        (WebInspector.TimelinePanel.prototype._highlightQuad):
     43        (WebInspector.TimelinePanel.prototype._hideQuadHighlight):
     44        * inspector/front-end/TimelinePresentationModel.js:
     45        (WebInspector.TimelinePresentationModel.Record): Set highlightQuad for Paint and Layout
     46        (WebInspector.TimelinePresentationModel.Record.prototype._generatePopupContentWithImagePreview):
     47        (WebInspector.TimelinePresentationModel.Record.prototype._getRecordDetails):
     48        (WebInspector.TimelinePresentationModel.quadWidth):
     49        (WebInspector.TimelinePresentationModel.quadHeight):
     50        * page/FrameView.cpp:
     51        (WebCore::FrameView::paintContents):
     52        * rendering/RenderLayerBacking.cpp:
     53        (WebCore::RenderLayerBacking::paintContents):
     54
    1552013-03-21  Andrey Kosyakov  <caseq@chromium.org>
    256
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r146476 r147204  
    6767#include "PageDebuggerAgent.h"
    6868#include "PageRuntimeAgent.h"
     69#include "RenderObject.h"
    6970#include "ScriptArguments.h"
    7071#include "ScriptCallStack.h"
     
    526527}
    527528
    528 void InspectorInstrumentation::willPaintImpl(InstrumentingAgents* instrumentingAgents, Frame* frame)
     529void InspectorInstrumentation::willPaintImpl(InstrumentingAgents* instrumentingAgents, RenderObject* renderer)
    529530{
    530531#if PLATFORM(CHROMIUM)
    531     TRACE_EVENT_INSTANT1("instrumentation", InstrumentationEvents::Paint, InstrumentationEventArguments::PageId, frame ? reinterpret_cast<unsigned long long>(frame->page()) : 0);
    532 #endif
    533 
    534     if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent())
    535         timelineAgent->willPaint(frame);
    536 }
    537 
    538 void InspectorInstrumentation::didPaintImpl(InstrumentingAgents*  instrumentingAgents, Frame* frame, GraphicsContext* context, const LayoutRect& rect)
    539 {
    540     if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent())
    541         timelineAgent->didPaint(frame, rect);
     532    TRACE_EVENT_INSTANT1("instrumentation", InstrumentationEvents::Paint, InstrumentationEventArguments::PageId, reinterpret_cast<unsigned long long>(renderer->frame()->page()));
     533#endif
     534
     535    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent())
     536        timelineAgent->willPaint(renderer->frame());
     537}
     538
     539void InspectorInstrumentation::didPaintImpl(InstrumentingAgents*  instrumentingAgents, RenderObject* renderer, GraphicsContext* context, const LayoutRect& rect)
     540{
     541    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent())
     542        timelineAgent->didPaint(renderer, rect);
    542543    if (InspectorPageAgent* pageAgent = instrumentingAgents->inspectorPageAgent())
    543544        pageAgent->didPaint(context, rect);
     
    13301331}
    13311332
     1333InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForRenderer(RenderObject* renderer)
     1334{
     1335    return instrumentingAgentsForFrame(renderer->frame());
     1336}
     1337
    13321338#if ENABLE(WORKERS)
    13331339InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForWorkerContext(WorkerContext* workerContext)
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.h

    r146476 r147204  
    7575class PseudoElement;
    7676class RenderLayer;
     77class RenderLayerBacking;
    7778class RenderObject;
    7879class ResourceRequest;
     
    170171    static void willScrollLayer(Frame*);
    171172    static void didScrollLayer(Frame*);
    172     static void willPaint(Frame*);
    173     static void didPaint(Frame*, GraphicsContext*, const LayoutRect&);
     173    static void willPaint(RenderObject*);
     174    static void didPaint(RenderObject*, GraphicsContext*, const LayoutRect&);
    174175    static void willComposite(Page*);
    175176    static void didComposite(Page*);
     
    374375    static void willScrollLayerImpl(InstrumentingAgents*, Frame*);
    375376    static void didScrollLayerImpl(InstrumentingAgents*);
    376     static void willPaintImpl(InstrumentingAgents*, Frame*);
    377     static void didPaintImpl(InstrumentingAgents*, Frame*, GraphicsContext*, const LayoutRect&);
     377    static void willPaintImpl(InstrumentingAgents*, RenderObject*);
     378    static void didPaintImpl(InstrumentingAgents*, RenderObject*, GraphicsContext*, const LayoutRect&);
    378379    static InspectorInstrumentationCookie willRecalculateStyleImpl(InstrumentingAgents*, Frame*);
    379380    static void didRecalculateStyleImpl(const InspectorInstrumentationCookie&);
     
    484485    static InstrumentingAgents* instrumentingAgentsForContext(ScriptExecutionContext*);
    485486    static InstrumentingAgents* instrumentingAgentsForDocument(Document*);
     487    static InstrumentingAgents* instrumentingAgentsForRenderer(RenderObject*);
     488
    486489#if ENABLE(WORKERS)
    487490    static InstrumentingAgents* instrumentingAgentsForWorkerContext(WorkerContext*);
     
    11021105}
    11031106
    1104 inline void InspectorInstrumentation::willPaint(Frame* frame)
    1105 {
    1106 #if ENABLE(INSPECTOR)
    1107     FAST_RETURN_IF_NO_FRONTENDS(void());
    1108     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
    1109         return willPaintImpl(instrumentingAgents, frame);
    1110 #else
    1111     UNUSED_PARAM(frame);
    1112 #endif
    1113 }
    1114 
    1115 inline void InspectorInstrumentation::didPaint(Frame* frame, GraphicsContext* context, const LayoutRect& rect)
    1116 {
    1117 #if ENABLE(INSPECTOR)
    1118     FAST_RETURN_IF_NO_FRONTENDS(void());
    1119     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
    1120         didPaintImpl(instrumentingAgents, frame, context, rect);
    1121 #else
    1122     UNUSED_PARAM(frame);
     1107inline void InspectorInstrumentation::willPaint(RenderObject* renderer)
     1108{
     1109#if ENABLE(INSPECTOR)
     1110    FAST_RETURN_IF_NO_FRONTENDS(void());
     1111    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForRenderer(renderer))
     1112        return willPaintImpl(instrumentingAgents, renderer);
     1113#else
     1114    UNUSED_PARAM(renderer);
     1115#endif
     1116}
     1117
     1118inline void InspectorInstrumentation::didPaint(RenderObject* renderer, GraphicsContext* context, const LayoutRect& rect)
     1119{
     1120#if ENABLE(INSPECTOR)
     1121    FAST_RETURN_IF_NO_FRONTENDS(void());
     1122    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForRenderer(renderer))
     1123        didPaintImpl(instrumentingAgents, renderer, context, rect);
     1124#else
     1125    UNUSED_PARAM(renderer);
    11231126    UNUSED_PARAM(context);
    11241127    UNUSED_PARAM(rect);
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp

    r146982 r147204  
    271271    if (m_recordStack.isEmpty())
    272272        return;
    273     LayoutRect rect = root->frame()->view()->contentsToRootView(root->absoluteBoundingBoxRect());
    274     TimelineRecordEntry entry = m_recordStack.last();
     273    TimelineRecordEntry& entry = m_recordStack.last();
    275274    ASSERT(entry.type == TimelineRecordType::Layout);
    276     TimelineRecordFactory::addRectData(entry.data.get(), rect);
     275    Vector<FloatQuad> quads;
     276    root->absoluteQuads(quads);
     277    if (quads.size() >= 1)
     278        entry.data = TimelineRecordFactory::createLayoutData(quads[0]);
     279    else
     280        ASSERT_NOT_REACHED();
    277281    didCompleteCurrentRecord(TimelineRecordType::Layout);
    278282}
     
    298302}
    299303
    300 void InspectorTimelineAgent::didPaint(Frame* frame, const LayoutRect& rect)
    301 {
    302     TimelineRecordEntry entry = m_recordStack.last();
     304void InspectorTimelineAgent::didPaint(RenderObject* renderer, const LayoutRect& clipRect)
     305{
     306    TimelineRecordEntry& entry = m_recordStack.last();
    303307    ASSERT(entry.type == TimelineRecordType::Paint);
    304     LayoutRect rectInRootCoordinates = frame->view()->contentsToRootView(pixelSnappedIntRect(rect));
    305     TimelineRecordFactory::addRectData(entry.data.get(), rectInRootCoordinates);
     308    FloatQuad quad;
     309    localToPageQuad(*renderer, clipRect, &quad);
     310    entry.data = TimelineRecordFactory::createPaintData(quad);
    306311    didCompleteCurrentRecord(TimelineRecordType::Paint);
    307312}
     
    698703}
    699704
     705void InspectorTimelineAgent::localToPageQuad(const RenderObject& renderer, const LayoutRect& rect, FloatQuad* quad)
     706{
     707    Frame* frame = renderer.frame();
     708    FrameView* view = frame->view();
     709    FloatQuad absolute = renderer.localToAbsoluteQuad(FloatQuad(rect));
     710    quad->setP1(view->contentsToRootView(roundedIntPoint(absolute.p1())));
     711    quad->setP2(view->contentsToRootView(roundedIntPoint(absolute.p2())));
     712    quad->setP3(view->contentsToRootView(roundedIntPoint(absolute.p3())));
     713    quad->setP4(view->contentsToRootView(roundedIntPoint(absolute.p4())));
     714}
     715
    700716double InspectorTimelineAgent::timestamp()
    701717{
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.h

    r146975 r147204  
    4747namespace WebCore {
    4848class Event;
     49class FloatQuad;
    4950class Frame;
    5051class InspectorClient;
     
    130131
    131132    void willPaint(Frame*);
    132     void didPaint(Frame*, const LayoutRect&);
     133    void didPaint(RenderObject*, const LayoutRect&);
    133134
    134135    void willScroll(Frame*);
     
    229230    void clearRecordStack();
    230231
     232    void localToPageQuad(const RenderObject& renderer, const LayoutRect&, FloatQuad*);
    231233    const TimelineTimeConverter& timeConverter() const { return m_timeConverter; }
    232234    double timestamp();
  • trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp

    r145809 r147204  
    3636
    3737#include "Event.h"
     38#include "FloatQuad.h"
    3839#include "InspectorValues.h"
    3940#include "IntRect.h"
     
    214215}
    215216
    216 void TimelineRecordFactory::addRectData(InspectorObject* data, const LayoutRect& rect)
    217 {
    218     data->setNumber("x", rect.x());
    219     data->setNumber("y", rect.y());
    220     data->setNumber("width", rect.width());
    221     data->setNumber("height", rect.height());
     217static PassRefPtr<InspectorArray> createQuad(const FloatQuad& quad)
     218{
     219    RefPtr<InspectorArray> array = InspectorArray::create();
     220    array->pushNumber(quad.p1().x());
     221    array->pushNumber(quad.p1().y());
     222    array->pushNumber(quad.p2().x());
     223    array->pushNumber(quad.p2().y());
     224    array->pushNumber(quad.p3().x());
     225    array->pushNumber(quad.p3().y());
     226    array->pushNumber(quad.p4().x());
     227    array->pushNumber(quad.p4().y());
     228    return array.release();
     229}
     230
     231PassRefPtr<InspectorObject> TimelineRecordFactory::createPaintData(const FloatQuad& quad)
     232{
     233    RefPtr<InspectorObject> data = InspectorObject::create();
     234    data->setArray("clip", createQuad(quad));
     235    return data.release();
     236}
     237
     238PassRefPtr<InspectorObject> TimelineRecordFactory::createLayoutData(const FloatQuad& quad)
     239{
     240    RefPtr<InspectorObject> data = InspectorObject::create();
     241    data->setArray("root", createQuad(quad));
     242    return data.release();
    222243}
    223244
  • trunk/Source/WebCore/inspector/TimelineRecordFactory.h

    r145809 r147204  
    4141
    4242    class Event;
     43    class FloatQuad;
    4344    class InspectorFrontend;
    4445    class InspectorObject;
     
    9293        static PassRefPtr<InspectorObject> createAnimationFrameData(int callbackId);
    9394
     95        static PassRefPtr<InspectorObject> createPaintData(const FloatQuad&);
     96
     97        static PassRefPtr<InspectorObject> createLayoutData(const FloatQuad&);
     98
    9499#if ENABLE(WEB_SOCKETS)
    95100        static inline PassRefPtr<InspectorObject> createWebSocketCreateData(unsigned long identifier, const KURL& url, const String& protocol)
  • trunk/Source/WebCore/inspector/front-end/TimelinePanel.js

    r147097 r147204  
    10631063    _mouseOut: function(e)
    10641064    {
    1065         this._hideRectHighlight();
    1066     },
    1067 
     1065        this._hideQuadHighlight();
     1066    },
     1067
     1068    /**
     1069     * @param {Event} e
     1070     */
    10681071    _mouseMove: function(e)
    10691072    {
    10701073        var anchor = this._getPopoverAnchor(e.target);
    10711074
    1072         const recordType = WebInspector.TimelineModel.RecordType;
    1073         if (anchor && anchor.row && (anchor.row._record.type === recordType.Paint || anchor.row._record.type === recordType.Layout))
    1074             this._highlightRect(anchor.row._record);
     1075        if (anchor && anchor.row && anchor.row._record.highlightQuad)
     1076            this._highlightQuad(anchor.row._record.highlightQuad);
    10751077        else
    1076             this._hideRectHighlight();
     1078            this._hideQuadHighlight();
    10771079
    10781080        if (anchor && anchor._tasksInfo) {
     
    10831085    },
    10841086
    1085     _highlightRect: function(record)
    1086     {
    1087         if (record.coalesced)
     1087    /**
     1088     * @param {Array.<number>} quad
     1089     */
     1090    _highlightQuad: function(quad)
     1091    {
     1092        if (this._highlightedQuad === quad)
    10881093            return;
    1089         if (this._highlightedRect === record.data)
    1090             return;
    1091         this._highlightedRect = record.data;
    1092         DOMAgent.highlightRect(this._highlightedRect.x, this._highlightedRect.y, this._highlightedRect.width, this._highlightedRect.height, WebInspector.Color.PageHighlight.Content.toProtocolRGBA(), WebInspector.Color.PageHighlight.ContentOutline.toProtocolRGBA());
    1093     },
    1094 
    1095     _hideRectHighlight: function()
    1096     {
    1097         if (this._highlightedRect) {
    1098             delete this._highlightedRect;
     1094        this._highlightedQuad = quad;
     1095        DOMAgent.highlightQuad(quad, WebInspector.Color.PageHighlight.Content.toProtocolRGBA(), WebInspector.Color.PageHighlight.ContentOutline.toProtocolRGBA());
     1096    },
     1097
     1098    _hideQuadHighlight: function()
     1099    {
     1100        if (this._highlightedQuad) {
     1101            delete this._highlightedQuad;
    10991102            DOMAgent.hideHighlight();
    11001103        }
  • trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js

    r147097 r147204  
    749749            this.setHasWarning();
    750750        presentationModel._layoutInvalidateStack[this.frameId] = null;
     751        this.highlightQuad = record.data.root;
     752        break;
     753
     754    case recordTypes.Paint:
     755        this.highlightQuad = record.data.clip;
    751756        break;
    752757
     
    10311036                break;
    10321037            case recordTypes.Paint:
    1033                 contentHelper.appendTextRow(WebInspector.UIString("Location"), WebInspector.UIString("(%d, %d)", this.data["x"], this.data["y"]));
    1034                 contentHelper.appendTextRow(WebInspector.UIString("Dimensions"), WebInspector.UIString("%d × %d", this.data["width"], this.data["height"]));
     1038                contentHelper.appendTextRow(WebInspector.UIString("Location"), WebInspector.UIString("(%d, %d)", this.data.clip[0], this.data.clip[1]));
     1039                var clipWidth = WebInspector.TimelinePresentationModel.quadWidth(this.data.clip);
     1040                var clipHeight = WebInspector.TimelinePresentationModel.quadHeight(this.data.clip);
     1041                contentHelper.appendTextRow(WebInspector.UIString("Dimensions"), WebInspector.UIString("%d × %d", clipWidth, clipHeight));
    10351042                break;
    10361043            case recordTypes.RecalculateStyles: // We don't want to see default details.
     
    11431150            break;
    11441151        case WebInspector.TimelineModel.RecordType.Paint:
    1145             details = this.data["width"] + "\u2009\u00d7\u2009" + this.data["height"];
     1152            details = WebInspector.TimelinePresentationModel.quadWidth(this.data.clip)  + "\u2009\u00d7\u2009" + WebInspector.TimelinePresentationModel.quadHeight(this.data.clip);
    11461153            break;
    11471154        case WebInspector.TimelineModel.RecordType.DecodeImage:
     
    13661373
    13671374/**
     1375 * @param {Array.<number>} quad
     1376 * @return {number}
     1377 */
     1378WebInspector.TimelinePresentationModel.quadWidth = function(quad)
     1379{
     1380    return Math.round(Math.sqrt(Math.pow(quad[0] - quad[2], 2) + Math.pow(quad[1] - quad[3], 2)));
     1381}
     1382
     1383/**
     1384 * @param {Array.<number>} quad
     1385 * @return {number}
     1386 */
     1387WebInspector.TimelinePresentationModel.quadHeight = function(quad)
     1388{
     1389    return Math.round(Math.sqrt(Math.pow(quad[0] - quad[6], 2) + Math.pow(quad[1] - quad[7], 2)));
     1390}
     1391
     1392/**
    13681393 * @interface
    13691394 */
  • trunk/Source/WebCore/page/FrameView.cpp

    r147120 r147204  
    34073407        return;
    34083408
    3409     InspectorInstrumentation::willPaint(m_frame.get());
    3410 
    34113409    Document* document = m_frame->document();
    34123410
     
    34403438        return;
    34413439
     3440    InspectorInstrumentation::willPaint(renderView);
     3441
    34423442    bool isTopLevelPainter = !sCurrentPaintTimeStamp;
    34433443    if (isTopLevelPainter)
     
    35023502        sCurrentPaintTimeStamp = 0;
    35033503
    3504     InspectorInstrumentation::didPaint(m_frame.get(), p, rect);
     3504    InspectorInstrumentation::didPaint(renderView, p, rect);
    35053505}
    35063506
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r147163 r147204  
    18981898        || graphicsLayer == m_maskLayer.get()
    18991899        || graphicsLayer == m_scrollingContentsLayer.get()) {
    1900         Frame* frame = m_owningLayer->renderer()->frame();
    1901         InspectorInstrumentation::willPaint(frame);
     1900        InspectorInstrumentation::willPaint(renderer());
    19021901
    19031902        // The dirtyRect is in the coords of the painting root.
     
    19101909
    19111910        if (m_usingTiledCacheLayer)
    1912             frame->view()->setLastPaintTime(currentTime());
    1913 
    1914         InspectorInstrumentation::didPaint(frame, &context, clip);
     1911            renderer()->frame()->view()->setLastPaintTime(currentTime());
     1912
     1913        InspectorInstrumentation::didPaint(renderer(), &context, clip);
    19151914    } else if (graphicsLayer == layerForHorizontalScrollbar()) {
    19161915        paintScrollbar(m_owningLayer->horizontalScrollbar(), context, clip);
Note: See TracChangeset for help on using the changeset viewer.