Bug 82057 - [chromium] Record painted pixel counts for measuring effectiveness of per-tile painting
Summary: [chromium] Record painted pixel counts for measuring effectiveness of per-til...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dana Jansens
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-23 08:53 PDT by Dana Jansens
Modified: 2012-03-23 15:09 PDT (History)
7 users (show)

See Also:


Attachments
Patch (15.11 KB, patch)
2012-03-23 08:58 PDT, Dana Jansens
no flags Details | Formatted Diff | Diff
Patch (15.49 KB, patch)
2012-03-23 11:59 PDT, Dana Jansens
no flags Details | Formatted Diff | Diff
Patch (13.48 KB, patch)
2012-03-23 14:01 PDT, Dana Jansens
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dana Jansens 2012-03-23 08:53:02 PDT
[chromium] Record invalidated vs painted pixel counts for measuring effectiveness of per-tile painting
Comment 1 Dana Jansens 2012-03-23 08:58:33 PDT
Created attachment 133494 [details]
Patch
Comment 2 Dana Jansens 2012-03-23 09:06:10 PDT
This goes out to all the peeps in Boston.
Comment 3 David Reveman 2012-03-23 09:26:02 PDT
Comment on attachment 133494 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=133494&action=review

Dana, thanks for taking care of this!

> Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp:482
> +        occlusion->overdrawMetrics().didPaint(m_paintRect);

Rather than reporting the paint rectangle here, could we have the PixelsPainted metric reflect the pixels that were actually painted by the texture updater? So if I turn on per-tile painting the PixelsPainted metric would go down. For BitmapCanvasLayerTextureUpdater report the area painted in LayerTextureUpdate::prepareToUpdate and for BitmapSkPictureCanvasLayerTextureUpdater instead report the playback areas in LayerTextureUpdate::prepareRect.

What do you think?
Comment 4 Dana Jansens 2012-03-23 09:30:38 PDT
Comment on attachment 133494 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=133494&action=review

>> Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp:482
>> +        occlusion->overdrawMetrics().didPaint(m_paintRect);
> 
> Rather than reporting the paint rectangle here, could we have the PixelsPainted metric reflect the pixels that were actually painted by the texture updater? So if I turn on per-tile painting the PixelsPainted metric would go down. For BitmapCanvasLayerTextureUpdater report the area painted in LayerTextureUpdate::prepareToUpdate and for BitmapSkPictureCanvasLayerTextureUpdater instead report the playback areas in LayerTextureUpdate::prepareRect.
> 
> What do you think?

That is covered by adding the pixels "drawn" (uploaded) transparent + opaque.
Comment 5 Dana Jansens 2012-03-23 09:31:47 PDT
Unless the pixels painted by the updater, and uploaded, can differ?
Comment 6 David Reveman 2012-03-23 09:38:10 PDT
Ah, I see. Yeah, it looks like this should do it! Could you add a unit test that uses explicit texture updater types to ensure that this works correctly?
Comment 7 Dana Jansens 2012-03-23 11:59:27 PDT
Created attachment 133529 [details]
Patch

Added some comments to the overdraw metrics header. Especially to clarify that painted pixels != rasterized pixels, as we will be interested in tracking rasterized pixels in the future, in order to determine wins of different approaches to texture updating.
Comment 8 David Reveman 2012-03-23 12:13:05 PDT
Comment on attachment 133529 [details]
Patch

LGTM
Comment 9 Adrienne Walker 2012-03-23 13:43:53 PDT
Comment on attachment 133529 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=133529&action=review

> Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp:471
> +            if (occlusion)
> +                occlusion->overdrawMetrics().didInvalidate(tile->m_dirtyRect);
> +

I might just be bikeshedding here, but "invalidate" is kind of misleading.  It isn't "pixels invalidated" it's really "pixels within the visible layer rect that are not on tiles that are entirely occluded".  If anything, this value seems kind of redundant with the information that you're getting out of "total pixels drawn"?
Comment 10 Dana Jansens 2012-03-23 13:50:27 PDT
Comment on attachment 133529 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=133529&action=review

>> Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp:471
>> +
> 
> I might just be bikeshedding here, but "invalidate" is kind of misleading.  It isn't "pixels invalidated" it's really "pixels within the visible layer rect that are not on tiles that are entirely occluded".  If anything, this value seems kind of redundant with the information that you're getting out of "total pixels drawn"?

Yeh, I agree. I wanted the pixels that we "have to paint" vs "did paint", but it is the same as what we are uploading.
Comment 11 Dana Jansens 2012-03-23 14:01:36 PDT
Created attachment 133553 [details]
Patch
Comment 12 Dana Jansens 2012-03-23 14:04:13 PDT
Removed the invalidated pixel metric, just counting pixels painted by webkit.
Comment 13 Adrienne Walker 2012-03-23 14:12:02 PDT
Comment on attachment 133553 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=133553&action=review

> Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp:151
> +    if (paintedCounterName) {
> +        // This must be in a different scope than the TRACE_EVENT2 above.
> +        TRACE_EVENT1("webkit", "CCOverdrawPaintMetrics", paintedCounterName, m_pixelsPainted);
> +    }

Why? Can you not TRACE_EVENT2 or TRACE_EVENT3, depending on which path you're in, so that all the values are grouped together?
Comment 14 Dana Jansens 2012-03-23 14:16:18 PDT
(In reply to comment #13)
> (From update of attachment 133553 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=133553&action=review
> 
> > Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp:151
> > +    if (paintedCounterName) {
> > +        // This must be in a different scope than the TRACE_EVENT2 above.
> > +        TRACE_EVENT1("webkit", "CCOverdrawPaintMetrics", paintedCounterName, m_pixelsPainted);
> > +    }
> 
> Why? Can you not TRACE_EVENT2 or TRACE_EVENT3, depending on which path you're in, so that all the values are grouped together?

There is currently no TRACE_EVENT3, though jbates has an open bug to allow more than 2 axes of data in a single trace/counter.

The scoping issue is because of compile errors, the macros expect only one such trace to exist within a scope.
Comment 15 Adrienne Walker 2012-03-23 14:21:28 PDT
(In reply to comment #14)
> (In reply to comment #13)
> > (From update of attachment 133553 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=133553&action=review
> > 
> > > Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp:151
> > > +    if (paintedCounterName) {
> > > +        // This must be in a different scope than the TRACE_EVENT2 above.
> > > +        TRACE_EVENT1("webkit", "CCOverdrawPaintMetrics", paintedCounterName, m_pixelsPainted);
> > > +    }
> > 
> > Why? Can you not TRACE_EVENT2 or TRACE_EVENT3, depending on which path you're in, so that all the values are grouped together?
> 
> There is currently no TRACE_EVENT3, though jbates has an open bug to allow more than 2 axes of data in a single trace/counter.

Oh! My misunderstanding.
Comment 16 WebKit Review Bot 2012-03-23 15:09:16 PDT
Comment on attachment 133553 [details]
Patch

Clearing flags on attachment: 133553

Committed r111913: <http://trac.webkit.org/changeset/111913>
Comment 17 WebKit Review Bot 2012-03-23 15:09:21 PDT
All reviewed patches have been landed.  Closing bug.