Bug 79183

Summary: [chromium] Avoid culling work for fully-non-opaque tiles, and add tracing for draw culling
Product: WebKit Reporter: Dana Jansens <danakj>
Component: New BugsAssignee: Dana Jansens <danakj>
Status: RESOLVED FIXED    
Severity: Normal CC: backer, cc-bugs, commit-queue, enne, jamesr, piman, vangelis, webkit.review.bot, wjmaclean
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Dana Jansens 2012-02-21 19:03:55 PST
[chromium] Avoid culling work for fully-non-opaque tiles, and add tracing for draw culling
Comment 1 Dana Jansens 2012-02-21 19:07:38 PST
Created attachment 128109 [details]
Patch
Comment 2 Vangelis Kokkevis 2012-02-21 21:52:15 PST
Comment on attachment 128109 [details]
Patch

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

(Unofficially) LGTM

> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:244
> +    TRACE_EVENT("CCLayerTreeHostImpl::optimizeRenderPasses()", this, 0);

Maybe a good opportunity to also report the # of passes here too?
Comment 3 James Robinson 2012-02-21 22:04:47 PST
Comment on attachment 128109 [details]
Patch

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

>> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:244
>> +    TRACE_EVENT("CCLayerTreeHostImpl::optimizeRenderPasses()", this, 0);
> 
> Maybe a good opportunity to also report the # of passes here too?

We haven't been putting the '()' in traces for functions before. There's no really strong reason for or against this convention, but it's what we've been using so I'd like to stay consistent.

I believe you can pass parameters efficiently now by using the TRACE_EVENT1() macro instead of TRACE_EVENT.  See the comments in TraceEvent.h for details
Comment 4 Vangelis Kokkevis 2012-02-22 08:02:48 PST
Comment on attachment 128109 [details]
Patch

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

> Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp:104
> +        if (keepQuad && drawQuad->isLayerAxisAlignedIntRect() && !drawQuad->opaqueRect().isEmpty()) {

One more quick comment:  I think this loop could be simplified if you add an early out ("continue") after line 96:

if (!keepQuad)
   continue;

That way you won't need to keep checking that keepQuad == true
Comment 5 Dana Jansens 2012-02-23 17:48:09 PST
Created attachment 128621 [details]
Patch

Looking for review again to make sure I got this TRACE_EVENT foo correct. I had to cast the passes.size() to make it compile, as size_t confused it and it wasn't sure if "unsigned long" should be an "unsigned long long" or an "unsigned int", etc.

@vangelis good call with the continue!
Comment 6 James Robinson 2012-02-23 17:55:44 PST
Comment on attachment 128621 [details]
Patch

Thumbsup!
Comment 7 WebKit Review Bot 2012-02-24 02:59:05 PST
The commit-queue encountered the following flaky tests while processing attachment 128621 [details]:

perf/mouse-event.html bug 78736 (author: eae@chromium.org)
The commit-queue is continuing to process your patch.
Comment 8 WebKit Review Bot 2012-02-24 03:01:09 PST
Comment on attachment 128621 [details]
Patch

Clearing flags on attachment: 128621

Committed r108764: <http://trac.webkit.org/changeset/108764>
Comment 9 WebKit Review Bot 2012-02-24 03:01:14 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Dana Jansens 2012-03-02 11:44:35 PST
*** Bug 76578 has been marked as a duplicate of this bug. ***