summaryrefslogtreecommitdiffstats
path: root/skia/ext
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-23 10:29:04 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-23 10:29:04 +0000
commitb2edf0a95849836ab55c65a3fe0ed89a0e4616ea (patch)
treea011add6b6f1ce49fcd95878fb0ae236bbfd9640 /skia/ext
parent34e3abaf9e28c7ad5bbe9d071c10259fef7a87ca (diff)
downloadchromium_src-b2edf0a95849836ab55c65a3fe0ed89a0e4616ea.zip
chromium_src-b2edf0a95849836ab55c65a3fe0ed89a0e4616ea.tar.gz
chromium_src-b2edf0a95849836ab55c65a3fe0ed89a0e4616ea.tar.bz2
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
Diffstat (limited to 'skia/ext')
-rw-r--r--skia/ext/platform_canvas_linux.h7
1 files changed, 6 insertions, 1 deletions
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;
}