From b2edf0a95849836ab55c65a3fe0ed89a0e4616ea Mon Sep 17 00:00:00 2001 From: "deanm@chromium.org" Date: Thu, 23 Apr 2009 10:29:04 +0000 Subject: Fix the ChromeCanvasPaint Linux code. My previous checkin was wrong, because the backing bitmap was just the damaged rect, not the entire window. Since the translation will be ignored for the cairo surface, allocate from the origin to the edge of the damage rect. Patch from Vincent Zanotti. Review URL: http://codereview.chromium.org/62149 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14296 0039d316-1c4b-4281-b951-d872f2087c98 --- skia/ext/platform_canvas_linux.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'skia') diff --git a/skia/ext/platform_canvas_linux.h b/skia/ext/platform_canvas_linux.h index 7981f57..686ad0a 100644 --- a/skia/ext/platform_canvas_linux.h +++ b/skia/ext/platform_canvas_linux.h @@ -115,7 +115,12 @@ class CanvasPaintT : public T { private: void init(bool opaque) { - if (!T::initialize(rectangle_.width, rectangle_.height, opaque, NULL)) { + // In order to be most optimal, we could allocate just the damaged rect and + // set a translation so it's at the origin. However, since that would be + // ignored when we draw on the cairo surface, this currently won't work. + // Allocate the minimal bitmap from the origin to damage rect. + if (!T::initialize(rectangle_.x + rectangle_.width, + rectangle_.y + rectangle_.height, opaque, NULL)) { // Cause a deliberate crash; *(char*) 0 = 0; } -- cgit v1.1