diff options
Diffstat (limited to 'gfx')
-rw-r--r-- | gfx/canvas.h | 5 | ||||
-rw-r--r-- | gfx/canvas_direct2d.cc | 6 | ||||
-rw-r--r-- | gfx/canvas_direct2d.h | 2 | ||||
-rw-r--r-- | gfx/canvas_skia.cc | 8 | ||||
-rw-r--r-- | gfx/canvas_skia.h | 2 |
5 files changed, 22 insertions, 1 deletions
diff --git a/gfx/canvas.h b/gfx/canvas.h index 077a8a2..c68cdab 100644 --- a/gfx/canvas.h +++ b/gfx/canvas.h @@ -102,6 +102,11 @@ class Canvas { virtual void FillRectInt(const SkColor& color, int x, int y, int w, int h) = 0; + // Fills the specified region with the specified color and mode + virtual void FillRectInt(const SkColor& color, + int x, int y, int w, int h, + SkXfermode::Mode mode) = 0; + // Fills the specified region with the specified brush. virtual void FillRectInt(const gfx::Brush* brush, int x, int y, int w, int h) = 0; diff --git a/gfx/canvas_direct2d.cc b/gfx/canvas_direct2d.cc index 3dfcc851..585659d 100644 --- a/gfx/canvas_direct2d.cc +++ b/gfx/canvas_direct2d.cc @@ -209,6 +209,12 @@ void CanvasDirect2D::FillRectInt(const SkColor& color, rt_->FillRectangle(RectToRectF(x, y, w, h), solid_brush); } +void CanvasDirect2D::FillRectInt(const SkColor& color, + int x, int y, int w, int h, + SkXfermode::Mode mode) { + NOTIMPLEMENTED(); +} + void CanvasDirect2D::FillRectInt(const gfx::Brush* brush, int x, int y, int w, int h) { const Direct2DBrush* d2d_brush = static_cast<const Direct2DBrush*>(brush); diff --git a/gfx/canvas_direct2d.h b/gfx/canvas_direct2d.h index f7f0019..89ea448 100644 --- a/gfx/canvas_direct2d.h +++ b/gfx/canvas_direct2d.h @@ -33,6 +33,8 @@ class CanvasDirect2D : public Canvas { virtual void TranslateInt(int x, int y); virtual void ScaleInt(int x, int y); virtual void FillRectInt(const SkColor& color, int x, int y, int w, int h); + virtual void FillRectInt(const SkColor& color, int x, int y, int w, int h, + SkXfermode::Mode mode); virtual void FillRectInt(const gfx::Brush* brush, int x, int y, int w, int h); virtual void DrawRectInt(const SkColor& color, int x, int y, int w, int h); virtual void DrawRectInt(const SkColor& color, diff --git a/gfx/canvas_skia.cc b/gfx/canvas_skia.cc index dbf5d3a..017fd5f 100644 --- a/gfx/canvas_skia.cc +++ b/gfx/canvas_skia.cc @@ -105,10 +105,16 @@ void CanvasSkia::ScaleInt(int x, int y) { } void CanvasSkia::FillRectInt(const SkColor& color, int x, int y, int w, int h) { + FillRectInt(color, x, y, w, h, SkXfermode::kSrcOver_Mode); +} + +void CanvasSkia::FillRectInt(const SkColor& color, + int x, int y, int w, int h, + SkXfermode::Mode mode) { SkPaint paint; paint.setColor(color); paint.setStyle(SkPaint::kFill_Style); - paint.setXfermodeMode(SkXfermode::kSrcOver_Mode); + paint.setXfermodeMode(mode); DrawRectInt(x, y, w, h, paint); } diff --git a/gfx/canvas_skia.h b/gfx/canvas_skia.h index 153e812..7db41a0 100644 --- a/gfx/canvas_skia.h +++ b/gfx/canvas_skia.h @@ -95,6 +95,8 @@ class CanvasSkia : public skia::PlatformCanvas, virtual void TranslateInt(int x, int y); virtual void ScaleInt(int x, int y); virtual void FillRectInt(const SkColor& color, int x, int y, int w, int h); + virtual void FillRectInt(const SkColor& color, int x, int y, int w, int h, + SkXfermode::Mode mode); virtual void FillRectInt(const gfx::Brush* brush, int x, int y, int w, int h); virtual void DrawRectInt(const SkColor& color, int x, int y, int w, int h); virtual void DrawRectInt(const SkColor& color, |