aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2018-05-11 10:48:20 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-11 15:39:57 +0000
commitf507c28f3adbe22bbde2e07df6d094d8abedb44d (patch)
tree9bdc55780681a93a6aeedccafe826a2c0f04b0a8 /samplecode
parent8fc73ed17d1a81b02377663087db09baded4dd67 (diff)
Shadow fixes to avoid popping.
* Make geometric shadow generation more tolerant of nearly-convex paths. * Ensure analytic and geometric shadow positions match with large blurs. Bug: skia: Change-Id: I8d3ba43b90d1520cb20f89de9f0b13d11a1a08c3 Reviewed-on: https://skia-review.googlesource.com/127045 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleAndroidShadows.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/samplecode/SampleAndroidShadows.cpp b/samplecode/SampleAndroidShadows.cpp
index a5fb6fcb9f..ee833d7939 100644
--- a/samplecode/SampleAndroidShadows.cpp
+++ b/samplecode/SampleAndroidShadows.cpp
@@ -281,6 +281,16 @@ protected:
this->drawShadowedPath(canvas, tmpPath, zPlaneParams, paint, .1f,
lightPos, kLightWidth, .5f);
+ // path ops bug
+ SkPath tmpClipPathBug;
+ tmpClipPathBug.addCircle(88.0344925f, 0, 60);
+ Op(fSquareRRectPath, tmpClipPathBug, kIntersect_SkPathOp, &tmpPath);
+
+ canvas->translate(250, 0);
+ zPlaneParams.fZ = SkTMax(1.0f, 32 + fZDelta);
+ this->drawShadowedPath(canvas, tmpPath, zPlaneParams, paint, .1f,
+ lightPos, kLightWidth, .5f);
+
// perspective paths
SkPoint pivot = SkPoint::Make(fWideRectPath.getBounds().width()/2,
fWideRectPath.getBounds().height()/2);
@@ -318,7 +328,7 @@ protected:
}
bool onAnimate(const SkAnimTimer& timer) override {
- fAnimTranslate = timer.pingPong(30, 0, 200, -200);
+ fAnimTranslate = timer.pingPong(30, 0, 125, -125);
fAnimAngle = timer.pingPong(15, 0, 0, 20);
if (fDoAlphaAnimation) {
fAnimAlpha = timer.pingPong(5, 0, 1, 0);