OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkPictureRecorder.h" | 9 #include "SkPictureRecorder.h" |
10 #include "SkShadowPaintFilterCanvas.h" | 10 #include "SkShadowPaintFilterCanvas.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 fSliders[1].fGeometry = SkRect::MakeLTRB(100, 420, 110, 440); | 46 fSliders[1].fGeometry = SkRect::MakeLTRB(100, 420, 110, 440); |
47 fSliders[1].fOffset = 0.0f; | 47 fSliders[1].fOffset = 0.0f; |
48 fSliders[1].fScale = 10.0f; | 48 fSliders[1].fScale = 10.0f; |
49 | 49 |
50 fSliders[2].fGeometry = SkRect::MakeLTRB(0, 440, 10, 460); | 50 fSliders[2].fGeometry = SkRect::MakeLTRB(0, 440, 10, 460); |
51 fSliders[2].fOffset = 0.0f; | 51 fSliders[2].fOffset = 0.0f; |
52 fSliders[2].fScale = 0.0025f; | 52 fSliders[2].fScale = 0.0025f; |
53 | 53 |
54 fShadowParams.fShadowRadius = 4.0f; | 54 fShadowParams.fShadowRadius = 4.0f; |
55 fShadowParams.fBiasingConstant = 0.3f; | 55 fShadowParams.fBiasingConstant = 0.3f; |
56 fShadowParams.fMinVariance = 1024; | 56 fShadowParams.fMinVariance = 0.015625; |
jvanverth1
2016/08/29 18:30:14
It's not clear to me why this is now 1/64.
vjiaoblack
2016/08/29 19:45:21
I'll put the tranform in later.
It was because I
| |
57 fShadowParams.fType = SkShadowParams::kVariance_ShadowType; | 57 fShadowParams.fType = SkShadowParams::kVariance_ShadowType; |
58 } | 58 } |
59 | 59 |
60 protected: | 60 protected: |
61 bool onQuery(SkEvent *evt) override { | 61 bool onQuery(SkEvent *evt) override { |
62 if (SampleCode::TitleQ(*evt)) { | 62 if (SampleCode::TitleQ(*evt)) { |
63 SampleCode::TitleR(evt, "shadowing"); | 63 SampleCode::TitleR(evt, "shadowing"); |
64 return true; | 64 return true; |
65 } | 65 } |
66 | 66 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 sk_sp<SkLights> fLights; | 298 sk_sp<SkLights> fLights; |
299 | 299 |
300 typedef SampleView INHERITED; | 300 typedef SampleView INHERITED; |
301 }; | 301 }; |
302 | 302 |
303 ////////////////////////////////////////////////////////////////////////////// | 303 ////////////////////////////////////////////////////////////////////////////// |
304 static SkView* MyFactory() { return new ShadowingView; } | 304 static SkView* MyFactory() { return new ShadowingView; } |
305 static SkViewRegister reg(MyFactory); | 305 static SkViewRegister reg(MyFactory); |
306 | 306 |
307 #endif | 307 #endif |
OLD | NEW |