Bug 104842 - Disambiguate "background color" and "contents as solid color" on GraphicsLayer
Summary: Disambiguate "background color" and "contents as solid color" on GraphicsLayer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks: 104942
  Show dependency treegraph
 
Reported: 2012-12-12 14:14 PST by Simon Fraser (smfr)
Modified: 2012-12-17 00:09 PST (History)
18 users (show)

See Also:


Attachments
Patch (15.58 KB, patch)
2012-12-12 14:36 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Apply changes to TextureMapper / coordinated graphics (10.48 KB, patch)
2012-12-12 16:39 PST, Noam Rosenthal
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
Texmap/chromium (11.31 KB, patch)
2012-12-12 17:43 PST, Noam Rosenthal
no flags Details | Formatted Diff | Diff
Test rebaseline (68.92 KB, patch)
2012-12-12 17:43 PST, Noam Rosenthal
no flags Details | Formatted Diff | Diff
Patch (just needs review on the GraphicsLayer/GraphicsLayerCA parts) (96.12 KB, patch)
2012-12-13 17:16 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (101.16 KB, patch)
2012-12-13 18:30 PST, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (101.16 KB, patch)
2012-12-14 14:01 PST, Simon Fraser (smfr)
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2012-12-12 14:14:37 PST
GraphicsLayer is confused about background color, vs setting the contents to a solid color. This is causing some bugs and test failures.
Comment 1 Simon Fraser (smfr) 2012-12-12 14:36:02 PST
Created attachment 179128 [details]
Patch
Comment 2 Simon Fraser (smfr) 2012-12-12 14:36:30 PST
Comment on attachment 179128 [details]
Patch

Not ready for review yet. Noam is going to fix other ports and update test results.
Comment 3 Noam Rosenthal 2012-12-12 16:39:10 PST
Created attachment 179148 [details]
Apply changes to TextureMapper / coordinated graphics
Comment 4 Noam Rosenthal 2012-12-12 16:42:19 PST
(In reply to comment #2)
> (From update of attachment 179128 [details])
> Not ready for review yet. Noam is going to fix other ports and update test results.

I think we can review the patches and then commit when we have all of them.
Comment 5 Early Warning System Bot 2012-12-12 16:52:17 PST
Comment on attachment 179148 [details]
Apply changes to TextureMapper / coordinated graphics

Attachment 179148 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/15311018
Comment 6 Early Warning System Bot 2012-12-12 16:58:03 PST
Comment on attachment 179128 [details]
Patch

Attachment 179128 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/15312033
Comment 7 WebKit Review Bot 2012-12-12 17:21:37 PST
Comment on attachment 179128 [details]
Patch

Attachment 179128 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15316027
Comment 8 Noam Rosenthal 2012-12-12 17:43:12 PST
Created attachment 179161 [details]
Texmap/chromium
Comment 9 Noam Rosenthal 2012-12-12 17:43:30 PST
Created attachment 179162 [details]
Test rebaseline
Comment 10 Early Warning System Bot 2012-12-12 17:49:03 PST
Comment on attachment 179161 [details]
Texmap/chromium

Attachment 179161 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/15319021
Comment 11 Peter Beverloo (cr-android ews) 2012-12-12 17:50:55 PST
Comment on attachment 179128 [details]
Patch

Attachment 179128 [details] did not pass cr-android-ews (chromium-android):
Output: http://queues.webkit.org/results/15318030
Comment 12 Simon Fraser (smfr) 2012-12-12 18:18:59 PST
Comment on attachment 179162 [details]
Test rebaseline

Can you also remove some Chromium-specific results now?
Comment 13 Noam Rosenthal 2012-12-12 18:41:28 PST
(In reply to comment #12)
> (From update of attachment 179162 [details])
> Can you also remove some Chromium-specific results now?

no, because those test return drawsContents for chromium.
Comment 14 Darin Adler 2012-12-12 19:21:25 PST
Comment on attachment 179161 [details]
Texmap/chromium

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

> Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp:814
> -    if (m_backgroundColorSet)
> +    if (m_backgroundColor.isValid())
>          contentsLayer->setBackgroundColor(m_backgroundColor.rgb());
>      else
>          contentsLayer->setBackgroundColor(static_cast<RGBA32>(0));

This if statement isn’t needed. When you call Color::rgb() on an invalid color, you get 0, so we can just let it do its thing.

> Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:354
> -void GraphicsLayerTextureMapper::setContentsToBackgroundColor(const Color& color)
> +void GraphicsLayerTextureMapper::setContentsToSolidColor(const Color& color)

Does solid color mean a color with no alpha? If so, should this assert the color has a fully opaque alpha?

> Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:365
> -void CoordinatedGraphicsLayer::setContentsToBackgroundColor(const Color& color)
> +void CoordinatedGraphicsLayer::setContentsToSolidColor(const Color& color)

Does solid color mean a color with no alpha? If so, should this assert the color has a fully opaque alpha?
Comment 15 EFL EWS Bot 2012-12-12 19:53:46 PST
Comment on attachment 179128 [details]
Patch

Attachment 179128 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/15321059
Comment 16 EFL EWS Bot 2012-12-12 20:04:10 PST
Comment on attachment 179161 [details]
Texmap/chromium

Attachment 179161 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/15319088
Comment 17 Build Bot 2012-12-12 20:05:20 PST
Comment on attachment 179162 [details]
Test rebaseline

Attachment 179162 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15318076

New failing tests:
compositing/iframes/invisible-nested-iframe-hide.html
compositing/geometry/clip.html
compositing/layer-creation/fixed-position-and-transform.html
compositing/iframes/iframe-resize.html
compositing/geometry/bounds-ignores-hidden-composited-descendant.html
compositing/iframes/connect-compositing-iframe-delayed.html
compositing/iframes/connect-compositing-iframe2.html
compositing/columns/composited-in-paginated.html
compositing/geometry/fixed-position-composited-switch.html
compositing/iframes/become-overlapped-iframe.html
compositing/geometry/composited-in-columns.html
compositing/iframes/connect-compositing-iframe3.html
compositing/geometry/layer-due-to-layer-children-deep-switch.html
compositing/tiled-layers-hidpi.html
compositing/iframes/enter-compositing-iframe.html
compositing/geometry/ancestor-overflow-change.html
compositing/geometry/clip-inside.html
compositing/geometry/bounds-ignores-hidden-dynamic-negzindex.html
compositing/iframes/connect-compositing-iframe.html
compositing/iframes/become-composited-nested-iframes.html
compositing/iframes/composited-parent-iframe.html
compositing/iframes/invisible-nested-iframe-show.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
compositing/layer-creation/animation-overlap-with-children.html
Comment 18 Simon Fraser (smfr) 2012-12-12 20:43:00 PST
(In reply to comment #14)
> > Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:354
> > -void GraphicsLayerTextureMapper::setContentsToBackgroundColor(const Color& color)
> > +void GraphicsLayerTextureMapper::setContentsToSolidColor(const Color& color)
> 
> Does solid color mean a color with no alpha? If so, should this assert the color has a fully opaque alpha?
> 
> > Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:365
> > -void CoordinatedGraphicsLayer::setContentsToBackgroundColor(const Color& color)
> > +void CoordinatedGraphicsLayer::setContentsToSolidColor(const Color& color)
> 
> Does solid color mean a color with no alpha? If so, should this assert the color has a fully opaque alpha?

I pondered on the "solid color" terminology too. It means "a uniform color"; we use it in the same way in Image::isSolidColor(), which just says whether the all the pixels in the image have the same color (which may include alpha).
Comment 19 Build Bot 2012-12-12 20:49:55 PST
Comment on attachment 179128 [details]
Patch

Attachment 179128 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15316106

New failing tests:
compositing/iframes/invisible-nested-iframe-hide.html
compositing/geometry/clip.html
compositing/layer-creation/fixed-position-and-transform.html
compositing/iframes/iframe-resize.html
compositing/geometry/bounds-ignores-hidden-composited-descendant.html
compositing/iframes/connect-compositing-iframe-delayed.html
compositing/iframes/connect-compositing-iframe2.html
compositing/columns/composited-in-paginated.html
compositing/geometry/fixed-position-composited-switch.html
compositing/layer-creation/no-compositing-for-preserve-3d.html
compositing/iframes/become-overlapped-iframe.html
compositing/geometry/composited-in-columns.html
compositing/layer-creation/fixed-position-under-transform.html
compositing/iframes/connect-compositing-iframe3.html
compositing/tiled-layers-hidpi.html
compositing/iframes/enter-compositing-iframe.html
compositing/geometry/ancestor-overflow-change.html
compositing/geometry/clip-inside.html
compositing/geometry/bounds-ignores-hidden-dynamic-negzindex.html
compositing/iframes/connect-compositing-iframe.html
compositing/iframes/become-composited-nested-iframes.html
compositing/layer-creation/overflow-scroll-overlap.html
compositing/iframes/composited-parent-iframe.html
compositing/iframes/invisible-nested-iframe-show.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
compositing/layer-creation/animation-overlap-with-children.html
Comment 20 Noam Rosenthal 2012-12-13 17:11:04 PST
Those patches fail on EWS because they need to be committed as one block...
Simon, once you want your patch reviewed I can upload them together as a batch for EWS, and at that point I can also remove the unnecessary comments as Darin suggested.
Comment 21 Simon Fraser (smfr) 2012-12-13 17:11:51 PST
I am making one big patch right now.
Comment 22 Simon Fraser (smfr) 2012-12-13 17:16:26 PST
Created attachment 179383 [details]
Patch (just needs review on the GraphicsLayer/GraphicsLayerCA parts)
Comment 23 WebKit Review Bot 2012-12-13 18:04:19 PST
Comment on attachment 179383 [details]
Patch (just needs review on the GraphicsLayer/GraphicsLayerCA parts)

Attachment 179383 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15312491
Comment 24 Peter Beverloo (cr-android ews) 2012-12-13 18:19:21 PST
Comment on attachment 179383 [details]
Patch (just needs review on the GraphicsLayer/GraphicsLayerCA parts)

Attachment 179383 [details] did not pass cr-android-ews (chromium-android):
Output: http://queues.webkit.org/results/15322446
Comment 25 Simon Fraser (smfr) 2012-12-13 18:30:31 PST
Created attachment 179395 [details]
Patch
Comment 26 Peter Beverloo (cr-android ews) 2012-12-13 18:46:44 PST
Comment on attachment 179395 [details]
Patch

Attachment 179395 [details] did not pass cr-android-ews (chromium-android):
Output: http://queues.webkit.org/results/15320465
Comment 27 WebKit Review Bot 2012-12-13 18:49:53 PST
Comment on attachment 179395 [details]
Patch

Attachment 179395 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15310543
Comment 28 Simon Fraser (smfr) 2012-12-14 14:01:02 PST
Created attachment 179529 [details]
Patch
Comment 29 Dean Jackson 2012-12-14 14:14:47 PST
Comment on attachment 179529 [details]
Patch

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

> Source/WebCore/ChangeLog:23
> +2012-12-13  No'am Rosenthal  <noam.rosenthal@nokia.com>
> +
> +        Disambiguate "background color" and "contents as solid color" on GraphicsLayer
> +        https://bugs.webkit.org/show_bug.cgi?id=104842
> +
> +        Reviewed by Simon Fraser.
> +
> +        Rename overloads in GraphicsLayerTextureMapper and GraphicsLayerChromium to account for the rename in GraphicsLayer.
> +
> +        Covered by existing tests.
> +
> +        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
> +        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
> +        (WebCore::GraphicsLayerTextureMapper::setContentsToSolidColor):
> +        * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
> +        (GraphicsLayerTextureMapper):
> +        (WebCore::GraphicsLayerTextureMapper::solidColor):
> +        * platform/graphics/texmap/TextureMapperLayer.cpp:
> +        (WebCore::TextureMapperLayer::paintSelf):
> +        (WebCore::TextureMapperLayer::flushCompositingStateSelf):
> +        * platform/graphics/texmap/TextureMapperLayer.h:
> +        (State):
> +

This confused me, but I understand now.
Comment 30 Simon Fraser (smfr) 2012-12-15 11:13:08 PST
http://trac.webkit.org/changeset/137798
Comment 31 Chris Dumez 2012-12-16 06:55:41 PST
FYI, I rebaselined several compositing test cases due to this commit:
http://trac.webkit.org/changeset/137837
Comment 32 Csaba Osztrogonác 2012-12-17 00:09:29 PST
And Qt rebaselines landed in https://trac.webkit.org/changeset/137882