Bug 93508 - Make the Silverlight CAOpenGLLayer opaque if we know the plug-in contents is opaque to reduce blending
Summary: Make the Silverlight CAOpenGLLayer opaque if we know the plug-in contents is ...
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: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-08 12:50 PDT by Anders Carlsson
Modified: 2012-08-08 13:33 PDT (History)
0 users

See Also:


Attachments
Patch (8.03 KB, patch)
2012-08-08 12:54 PDT, Anders Carlsson
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2012-08-08 12:50:20 PDT
Make the Silverlight CAOpenGLLayer opaque if we know the plug-in contents is opaque to reduce blending
Comment 1 Anders Carlsson 2012-08-08 12:54:03 PDT
Created attachment 157273 [details]
Patch
Comment 2 Simon Fraser (smfr) 2012-08-08 13:13:23 PDT
Comment on attachment 157273 [details]
Patch

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

> Source/WebKit2/Shared/Plugins/PluginQuirks.h:48
> +        // NPPVpluginTransparentBool, so we'll always force it unless the plug-in has a "background"
> +        // attribute that specifies a opaque color.
> +        MakeOpaqueUnlessTransparentSilverlightBackgroundAttributeExists,

It might be worth noting in this comment that the docs say "a null value for the Background property of the Silverlight plug-in is interpreted as the named color White.", so no colorValue param means opaque.

> Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp:557
> +    if (backgroundValue == "#000000")
> +        return false;

This is fragile, as it would break if the content changed. Sucks that these aren't CSS colors :(
Comment 3 Anders Carlsson 2012-08-08 13:29:43 PDT
(In reply to comment #2)
> (From update of attachment 157273 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=157273&action=review
> 
> > Source/WebKit2/Shared/Plugins/PluginQuirks.h:48
> > +        // NPPVpluginTransparentBool, so we'll always force it unless the plug-in has a "background"
> > +        // attribute that specifies a opaque color.
> > +        MakeOpaqueUnlessTransparentSilverlightBackgroundAttributeExists,
> 
> It might be worth noting in this comment that the docs say "a null value for the Background property of the Silverlight plug-in is interpreted as the named color White.", so no colorValue param means opaque.
> 

Good idea. Fixed!

> > Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp:557
> > +    if (backgroundValue == "#000000")
> > +        return false;
> 
> This is fragile, as it would break if the content changed. Sucks that these aren't CSS colors :(

I agree. I'll do the more extensive color parsing in a followup patch.

Thanks for the review!
Comment 4 Anders Carlsson 2012-08-08 13:33:30 PDT
Committed r125081: <http://trac.webkit.org/changeset/125081>