summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-12 18:34:15 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-12 18:34:15 +0000
commitb9ae5690d326fd0211b12b584944dcebce5fd236 (patch)
tree6313901133d1f09e7cad5354ed4be91ea865f321 /chrome/plugin
parentcbc0e1b7a534df83db009edef7843d029f307ff9 (diff)
downloadchromium_src-b9ae5690d326fd0211b12b584944dcebce5fd236.zip
chromium_src-b9ae5690d326fd0211b12b584944dcebce5fd236.tar.gz
chromium_src-b9ae5690d326fd0211b12b584944dcebce5fd236.tar.bz2
Remove the use of the background transport for transparent Mac plugins.
Since CG preserves alpha, and plugins don't composite onto pages manually, we don't need the extra buffer on the Mac. BUG=41194 TEST=Transparent plugins (mostly Flash) should continue to work normally. Review URL: http://codereview.chromium.org/1549035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44265 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/webplugin_proxy.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 273cd95..ac04589 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -366,11 +366,7 @@ void WebPluginProxy::Paint(const gfx::Rect& rect) {
// sense, so this should only be used for pointer comparisons.
CGContextRef saved_context_weak = windowless_context_.get();
- if (!background_context_.get()) {
- CGContextSetFillColorWithColor(windowless_context_,
- CGColorGetConstantColor(kCGColorBlack));
- CGContextFillRect(windowless_context_, rect.ToCGRect());
- } else {
+ if (background_context_.get()) {
scoped_cftyperef<CGImageRef> image(
CGBitmapContextCreateImage(background_context_));
CGRect source_rect = rect.ToCGRect();
@@ -379,6 +375,8 @@ void WebPluginProxy::Paint(const gfx::Rect& rect) {
scoped_cftyperef<CGImageRef> sub_image(
CGImageCreateWithImageInRect(image, source_rect));
CGContextDrawImage(windowless_context_, rect.ToCGRect(), sub_image);
+ } else {
+ CGContextClearRect(windowless_context_, rect.ToCGRect());
}
CGContextClipToRect(windowless_context_, rect.ToCGRect());
delegate_->Paint(windowless_context_, rect);