diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-17 20:39:38 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-17 20:39:38 +0000 |
commit | 777f996eab1610f9676ee62ee478cc97687c56cd (patch) | |
tree | 0b5df00b507bf0d0de8ba292541d7b0987f7f3ab /webkit | |
parent | 6e9f27f9b6839b7a07e44a6299bfa48579fe5ba2 (diff) | |
download | chromium_src-777f996eab1610f9676ee62ee478cc97687c56cd.zip chromium_src-777f996eab1610f9676ee62ee478cc97687c56cd.tar.gz chromium_src-777f996eab1610f9676ee62ee478cc97687c56cd.tar.bz2 |
Reverting 20516 by re-landing this previous patch.
Keep the cairo clipping region in sync with the Skia one.
The PlatformCanvas now tracks this, so we don't need to have the similar code
in gfx::Canvas. I moved most references of cairo_surface_t to cairo_t since the
cairo_t has a transform and clip but the surface does not.
Review URL: http://codereview.chromium.org/149409
Review URL: http://codereview.chromium.org/155700
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20992 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_gtk.cc | 20 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_gtk.cc | 7 |
2 files changed, 13 insertions, 14 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc index de4a60f..7176642 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc @@ -174,13 +174,13 @@ void WebPluginDelegateImpl::UpdateGeometry( } } -void WebPluginDelegateImpl::Paint(cairo_surface_t* context, +void WebPluginDelegateImpl::Paint(cairo_t* context, const gfx::Rect& rect) { if (windowless_) WindowlessPaint(context, rect); } -void WebPluginDelegateImpl::Print(cairo_surface_t* context) { +void WebPluginDelegateImpl::Print(cairo_t* context) { NOTIMPLEMENTED(); } @@ -399,7 +399,7 @@ void DrawDebugRectangle(cairo_surface_t* surface, } // namespace #endif -void WebPluginDelegateImpl::WindowlessPaint(cairo_surface_t* context, +void WebPluginDelegateImpl::WindowlessPaint(cairo_t* context, const gfx::Rect& damage_rect) { // Compare to: // http://mxr.mozilla.org/firefox/source/layout/generic/nsObjectFrame.cpp: @@ -526,7 +526,8 @@ void WebPluginDelegateImpl::WindowlessPaint(cairo_surface_t* context, // Copy the current image into the pixmap, so the plugin can draw over // this background. cairo_t* cairo = gdk_cairo_create(pixmap_); - cairo_set_source_surface(cairo, context, offset_x, offset_y); + cairo_set_source_surface(cairo, cairo_get_target(context), + offset_x, offset_y); cairo_rectangle(cairo, draw_rect.x() + offset_x, draw_rect.y() + offset_y, draw_rect.width(), draw_rect.height()); cairo_clip(cairo); @@ -551,13 +552,12 @@ void WebPluginDelegateImpl::WindowlessPaint(cairo_surface_t* context, DCHECK_EQ(err, NPERR_NO_ERROR); // Now copy the rendered image pixmap back into the drawing buffer. - cairo = cairo_create(context); - gdk_cairo_set_source_pixmap(cairo, pixmap_, -offset_x, -offset_y); - cairo_rectangle(cairo, draw_rect.x(), draw_rect.y(), + gdk_cairo_set_source_pixmap(context, pixmap_, -offset_x, -offset_y); + cairo_rectangle(context, draw_rect.x(), draw_rect.y(), draw_rect.width(), draw_rect.height()); - cairo_clip(cairo); - cairo_paint(cairo); - cairo_destroy(cairo); + cairo_clip(context); + cairo_paint(context); + cairo_destroy(context); #ifdef DEBUG_RECTANGLES // Draw some debugging rectangles. diff --git a/webkit/tools/test_shell/webwidget_host_gtk.cc b/webkit/tools/test_shell/webwidget_host_gtk.cc index 432f661..46b72e3 100644 --- a/webkit/tools/test_shell/webwidget_host_gtk.cc +++ b/webkit/tools/test_shell/webwidget_host_gtk.cc @@ -357,11 +357,10 @@ void WebWidgetHost::Paint() { gdk_window_begin_paint_rect(window, &grect); // BitBlit to the gdk window. - skia::PlatformDevice& platdev = canvas_->getTopPlatformDevice(); - skia::BitmapPlatformDevice* const bitdev = - static_cast<skia::BitmapPlatformDevice*>(&platdev); + cairo_t* source_surface = canvas_->beginPlatformPaint(); cairo_t* cairo_drawable = gdk_cairo_create(window); - cairo_set_source_surface(cairo_drawable, bitdev->surface(), 0, 0); + cairo_set_source_surface(cairo_drawable, cairo_get_target(source_surface), + 0, 0); cairo_paint(cairo_drawable); cairo_destroy(cairo_drawable); |