summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-08 19:03:16 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-08 19:03:16 +0000
commitcdc10137284e3750b2a306ebd941430d2dfd3bce (patch)
tree6b525caa7aeec4c540a1d34f0ae4ccedc49d3f04
parentb8c24a6a6c2a30775b27d0089cb274e768a1c778 (diff)
downloadchromium_src-cdc10137284e3750b2a306ebd941430d2dfd3bce.zip
chromium_src-cdc10137284e3750b2a306ebd941430d2dfd3bce.tar.gz
chromium_src-cdc10137284e3750b2a306ebd941430d2dfd3bce.tar.bz2
Linux: Flush cairo surface at end of CanvasPaintLinux.
I also added some cairo_surface_flush calls for good measure, mostly to match the GIMP patch, but I don't really have any way of testing whether these are necessary. BUG=47064 TEST=manual (see bug) - throbber, download icons, etc. should be fixed Review URL: http://codereview.chromium.org/2802034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51871 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc2
-rw-r--r--skia/ext/bitmap_platform_device_linux.cc8
-rw-r--r--skia/ext/canvas_paint_linux.h4
3 files changed, 5 insertions, 9 deletions
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index 9fa30d1..8847957 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -869,6 +869,7 @@ bool WebPluginDelegateProxy::BackgroundChanged(
int bytes_per_pixel = CGBitmapContextGetBitsPerPixel(context) / 8;
#else
+ cairo_surface_flush(page_surface);
const unsigned char* page_bytes = cairo_image_surface_get_data(page_surface);
int page_stride = cairo_image_surface_get_stride(page_surface);
int page_start_x = static_cast<int>(page_x_double);
@@ -879,6 +880,7 @@ bool WebPluginDelegateProxy::BackgroundChanged(
cairo_surface_t* bg_surface = cairo_get_target(device.beginPlatformPaint());
DCHECK_EQ(cairo_surface_get_type(bg_surface), CAIRO_SURFACE_TYPE_IMAGE);
DCHECK_EQ(cairo_image_surface_get_format(bg_surface), CAIRO_FORMAT_ARGB32);
+ cairo_surface_flush(bg_surface);
const unsigned char* bg_bytes = cairo_image_surface_get_data(bg_surface);
int full_bg_width = cairo_image_surface_get_width(bg_surface);
int full_bg_height = cairo_image_surface_get_height(bg_surface);
diff --git a/skia/ext/bitmap_platform_device_linux.cc b/skia/ext/bitmap_platform_device_linux.cc
index ccd8d27..f170273 100644
--- a/skia/ext/bitmap_platform_device_linux.cc
+++ b/skia/ext/bitmap_platform_device_linux.cc
@@ -47,7 +47,6 @@ class BitmapPlatformDevice::BitmapPlatformDeviceData
explicit BitmapPlatformDeviceData(cairo_surface_t* surface);
cairo_t* GetContext();
- cairo_surface_t* GetSurface();
// Sets the transform and clip operations. This will not update the Cairo
// surface, but will mark the config as dirty. The next call of LoadConfig
@@ -110,13 +109,6 @@ void BitmapPlatformDevice::BitmapPlatformDeviceData::SetMatrixClip(
config_dirty_ = true;
}
-cairo_surface_t*
-BitmapPlatformDevice::BitmapPlatformDeviceData::GetSurface() {
- // TODO(brettw) this function should be removed.
- LoadConfig();
- return surface_;
-}
-
void BitmapPlatformDevice::BitmapPlatformDeviceData::LoadConfig() {
if (!config_dirty_ || !context_)
return; // Nothing to do.
diff --git a/skia/ext/canvas_paint_linux.h b/skia/ext/canvas_paint_linux.h
index af43141..d2dc776 100644
--- a/skia/ext/canvas_paint_linux.h
+++ b/skia/ext/canvas_paint_linux.h
@@ -49,6 +49,8 @@ class CanvasPaintT : public T {
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_surface_t* source_surface = cairo_get_target(context_);
CHECK(source_surface);
+ // Flush cairo's cache of the surface.
+ cairo_surface_mark_dirty(source_surface);
GdkRectangle bounds = rectangle();
cairo_set_source_surface(cr, source_surface, bounds.x, bounds.y);
gdk_cairo_region(cr, region_);
@@ -83,7 +85,7 @@ class CanvasPaintT : public T {
GdkRectangle bounds = rectangle();
if (!T::initialize(bounds.width, bounds.height, opaque, NULL)) {
// Cause a deliberate crash;
- *(char*) 0 = 0;
+ CHECK(false);
}
// Need to translate so that the dirty region appears at the origin of the