summaryrefslogtreecommitdiffstats
path: root/gfx/canvas_direct2d_unittest.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-29 23:07:21 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-29 23:07:21 +0000
commit80cdb9fef61dc06c379027ad37fe40f45e061792 (patch)
treef11f6db1acae8645b94c279aef9d92e4832d9cd2 /gfx/canvas_direct2d_unittest.cc
parentfaa7929a4a690be40fb28598725085fdec8dbc96 (diff)
downloadchromium_src-80cdb9fef61dc06c379027ad37fe40f45e061792.zip
chromium_src-80cdb9fef61dc06c379027ad37fe40f45e061792.tar.gz
chromium_src-80cdb9fef61dc06c379027ad37fe40f45e061792.tar.bz2
Implement more rendering methods on Canvas.
Translation in TileImageInt is still wonky. BUG=none TEST=see unittests Review URL: http://codereview.chromium.org/3014043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54220 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx/canvas_direct2d_unittest.cc')
-rw-r--r--gfx/canvas_direct2d_unittest.cc52
1 files changed, 52 insertions, 0 deletions
diff --git a/gfx/canvas_direct2d_unittest.cc b/gfx/canvas_direct2d_unittest.cc
index ff63302..6595a4c 100644
--- a/gfx/canvas_direct2d_unittest.cc
+++ b/gfx/canvas_direct2d_unittest.cc
@@ -281,3 +281,55 @@ TEST(CanvasDirect2D, CreateBitmapBrush) {
canvas.Restore();
}
+TEST(CanvasDirect2D, DrawRectInt) {
+ TestWindow window;
+ gfx::CanvasDirect2D canvas(window.rt());
+
+ canvas.Save();
+ canvas.DrawRectInt(SK_ColorRED, 10, 10, 200, 200);
+ canvas.Restore();
+}
+
+TEST(CanvasDirect2D, DrawLineInt) {
+ TestWindow window;
+ gfx::CanvasDirect2D canvas(window.rt());
+
+ canvas.Save();
+ canvas.DrawLineInt(SK_ColorRED, 10, 10, 210, 210);
+ canvas.Restore();
+}
+
+TEST(CanvasDirect2D, DrawBitmapInt) {
+ TestWindow window;
+ gfx::CanvasDirect2D canvas(window.rt());
+
+ SkBitmap bitmap = LoadBitmapFromResources(IDR_BITMAP_BRUSH_IMAGE);
+
+ canvas.Save();
+ canvas.DrawBitmapInt(bitmap, 100, 100);
+ canvas.Restore();
+}
+
+TEST(CanvasDirect2D, DrawBitmapInt2) {
+ TestWindow window;
+ gfx::CanvasDirect2D canvas(window.rt());
+
+ SkBitmap bitmap = LoadBitmapFromResources(IDR_BITMAP_BRUSH_IMAGE);
+
+ canvas.Save();
+ canvas.DrawBitmapInt(bitmap, 5, 5, 30, 30, 10, 10, 30, 30, false);
+ canvas.DrawBitmapInt(bitmap, 5, 5, 30, 30, 110, 110, 100, 100, true);
+ canvas.DrawBitmapInt(bitmap, 5, 5, 30, 30, 220, 220, 100, 100, false);
+ canvas.Restore();
+}
+
+TEST(CanvasDirect2D, TileImageInt) {
+ TestWindow window;
+ gfx::CanvasDirect2D canvas(window.rt());
+
+ SkBitmap bitmap = LoadBitmapFromResources(IDR_BITMAP_BRUSH_IMAGE);
+
+ canvas.Save();
+ canvas.TileImageInt(bitmap, 10, 10, 300, 300);
+ canvas.Restore();
+}