Bug 114412 - Add platform support for -webkit-background-blend-mode to CG context with background color
Summary: Add platform support for -webkit-background-blend-mode to CG context with bac...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 108546
  Show dependency treegraph
 
Reported: 2013-04-10 23:04 PDT by Mihai Tica
Modified: 2013-04-23 17:52 PDT (History)
5 users (show)

See Also:


Attachments
Patch (11.76 KB, patch)
2013-04-10 23:22 PDT, Mihai Tica
no flags Details | Formatted Diff | Diff
Patch (11.89 KB, patch)
2013-04-11 10:53 PDT, Mihai Tica
no flags Details | Formatted Diff | Diff
Patch (16.79 KB, patch)
2013-04-12 00:02 PDT, Mihai Tica
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mihai Tica 2013-04-10 23:04:35 PDT
CoreGraphics should also support -webkit-background-blend-mode for background colors.
The current implementation only supports background image blending: https://bugs.webkit.org/show_bug.cgi?id=108549
Comment 1 Mihai Tica 2013-04-10 23:22:38 PDT
Created attachment 197510 [details]
Patch
Comment 2 Mihai Tica 2013-04-11 10:53:09 PDT
Created attachment 197641 [details]
Patch
Comment 3 Darin Adler 2013-04-11 10:59:02 PDT
Comment on attachment 197641 [details]
Patch

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

Is there measurable performance impact for the code paths that now do extra work for non-blend cases? I’m guessing no.

What does this do for graphics back ends other than CG?

> Source/WebCore/ChangeLog:16
> +        (GraphicsContext):

Would be nice to remove this bogus change log line and/or fix the script that added it.

> LayoutTests/css3/compositing/effect-background-blend-mode-color.html:5
> +  if (window.testRunner) {
> +    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "1");
> +  }

Extra braces not needed here. Why test only in this mode? Don’t we want to test both modes?
Comment 4 Mihai Tica 2013-04-12 00:02:45 PDT
Created attachment 197724 [details]
Patch
Comment 5 Mihai Tica 2013-04-12 00:05:37 PDT
Thanks for the review,

(In reply to comment #3)
> (From update of attachment 197641 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=197641&action=review
> 
> Is there measurable performance impact for the code paths that now do extra work for non-blend cases? I’m guessing no.
For non-blend cases, |fillRect| already calls the |setCompositeOperation| method with |BlendModeNormal| and this patch preserves this behaviour, so I'm guessing there shouldn't be a performance impact.
> 
> What does this do for graphics back ends other than CG?
These changes eventually imply calling the |setPlatformCompositeOperation| with the appropriate blend mode; for other graphics back ends, it doesn't have any effect yet, I'll add appropriate bugs for each of them, good point.
> 
> > Source/WebCore/ChangeLog:16
> > +        (GraphicsContext):
> 

> Would be nice to remove this bogus change log line and/or fix the script that added it.
Agree.
> 
> > LayoutTests/css3/compositing/effect-background-blend-mode-color.html:5
> > +  if (window.testRunner) {
> > +    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "1");
> > +  }
> 
> Extra braces not needed here. Why test only in this mode? Don’t we want to test both modes?
Agreed, we should test both modes, I've added another test file with accelerated compositing disabled.

Also, could you please commit this when you have some time? Thanks
Comment 6 Dean Jackson 2013-04-23 12:16:30 PDT
Comment on attachment 197724 [details]
Patch

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

> LayoutTests/css3/compositing/effect-background-blend-mode-color.html:7
> +  if (window.testRunner)
> +    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "1");
> +
> +  if (window.testRunner)
> +    window.testRunner.dumpAsText(true);

Make this one conditional statement.

> LayoutTests/css3/compositing/effect-background-blend-mode-color2.html:7
> +  if (window.testRunner)
> +    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
> +
> +  if (window.testRunner)
> +    window.testRunner.dumpAsText(true);

Same here.
Comment 7 WebKit Commit Bot 2013-04-23 17:52:37 PDT
Comment on attachment 197724 [details]
Patch

Clearing flags on attachment: 197724

Committed r149010: <http://trac.webkit.org/changeset/149010>
Comment 8 WebKit Commit Bot 2013-04-23 17:52:40 PDT
All reviewed patches have been landed.  Closing bug.