| Index: skia/ext/platform_canvas_linux.h
|
| ===================================================================
|
| --- skia/ext/platform_canvas_linux.h (revision 17496)
|
| +++ skia/ext/platform_canvas_linux.h (working copy)
|
| @@ -78,14 +78,16 @@
|
| explicit CanvasPaintT(GdkEventExpose* event)
|
| : surface_(NULL),
|
| window_(event->window),
|
| - rectangle_(event->area) {
|
| + rectangle_(event->area),
|
| + composite_alpha_(false) {
|
| init(true);
|
| }
|
|
|
| CanvasPaintT(GdkEventExpose* event, bool opaque)
|
| : surface_(NULL),
|
| window_(event->window),
|
| - rectangle_(event->area) {
|
| + rectangle_(event->area),
|
| + composite_alpha_(false) {
|
| init(opaque);
|
| }
|
|
|
| @@ -95,6 +97,8 @@
|
|
|
| // Blit the dirty rect to the window.
|
| 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_rectangle(cr, rectangle_.x, rectangle_.y,
|
| rectangle_.width, rectangle_.height);
|
| @@ -103,6 +107,13 @@
|
| }
|
| }
|
|
|
| + // Sets whether the bitmap is composited in such a way that the alpha channel
|
| + // is honored. This is only useful if you've enabled an RGBA colormap on the
|
| + // widget. The default is false.
|
| + void set_composite_alpha(bool composite_alpha) {
|
| + composite_alpha_ = composite_alpha;
|
| + }
|
| +
|
| // Returns true if the invalid region is empty. The caller should call this
|
| // function to determine if anything needs painting.
|
| bool isEmpty() const {
|
| @@ -130,6 +141,8 @@
|
| cairo_surface_t* surface_;
|
| GdkWindow* window_;
|
| GdkRectangle rectangle_;
|
| + // See description above setter.
|
| + bool composite_alpha_;
|
|
|
| // Disallow copy and assign.
|
| CanvasPaintT(const CanvasPaintT&);
|
|
|