summaryrefslogtreecommitdiffstats
path: root/skia/ext
diff options
context:
space:
mode:
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;
}