Make the Silverlight CAOpenGLLayer opaque if we know the plug-in contents is opaque...
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Aug 2012 20:33:21 +0000 (20:33 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Aug 2012 20:33:21 +0000 (20:33 +0000)
commita8c5547275f7f773d2e01d8e0791d7e1a10a1243
treea7644ae7d0ee5113a6eecb69e3d9d3a971017c22
parent11d2884e268d27081f32aba317a3d2c4086334b5
Make the Silverlight CAOpenGLLayer opaque if we know the plug-in contents is opaque to reduce blending
https://bugs.webkit.org/show_bug.cgi?id=93508
<rdar://problem/12056765>

Reviewed by Simon Fraser.

* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::NetscapePluginModule::determineQuirks):
* Shared/Plugins/PluginQuirks.h:
Rename the MakeTransparentIfBackgroundAttributeExists quirk to MakeOpaqueUnlessTransparentSilverlightBackgroundAttributeExists
since we'll explicitly check for opaque background colors (at least one opaque background color for now), instead of just making the
plug-in transparent whenever there's a background specified.

* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::isTransparentSilverlightBackgroundValue):
Helper function for determining if a background value is transparent. Just check for opaque black now and treat everything else as transparent.

(WebKit::NetscapePlugin::initialize):
Call isTransparentSilverlightBackgroundValue.

* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::makeCGLPresentLayerOpaque):
Helper function for grabbing the CGLPresentLayer from the layer hierarchy and setting it to be opaque.

(WebKit::NetscapePlugin::updatePluginLayer):
Call makeCGLPresentLayerOpaque if the plug-in has the MakeOpaqueUnlessTransparentSilverlightBackgroundAttributeExists quirk and
the plug-in is not transparent.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
Source/WebKit2/Shared/Plugins/PluginQuirks.h
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm