diff options
-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); + } +} |