diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-13 17:06:53 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-13 17:06:53 +0000 |
commit | 7f1fe3fad451d8809d94b19fca516a2a2134e38c (patch) | |
tree | 6954e9cf8f4bd15293f8088b4f1ae51ffd48b5bb /skia/ext/canvas_paint_linux.h | |
parent | 44df75248693160a9e677690f0a51e9ba3ce3b32 (diff) | |
download | chromium_src-7f1fe3fad451d8809d94b19fca516a2a2134e38c.zip chromium_src-7f1fe3fad451d8809d94b19fca516a2a2134e38c.tar.gz chromium_src-7f1fe3fad451d8809d94b19fca516a2a2134e38c.tar.bz2 |
Keep the cairo clipping region in sync with the Skia one.
The PlatformCanvas now tracks this, so we don't need to have the similar code
in gfx::Canvas. I moved most references of cairo_surface_t to cairo_t since the
cairo_t has a transform and clip but the surface does not.
Review URL: http://codereview.chromium.org/149409
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20499 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/canvas_paint_linux.h')
-rw-r--r-- | skia/ext/canvas_paint_linux.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/skia/ext/canvas_paint_linux.h b/skia/ext/canvas_paint_linux.h index 361254b..abb6ada 100644 --- a/skia/ext/canvas_paint_linux.h +++ b/skia/ext/canvas_paint_linux.h @@ -21,7 +21,7 @@ class CanvasPaintT : public T { public:
// This constructor assumes the result is opaque.
explicit CanvasPaintT(GdkEventExpose* event)
- : surface_(NULL),
+ : context_(NULL),
window_(event->window),
rectangle_(event->area),
composite_alpha_(false) {
@@ -29,7 +29,7 @@ class CanvasPaintT : public T { }
CanvasPaintT(GdkEventExpose* event, bool opaque)
- : surface_(NULL),
+ : context_(NULL),
window_(event->window),
rectangle_(event->area),
composite_alpha_(false) {
@@ -44,7 +44,8 @@ class CanvasPaintT : public T { cairo_t* cr = gdk_cairo_create(window_);
if (composite_alpha_)
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
- cairo_set_source_surface(cr, surface_, rectangle_.x, rectangle_.y);
+ cairo_surface_t* source_surface = cairo_get_target(context_);
+ cairo_set_source_surface(cr, source_surface, rectangle_.x, rectangle_.y);
cairo_rectangle(cr, rectangle_.x, rectangle_.y,
rectangle_.width, rectangle_.height);
cairo_fill(cr);
@@ -80,10 +81,10 @@ class CanvasPaintT : public T { // surface.
T::translate(-SkIntToScalar(rectangle_.x), -SkIntToScalar(rectangle_.y));
- surface_ = T::getTopPlatformDevice().beginPlatformPaint();
+ context_ = T::getTopPlatformDevice().beginPlatformPaint();
}
- cairo_surface_t* surface_;
+ cairo_t* context_;
GdkWindow* window_;
GdkRectangle rectangle_;
// See description above setter.
|