Bug 83504 - [chromium] Replica layers are not drawn, so should not be painted
Summary: [chromium] Replica layers are not drawn, so should not be painted
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-04-09 13:32 PDT by Dana Jansens
Modified: 2012-04-09 20:11 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.46 KB, patch)
2012-04-09 13:42 PDT, Dana Jansens
no flags Details | Formatted Diff | Diff
Patch (5.28 KB, patch)
2012-04-09 13:50 PDT, Dana Jansens
no flags Details | Formatted Diff | Diff
Patch for landing (5.36 KB, patch)
2012-04-09 15:10 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-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]
Patch
Comment 3 James Robinson 2012-04-09 13:47:02 PDT
Comment on attachment 136297 [details]
Patch

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

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

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.