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 | 8 |
9 #include "gm.h" | 9 #include "gm.h" |
10 #include "SkPathEffect.h" | 10 #include "SkPathEffect.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Create a light set consisting of | 67 // Create a light set consisting of |
68 // - bluish directional light pointing more right than down | 68 // - bluish directional light pointing more right than down |
69 // - reddish directional light pointing more down than right | 69 // - reddish directional light pointing more down than right |
70 // - soft white ambient light | 70 // - soft white ambient light |
71 | 71 |
72 SkLights::Builder builder; | 72 SkLights::Builder builder; |
73 builder.add(SkLights::Light::MakeDirectional(SkColor3f::Make(0.2f, 0.3f,
0.4f), | 73 builder.add(SkLights::Light::MakeDirectional(SkColor3f::Make(0.2f, 0.3f,
0.4f), |
74 SkVector3::Make(0.2f, 0.1f,
1.0f))); | 74 SkVector3::Make(0.2f, 0.1f,
1.0f))); |
75 builder.add(SkLights::Light::MakeDirectional(SkColor3f::Make(0.4f, 0.3f,
0.2f), | 75 builder.add(SkLights::Light::MakeDirectional(SkColor3f::Make(0.4f, 0.3f,
0.2f), |
76 SkVector3::Make(0.1f, 0.2f,
1.0f))); | 76 SkVector3::Make(0.1f, 0.2f,
1.0f))); |
77 builder.add(SkLights::Light::MakeAmbient(SkColor3f::Make(0.4f, 0.4f, 0.4
f))); | 77 builder.setAmbientLightColor(SkColor3f::Make(0.4f, 0.4f, 0.4f)); |
78 fLights = builder.finish(); | 78 fLights = builder.finish(); |
79 | 79 |
80 fShadowParams.fShadowRadius = 4.0f; | 80 fShadowParams.fShadowRadius = 4.0f; |
81 fShadowParams.fBiasingConstant = 0.3f; | 81 fShadowParams.fBiasingConstant = 0.3f; |
82 fShadowParams.fMinVariance = 1024; | 82 fShadowParams.fMinVariance = 1024; |
83 fShadowParams.fType = SkShadowParams::kVariance_ShadowType; | 83 fShadowParams.fType = SkShadowParams::kVariance_ShadowType; |
84 } | 84 } |
85 | 85 |
86 protected: | 86 protected: |
87 static const int kWidth = 400; | 87 static const int kWidth = 400; |
(...skipping 20 matching lines...) Expand all Loading... |
108 SkShadowParams fShadowParams; | 108 SkShadowParams fShadowParams; |
109 typedef GM INHERITED; | 109 typedef GM INHERITED; |
110 }; | 110 }; |
111 | 111 |
112 ////////////////////////////////////////////////////////////////////////////// | 112 ////////////////////////////////////////////////////////////////////////////// |
113 | 113 |
114 DEF_GM(return new ShadowMapsGM;) | 114 DEF_GM(return new ShadowMapsGM;) |
115 } | 115 } |
116 | 116 |
117 #endif | 117 #endif |
OLD | NEW |