From 3e5b159112cd85d681d7677e291d025721f9db24 Mon Sep 17 00:00:00 2001 From: Nicholas Cameron Date: Tue, 2 Oct 2012 20:14:38 -0400 Subject: [PATCH] Bug 753237 - Implement DrawTargetCairo::Mask(). r=joe --- gfx/2d/DrawTargetCairo.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gfx/2d/DrawTargetCairo.cpp b/gfx/2d/DrawTargetCairo.cpp index 003e5e146c0..01f4e09cff3 100644 --- a/gfx/2d/DrawTargetCairo.cpp +++ b/gfx/2d/DrawTargetCairo.cpp @@ -659,7 +659,15 @@ DrawTargetCairo::Mask(const Pattern &aSource, const DrawOptions &aOptions /* = DrawOptions() */) { AutoPrepareForDrawing prep(this, mContext); - // TODO + + cairo_pattern_t* source = GfxPatternToCairoPattern(aSource, aOptions.mAlpha); + cairo_set_source(mContext, source); + + cairo_pattern_t* mask = GfxPatternToCairoPattern(aMask, aOptions.mAlpha); + cairo_mask(mContext, mask); + + cairo_pattern_destroy(mask); + cairo_pattern_destroy(source); } void