RESOLVED INVALID 85624
Web Inspector: HTMLCanvasElement::didDraw instrumentation.
https://bugs.webkit.org/show_bug.cgi?id=85624
Summary Web Inspector: HTMLCanvasElement::didDraw instrumentation.
eustas.bug
Reported 2012-05-04 07:59:25 PDT
Append record to timeline when drawing on HTML Canvas causes invalidation, which leads to deferred repaint.
Attachments
Patch (12.98 KB, patch)
2012-05-04 08:09 PDT, eustas.bug
no flags
Archive of layout-test-results from ec2-cr-linux-03 (5.68 MB, application/zip)
2012-05-04 08:51 PDT, WebKit Review Bot
no flags
Patch (13.92 KB, patch)
2012-05-05 04:55 PDT, eustas.bug
no flags
Patch (13.55 KB, patch)
2012-05-10 01:34 PDT, eustas.bug
no flags
New instrumentation records. (109.13 KB, image/png)
2012-05-10 08:33 PDT, eustas.bug
no flags
Patch (11.76 KB, patch)
2012-05-14 02:40 PDT, eustas.bug
no flags
Patch (11.89 KB, patch)
2012-05-14 03:08 PDT, eustas.bug
no flags
eustas.bug
Comment 1 2012-05-04 08:09:45 PDT
WebKit Review Bot
Comment 2 2012-05-04 08:50:55 PDT
Comment on attachment 140233 [details] Patch Attachment 140233 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12630166 New failing tests: inspector/timeline/timeline-enum-stability.html
WebKit Review Bot
Comment 3 2012-05-04 08:51:02 PDT
Created attachment 140245 [details] Archive of layout-test-results from ec2-cr-linux-03 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-03 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Pavel Feldman
Comment 4 2012-05-04 22:56:14 PDT
Comment on attachment 140233 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=140233&action=review > Source/WebCore/ChangeLog:8 > + Append record to timeline when drawing on HTML Canvas causes invalidation, Do you want a stack that caused repaint here? Why are you only interested in canvas invalidations? > Source/WebCore/html/HTMLCanvasElement.cpp:232 > + InspectorInstrumentation::didInvalidateRect(this->document(), dirtyRect); This is only a fraction of invalidations, a more specific name is needed. Also, why do we want to instrument invalidation? Are you trying to trace the subsequent paint from InspectorInstrumentation::willPaint to it? > Source/WebCore/inspector/front-end/TimelineModel.js:82 > + InvalidateRect: "InvalidateRect" That's what is making the test fail, you should update the test.
eustas.bug
Comment 5 2012-05-05 04:55:42 PDT
eustas.bug
Comment 6 2012-05-05 04:58:01 PDT
Comment on attachment 140233 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=140233&action=review >> Source/WebCore/ChangeLog:8 >> + Append record to timeline when drawing on HTML Canvas causes invalidation, > > Do you want a stack that caused repaint here? Why are you only interested in canvas invalidations? Stack is captured as well. >> Source/WebCore/html/HTMLCanvasElement.cpp:232 >> + InspectorInstrumentation::didInvalidateRect(this->document(), dirtyRect); > > This is only a fraction of invalidations, a more specific name is needed. Also, why do we want to instrument invalidation? Are you trying to trace the subsequent paint from InspectorInstrumentation::willPaint to it? Renamed to didInvalidateCanvasRect. We want to instrument invalidation to show to user code point that initiated deferred painting. Currently we do not link invalidation with subsequent painting. >> Source/WebCore/inspector/front-end/TimelineModel.js:82 >> + InvalidateRect: "InvalidateRect" > > That's what is making the test fail, you should update the test. Fixed.
Pavel Feldman
Comment 7 2012-05-05 08:23:43 PDT
Comment on attachment 140392 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=140392&action=review > Source/WebCore/html/HTMLCanvasElement.cpp:232 > + InspectorInstrumentation::didInvalidateCanvasRect(this->document(), dirtyRect); simply document() > Source/WebCore/inspector/TimelineRecordFactory.cpp:196 > +PassRefPtr<InspectorObject> TimelineRecordFactory::createInvalidateCanvasRectData(const IntRect& rect) This is just a rect data, you should re-use createPaintData. > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:519 > + contentHelper._appendTextRow(WebInspector.UIString("Location"), WebInspector.UIString("(%d, %d)", this.data["x"], this.data["y"])); Please add corresponding localizedStrings.
eustas.bug
Comment 8 2012-05-10 01:22:04 PDT
Comment on attachment 140392 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=140392&action=review >> Source/WebCore/html/HTMLCanvasElement.cpp:232 >> + InspectorInstrumentation::didInvalidateCanvasRect(this->document(), dirtyRect); > > simply document() Done. >> Source/WebCore/inspector/TimelineRecordFactory.cpp:196 >> +PassRefPtr<InspectorObject> TimelineRecordFactory::createInvalidateCanvasRectData(const IntRect& rect) > > This is just a rect data, you should re-use createPaintData. Did you mean: convert to IntRect to FloatRect and pass it to createPaintData? >> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:519 >> + contentHelper._appendTextRow(WebInspector.UIString("Location"), WebInspector.UIString("(%d, %d)", this.data["x"], this.data["y"])); > > Please add corresponding localizedStrings. Done.
eustas.bug
Comment 9 2012-05-10 01:34:06 PDT
Pavel Feldman
Comment 10 2012-05-10 06:30:52 PDT
Could you provide a screenshot with the instrumented data on any of the public sites as an attachment?
eustas.bug
Comment 11 2012-05-10 08:33:52 PDT
Created attachment 141177 [details] New instrumentation records.
Pavel Feldman
Comment 12 2012-05-11 00:36:53 PDT
@nduca: do you think it makes sense to instrument canvas's invalidation separately or should it be a part of a more generic invalidate instrumentation?
Nat Duca
Comment 13 2012-05-11 08:55:50 PDT
Comment on attachment 141108 [details] Patch The challenge here is the amount of invalidation that you can get would easily overwhelm a UI. E.g. what if I do this on a canvas? for(var i= 0; i < 1000; i++) ctx.fillRect(i,0,1,100); I think this could would put 1000 different entries in my timeline, each of which was 1 wider than the previous. An event and call stack on *first* invalidation might be good for canvas, but it often just points at recalc/layout for DOM nodes... This is a long winded way of me saying "yes, Pavel, it might be good to understand the general problem a bit more." :)
eustas.bug
Comment 14 2012-05-14 02:40:34 PDT
eustas.bug
Comment 15 2012-05-14 03:08:29 PDT
eustas.bug
Comment 16 2012-05-14 06:27:05 PDT
Fixed: now incalidation record appears only when "clean" canvas becomes "dirty".
Yury Semikhatsky
Comment 17 2012-05-25 03:11:46 PDT
Comment on attachment 141676 [details] Patch Clearing r? until we come to an agreement on whether it should be done this way.
Brian Burg
Comment 18 2014-12-12 14:36:00 PST
Closing as invalid, as this bug pertains to the old inspector UI and/or its tests. Please file a new bug (https://www.webkit.org/new-inspector-bug) if the bug/feature/issue is still relevant to WebKit trunk.
Note You need to log in before you can comment on or make changes to this bug.