aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar sugoi <sugoi@chromium.org>2014-10-23 13:59:52 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-23 13:59:52 -0700
commit234f036b3e731e06e616c5291157d3bb4fbfdee2 (patch)
tree37acef5dcc153d42d4b3fe0351ea1f6de280fbd1 /samplecode
parentd0777fd2cf25fc6a1a2b010313cc4abdd7d33734 (diff)
Adding an option to render only the shadow in SkDropShadowImageFilter
This is basically how blink uses the filter. Currently, I can't use it for "ShadowOnly" mode with the filter at all, but instead of copying the code and risking to have the codepaths diverge, I'm simply going to add the option here. BUG=skia: Review URL: https://codereview.chromium.org/646213004
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleFilterFuzz.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp
index a996a4bc27..e073f80b0c 100644
--- a/samplecode/SampleFilterFuzz.cpp
+++ b/samplecode/SampleFilterFuzz.cpp
@@ -122,6 +122,11 @@ static SkColor make_color() {
return (R(2) == 1) ? 0xFFC0F0A0 : 0xFF000090;
}
+static SkDropShadowImageFilter::ShadowMode make_shadow_mode() {
+ return (R(2) == 1) ? SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode :
+ SkDropShadowImageFilter::kDrawShadowOnly_ShadowMode;
+}
+
static SkPoint3 make_point() {
return SkPoint3(make_scalar(), make_scalar(), make_scalar(true));
}
@@ -340,8 +345,9 @@ static SkImageFilter* make_image_filter(bool canBeNull = true) {
}
break;
case DROP_SHADOW:
- filter = SkDropShadowImageFilter::Create(make_scalar(), make_scalar(),
- make_scalar(true), make_scalar(true), make_color(), make_image_filter());
+ filter = SkDropShadowImageFilter::Create(make_scalar(), make_scalar(), make_scalar(true),
+ make_scalar(true), make_color(), make_shadow_mode(), make_image_filter(),
+ NULL, 0);
break;
case MORPHOLOGY:
if (R(2) == 1) {