diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-06 21:01:29 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-06 21:01:29 +0000 |
commit | f78e78da589678dde4a1e3ba62e8ba20df3aa080 (patch) | |
tree | 39ae3717a2af73d52c5c356eb74124510bdc4d7a /samplecode | |
parent | cde92111d50a96b6d0f3e166fbac7c9bc6eca349 (diff) |
add option to test 1x1 bitmapshader
git-svn-id: http://skia.googlecode.com/svn/trunk@1809 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode')
-rw-r--r-- | samplecode/SampleXfermodesBlur.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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(); |