From 10a4a0aa5e9a1754752454ee2d4d8aff872a61a3 Mon Sep 17 00:00:00 2001 From: "vandebo@chromium.org" Date: Wed, 15 Dec 2010 22:14:06 +0000 Subject: Flush the cairo surface before we try to write to it. Newer versions of Cairo assert if the surface isn't flushed before it is marked dirty but this should be done anyway to ensure correct layering of draw operations. BUG=65692 TEST=No crash on Maverick (Ubuntu 10.10) Review URL: http://codereview.chromium.org/5737004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69334 0039d316-1c4b-4281-b951-d872f2087c98 --- skia/ext/bitmap_platform_device_linux.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/skia/ext/bitmap_platform_device_linux.cc b/skia/ext/bitmap_platform_device_linux.cc index 60feb45..034d6bd 100644 --- a/skia/ext/bitmap_platform_device_linux.cc +++ b/skia/ext/bitmap_platform_device_linux.cc @@ -153,9 +153,12 @@ bool BitmapPlatformDevice::IsVectorial() { cairo_t* BitmapPlatformDevice::beginPlatformPaint() { data_->LoadConfig(); cairo_t* cairo = data_->bitmap_context(); - // Tell Cairo that we've (probably) modified its pixel buffer without - // its knowledge. - cairo_surface_mark_dirty(cairo_get_target(cairo)); + cairo_surface_t* surface = cairo_get_target(cairo); + // Tell cairo to flush anything it has pending. + cairo_surface_flush(surface); + // Tell Cairo that we (probably) modified (actually, will modify) its pixel + // buffer directly. + cairo_surface_mark_dirty(surface); return cairo; } -- cgit v1.1