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 "gm.h" | 8 #include "gm.h" |
9 #include "SkLightingShader.h" | 9 #include "SkLightingShader.h" |
10 #include "SkNormalSource.h" | 10 #include "SkNormalSource.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 canvas->save(); | 247 canvas->save(); |
248 canvas->translate(xPos, yPos); | 248 canvas->translate(xPos, yPos); |
249 this->drawRect(canvas, 1.0f, 1.0f, 0.0f, true, true, false, false, f
LightsTwoDir); | 249 this->drawRect(canvas, 1.0f, 1.0f, 0.0f, true, true, false, false, f
LightsTwoDir); |
250 canvas->restore(); | 250 canvas->restore(); |
251 | 251 |
252 gridNum++; | 252 gridNum++; |
253 } | 253 } |
254 } | 254 } |
255 | 255 |
256 private: | 256 private: |
257 static const int kTexSize = 96; | 257 static constexpr int kTexSize = 96; |
258 | 258 |
259 sk_sp<SkShader> fOpaqueDiffuse; | 259 sk_sp<SkShader> fOpaqueDiffuse; |
260 sk_sp<SkShader> fTranslucentDiffuse; | 260 sk_sp<SkShader> fTranslucentDiffuse; |
261 sk_sp<SkShader> fNormalMapShader; | 261 sk_sp<SkShader> fNormalMapShader; |
262 | 262 |
263 SkRect fRect; | 263 SkRect fRect; |
264 sk_sp<SkLights> fLights; | 264 sk_sp<SkLights> fLights; |
265 sk_sp<SkLights> fLightsNoDir; | 265 sk_sp<SkLights> fLightsNoDir; |
266 sk_sp<SkLights> fLightsTwoDir; | 266 sk_sp<SkLights> fLightsTwoDir; |
267 | 267 |
268 typedef GM INHERITED; | 268 typedef GM INHERITED; |
269 }; | 269 }; |
270 | 270 |
271 ////////////////////////////////////////////////////////////////////////////// | 271 ////////////////////////////////////////////////////////////////////////////// |
272 | 272 |
273 DEF_GM(return new LightingShader2GM;) | 273 DEF_GM(return new LightingShader2GM;) |
274 } | 274 } |
OLD | NEW |