From f78e78da589678dde4a1e3ba62e8ba20df3aa080 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Wed, 6 Jul 2011 21:01:29 +0000 Subject: [PATCH] add option to test 1x1 bitmapshader git-svn-id: http://skia.googlecode.com/svn/trunk@1809 2bbb7eff-a529-9590-31e7-b0007b416f81 --- samplecode/SampleXfermodesBlur.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/samplecode/SampleXfermodesBlur.cpp b/samplecode/SampleXfermodesBlur.cpp index e7a8692716..0167a6d4a0 100644 --- a/samplecode/SampleXfermodesBlur.cpp +++ b/samplecode/SampleXfermodesBlur.cpp @@ -25,6 +25,15 @@ #include "SkBlurMaskFilter.h" static void test_gradient2(SkCanvas* canvas) { +#if 1 + SkBitmap bm; + bm.setConfig(SkBitmap::kARGB_8888_Config, 1, 1); + bm.allocPixels(); + *bm.getAddr32(0, 0) = SkPackARGB32(0xFF, 0, 0xFF, 0); + + SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode, + SkShader::kRepeat_TileMode); +#else /* ctx.fillStyle = '#f00'; ctx.fillRect(0, 0, 100, 50); @@ -46,6 +55,7 @@ static void test_gradient2(SkCanvas* canvas) { SkShader* s = SkGradientShader::CreateTwoPointRadial(c0, r0, c1, r1, colors, pos, SK_ARRAY_COUNT(pos), SkShader::kClamp_TileMode); +#endif SkPaint paint; paint.setShader(s)->unref();