RESOLVED FIXED 104396
[chromium] Support GraphicsLayer::setContentsToSolidColor
https://bugs.webkit.org/show_bug.cgi?id=104396
Summary [chromium] Support GraphicsLayer::setContentsToSolidColor
Noam Rosenthal
Reported 2012-12-07 13:47:33 PST
After https://bugs.webkit.org/show_bug.cgi?id=103786, background colors are directly composited in WebKit. Chromium compositor still doesn't have support for that. Adding background colors to chromium compositor can help with memory footprint and texture-uploads for certain content.
Attachments
wip, does not work fully (10.71 KB, patch)
2013-01-04 15:37 PST, James Robinson
no flags
Patch (7.81 KB, patch)
2013-02-28 16:28 PST, James Robinson
enne: review+
webkit.review.bot: commit-queue-
James Robinson
Comment 1 2012-12-07 14:09:33 PST
This should be an easy thing to add for whoever's interested - just have to call setBackgroundColor(), make sure the draws content flags are all set up correctly, and test it. No'am - where are the layout tests for this feature?
Noam Rosenthal
Comment 2 2012-12-07 14:21:59 PST
(In reply to comment #1) > This should be an easy thing to add for whoever's interested - just have to call setBackgroundColor(), make sure the draws content flags are all set up correctly, and test it. > > No'am - where are the layout tests for this feature? Ref tests, compositing/background-color.
James Robinson
Comment 3 2013-01-04 15:37:31 PST
Created attachment 181396 [details] wip, does not work fully
James Robinson
Comment 4 2013-02-28 16:28:26 PST
James Robinson
Comment 5 2013-02-28 16:30:47 PST
This patch works fine except: 1.) Edge AA isn't enabled for these layers, so the solid color layers are jaggier than their painted equivalents. Will be fixed soon by https://code.google.com/p/chromium/issues/detail?id=166570 2.) 170-odd tests will need text rebaselines due to layers not having (drawsContent 1) any more
WebKit Review Bot
Comment 6 2013-02-28 17:41:19 PST
Comment on attachment 190837 [details] Patch Attachment 190837 [details] did not pass chromium-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/16819512 New failing tests: compositing/geometry/clip.html compositing/contents-opaque/contents-opaque-background-color.html compositing/geometry/limit-layer-bounds-positioned.html compositing/geometry/bounds-ignores-hidden-composited-descendant.html http/tests/cache/subresource-failover-to-network.html compositing/contents-opaque/contents-opaque-layer-transform.html compositing/geometry/layer-due-to-layer-children-deep.html compositing/geometry/fixed-position-composited-switch.html compositing/geometry/limit-layer-bounds-transformed-overflow.html compositing/iframes/become-overlapped-iframe.html compositing/filters/sw-shadow-overlaps-hw-layer.html compositing/geometry/preserve-3d-switching.html compositing/geometry/limit-layer-bounds-overflow-root.html compositing/filters/sw-layer-overlaps-hw-shadow.html compositing/geometry/limit-layer-bounds-fixed-positioned.html compositing/geometry/layer-due-to-layer-children-deep-switch.html compositing/geometry/ancestor-overflow-change.html compositing/geometry/limit-layer-bounds-positioned-transition.html compositing/geometry/clip-inside.html compositing/geometry/bounds-ignores-hidden-dynamic-negzindex.html compositing/columns/composited-in-paginated.html compositing/iframes/become-composited-nested-iframes.html compositing/contents-opaque/contents-opaque-layer-opacity.html compositing/geometry/limit-layer-bounds-transformed.html compositing/iframes/composited-parent-iframe.html compositing/geometry/flipped-writing-mode.html compositing/overflow-trumps-transform-style.html compositing/backing/no-backing-for-clip.html compositing/backing/no-backing-for-clip-overlap.html compositing/backing/no-backing-for-perspective.html
James Robinson
Comment 7 2013-03-14 17:01:27 PDT
Support for AA for these sorts of layers had landed: https://code.google.com/p/chromium/issues/detail?id=166570. I can sort out how to deal with the text rebaselines if someone reviews this - Enne?
Adrienne Walker
Comment 8 2013-03-15 09:37:06 PDT
Comment on attachment 190837 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=190837&action=review > Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp:528 > + if (color.isValid()) { When can this happen? Is removing the layer entirely the logical equivalent of what happens in the normal path if you have a layer that is nothing but a background-color with an invalid color?
James Robinson
Comment 9 2013-03-18 14:45:52 PDT
(In reply to comment #8) > (From update of attachment 190837 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=190837&action=review > > > Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp:528 > > + if (color.isValid()) { > > When can this happen? Is removing the layer entirely the logical equivalent of what happens in the normal path if you have a layer that is nothing but a background-color with an invalid color? RenderLayerBacking.cpp has this: Color backgroundColor; if (isSimpleContainer) backgroundColor = rendererBackgroundColor(); // An unset (invalid) color will remove the solid color. m_graphicsLayer->setContentsToSolidColor(backgroundColor); so basically passing a non-valid color is a way to remove the solid color layer and go back to the normal path. If isSimpleContainer is true, we'll always get a valid Color here.
Adrienne Walker
Comment 10 2013-03-19 10:06:22 PDT
Comment on attachment 190837 [details] Patch R=me. Thanks for the explanation.
David Reveman
Comment 11 2013-03-19 10:48:47 PDT
Fyi, we probably want to hold off on this until crbug.com/218873 has been solved.
James Robinson
Comment 12 2013-03-19 11:07:12 PDT
(In reply to comment #11) > Fyi, we probably want to hold off on this until crbug.com/218873 has been solved. Will do.
James Robinson
Comment 13 2013-03-25 16:37:05 PDT
Note You need to log in before you can comment on or make changes to this bug.