Bug 83504

Summary: [chromium] Replica layers are not drawn, so should not be painted
Product: WebKit Reporter: Dana Jansens <danakj>
Component: New BugsAssignee: Dana Jansens <danakj>
Severity: Normal CC: backer, cc-bugs, enne, jamesr, piman, vangelis, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
Patch for landing none

Description Dana Jansens 2012-04-09 13:32:26 PDT
[chromium] Don't waste time trying to paint replica layers
Comment 1 Dana Jansens 2012-04-09 13:36:20 PDT
We attempt to paint replica layers when we are painting the mask layers in CCLayerTreeHost.cpp.

This is useless code, replica layers have drawsContent() == false, and have an empty visibleLayerRect, so the paint functions end up early-outting. But it is a waste of time to try, and confusing to have this attempted in the code at all, since the replica layers are never drawn. They exist only for their transforms.

Also the dimensions used for the mask are different from the surface mask, which is confusing and unnecessary as well. The mask is applied to the same surface contents as the surface mask would be, so only the surface's contentBounds need to be painted in the replica mask.
Comment 2 Dana Jansens 2012-04-09 13:42:03 PDT
Created attachment 136297 [details]
Comment 3 James Robinson 2012-04-09 13:47:02 PDT
Comment on attachment 136297 [details]

Seems like paintMaskAndReplicaForRenderSurface() needs a rename, no?
Comment 4 Dana Jansens 2012-04-09 13:50:45 PDT
Created attachment 136300 [details]

Comment 5 James Robinson 2012-04-09 14:23:21 PDT
Comment on attachment 136300 [details]

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

> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp:531
> +        LayerChromium* maskLayer = replicaLayer->maskLayer();

this shadows the earlier local which is a bit weird (and I wouldn't be surprised if triggered a warning on some pedantic compiler somewhere). Can you:
*) reuse the local
*) pick another name
*) refactor shared code into a helper so we don't have to duplicate this block?
Comment 6 Dana Jansens 2012-04-09 15:10:44 PDT
done, renamed to replicaMaskLayer.
Comment 7 Dana Jansens 2012-04-09 15:10:56 PDT
Created attachment 136313 [details]
Patch for landing
Comment 8 WebKit Review Bot 2012-04-09 20:11:54 PDT
Comment on attachment 136313 [details]
Patch for landing

Clearing flags on attachment: 136313

Committed r113668: <http://trac.webkit.org/changeset/113668>
Comment 9 WebKit Review Bot 2012-04-09 20:11:59 PDT
All reviewed patches have been landed.  Closing bug.