shorten animation to work around fiddlecli bug

longer animation for SkImage::makeFromFilter
example breaks fiddlecli.

TBR=jcgregorio@google.com
NOTRY=true
Docs-Preview: https://skia.org/?cl=156183
Bug: skia:
Change-Id: I512e982bbaf7fb3e4c58706b4d7e416f4ceac294
Reviewed-on: https://skia-review.googlesource.com/156183
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
This commit is contained in:
Cary Clark 2018-09-21 11:36:41 -04:00 committed by Skia Commit-Bot
parent 7b562291a7
commit 5717e82cf4
3 changed files with 4 additions and 3 deletions

View File

@ -2001,6 +2001,7 @@ animation frames aligned with respect to each other.
#Return filtered Image, or nullptr ##
# Duration 5 breaks fiddlecli
#Example
#Description
In each frame of the animation, filtered Image is drawn in a different location.
@ -2008,7 +2009,7 @@ By translating canvas by returned offset, Image appears stationary.
##
#Image 5
#Platform gpu
#Duration 5
#Duration 1
sk_sp<SkImageFilter> shadowFilter = SkDropShadowImageFilter::Make(
-10.0f * frame, 5.0f * frame, 3.0f, 3.0f, SK_ColorBLUE,
SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode,

View File

@ -2573,7 +2573,7 @@ filtered <a href='#Image'>Image</a>, or nullptr
### Example
<div><fiddle-embed name="17547129251dd9607c381a3cc30cff15" gpu="true"><div>In each frame of the animation, filtered <a href='#Image'>Image</a> is drawn in a different location.
<div><fiddle-embed name="85a76163138a2720ac003691d6363938" gpu="true"><div>In each frame of the animation, filtered <a href='#Image'>Image</a> is drawn in a different location.
By translating canvas by returned <a href='#SkImage_makeWithFilter_offset'>offset</a>, <a href='#Image'>Image</a> appears stationary.
</div></fiddle-embed></div>

View File

@ -6340,7 +6340,7 @@
"code": "void draw(SkCanvas* canvas) {\n sk_sp<SkImageFilter> shadowFilter = SkDropShadowImageFilter::Make(\n -10.0f * frame, 5.0f * frame, 3.0f, 3.0f, SK_ColorBLUE,\n SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode,\n nullptr);\n sk_sp<SkImageFilter> offsetFilter = SkOffsetImageFilter::Make(40, 40, shadowFilter, nullptr);\n SkIRect subset = image->bounds();\n SkIRect clipBounds = image->bounds();\n clipBounds.outset(60, 60);\n SkIRect outSubset;\n SkIPoint offset;\n sk_sp<SkImage> filtered(image->makeWithFilter(offsetFilter.get(), subset, clipBounds,\n &outSubset, &offset));\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n canvas->drawLine(0, 0, offset.fX, offset.fY, paint);\n canvas->translate(offset.fX, offset.fY);\n canvas->drawImage(filtered, 0, 0);\n canvas->drawRect(SkRect::Make(outSubset), paint);\n}",
"width": 256,
"height": 256,
"hash": "17547129251dd9607c381a3cc30cff15",
"hash": "85a76163138a2720ac003691d6363938",
"file": "SkImage_Reference",
"name": "SkImage::makeWithFilter"
},