Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: samplecode/SampleShadowing.cpp

Issue 2285133002: Optimizations and more documentation of SkShadowShader (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: removed redundant vec2 ing Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkShadowShader.cpp » ('j') | src/core/SkShadowShader.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/core/SkShadowShader.cpp » ('j') | src/core/SkShadowShader.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698