diff options
author | Hal Canary <halcanary@google.com> | 2017-06-07 15:23:49 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-07 20:08:46 +0000 |
commit | 9982c4eb76af58e18df2cd3dd81913439f1b6157 (patch) | |
tree | dfbc69a774e9b8b62a67d2c9378c7987fa6a8a50 /gm | |
parent | fa2a26a026fb69659eef3857be58d4d5b0c75e29 (diff) |
GM for drawImage w/ maskFilter
BUG=skia:237
Change-Id: I8b06fa5b0e05af28e010ccbd2772c64e3eaefdde
Reviewed-on: https://skia-review.googlesource.com/19026
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'gm')
-rw-r--r-- | gm/blurs.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gm/blurs.cpp b/gm/blurs.cpp index a7b1a5f769..adb2a1ff73 100644 --- a/gm/blurs.cpp +++ b/gm/blurs.cpp @@ -7,8 +7,10 @@ #include "gm.h" #include "sk_tool_utils.h" +#include "Resources.h" #include "SkBlurMask.h" #include "SkBlurMaskFilter.h" +#include "SkImage.h" #include "SkPath.h" DEF_SIMPLE_GM_BG(blurs, canvas, 700, 500, sk_tool_utils::color_to_565(0xFFDDDDDD)) { @@ -117,3 +119,13 @@ DEF_SIMPLE_GM(blur2rectsnonninepatch, canvas, 700, 500) { canvas->translate(-30, -150); canvas->drawPath(path, paint); } + +DEF_SIMPLE_GM(BlurDrawImage, canvas, 256, 256) { + SkPaint paint; + paint.setMaskFilter(SkBlurMaskFilter::Make(kNormal_SkBlurStyle, 10, 0)); + canvas->clear(0xFF88FF88); + if (auto image = GetResourceAsImage("mandrill_512_q075.jpg")) { + canvas->scale(0.25, 0.25); + canvas->drawImage(image, 256, 256, &paint); + } +} |