summaryrefslogtreecommitdiffstats
path: root/gfx/canvas_direct2d_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/canvas_direct2d_unittest.cc')
-rw-r--r--gfx/canvas_direct2d_unittest.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/gfx/canvas_direct2d_unittest.cc b/gfx/canvas_direct2d_unittest.cc
index 541e3f0..d8c02c1 100644
--- a/gfx/canvas_direct2d_unittest.cc
+++ b/gfx/canvas_direct2d_unittest.cc
@@ -8,6 +8,7 @@
#include <vssym32.h>
#include "base/command_line.h"
+#include "base/scoped_ptr.h"
#include "gfx/canvas_direct2d.h"
#include "gfx/canvas_skia.h"
#include "gfx/native_theme_win.h"
@@ -202,3 +203,21 @@ TEST(CanvasDirect2D, ClipRectWithScale) {
canvas.FillRectInt(SK_ColorRED, 0, 0, 500, 500);
canvas.Restore();
}
+
+TEST(CanvasDirect2D, CreateLinearGradientBrush) {
+ TestWindow window;
+ gfx::CanvasDirect2D canvas(window.rt());
+
+ canvas.Save();
+ SkColor colors[] = { SK_ColorRED, SK_ColorWHITE };
+ float positions[] = { 0.0f, 1.0f };
+ scoped_ptr<gfx::Brush> brush(canvas.CreateLinearGradientBrush(
+ gfx::Point(0, 0),
+ gfx::Point(100, 0),
+ colors,
+ positions,
+ 2,
+ gfx::Canvas::TileMode_Clamp));
+ canvas.FillRectInt(brush.get(), 0, 0, 500, 500);
+ canvas.Restore();
+}