summaryrefslogtreecommitdiffstats
path: root/chrome/plugin/webplugin_proxy.cc
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-24 20:35:28 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-24 20:35:28 +0000
commitc9e8ab9fa9097f33c892e6d806729ec35586bfe1 (patch)
tree280ced941be30dd03106b673c91e557e5c5f16dc /chrome/plugin/webplugin_proxy.cc
parent43e29a8583ae1f4696f0bfa58f3d256f5ac36759 (diff)
downloadchromium_src-c9e8ab9fa9097f33c892e6d806729ec35586bfe1.zip
chromium_src-c9e8ab9fa9097f33c892e6d806729ec35586bfe1.tar.gz
chromium_src-c9e8ab9fa9097f33c892e6d806729ec35586bfe1.tar.bz2
Refactor blits to be more cross-platform.
Review URL: http://codereview.chromium.org/159190 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21565 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin/webplugin_proxy.cc')
-rw-r--r--chrome/plugin/webplugin_proxy.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 3d34674..38cd306f 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -8,6 +8,7 @@
#if defined(OS_WIN)
#include "app/win_util.h"
#endif
+#include "base/gfx/blit.h"
#include "base/scoped_handle.h"
#include "base/shared_memory.h"
#include "base/singleton.h"
@@ -426,17 +427,15 @@ void WebPluginProxy::Paint(const gfx::Rect& rect) {
delegate_->Paint(windowless_context_, rect);
CGContextRestoreGState(windowless_context_);
#else
+ if (background_canvas_.get()) {
+ BlitCanvasToCanvas(windowless_canvas_.get(), rect,
+ background_canvas_.get(), rect.origin());
+ }
cairo_t* cairo =
windowless_canvas_->getTopPlatformDevice().beginPlatformPaint();
cairo_save(cairo);
cairo_rectangle(cairo, rect.x(), rect.y(), rect.width(), rect.height());
cairo_clip(cairo);
- if (background_canvas_.get()) {
- cairo_t *background =
- background_canvas_->getTopPlatformDevice().beginPlatformPaint();
- cairo_set_source_surface(cairo, cairo_get_target(background), 0, 0);
- cairo_paint(cairo);
- }
cairo_translate(cairo, -delegate_->GetRect().x(), -delegate_->GetRect().y());
delegate_->Paint(cairo, offset_rect);
cairo_restore(cairo);