Chromium Code Reviews| 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 #ifndef SkShadowShader_DEFINED | 9 #ifndef SkShadowShader_DEFINED |
| 10 #define SkShadowShader_DEFINED | 10 #define SkShadowShader_DEFINED |
| 11 | 11 |
| 12 #ifdef SK_EXPERIMENTAL_SHADOWING | 12 #ifdef SK_EXPERIMENTAL_SHADOWING |
| 13 | 13 |
| 14 class SkLights; | 14 class SkLights; |
| 15 class SkShader; | 15 class SkShader; |
| 16 | 16 |
| 17 struct SkShadowType { | |
| 18 SkScalar fShadowRadius; | |
| 19 SkScalar fBiasingConstant; | |
| 20 SkScalar fMinVariance; | |
| 21 | |
| 22 enum BlurAlgorithm { | |
| 23 kNoBlur_BlurAlgorithm, | |
| 24 kVariance_BlurAlgorithm | |
| 25 }; | |
| 26 BlurAlgorithm fBlurAlgorithm; | |
| 27 }; | |
| 28 | |
| 17 class SK_API SkShadowShader { | 29 class SK_API SkShadowShader { |
| 18 public: | 30 public: |
| 19 /** This shader combines the diffuse color in 'diffuseShader' with the shado ws | 31 /** This shader combines the diffuse color in 'diffuseShader' with the shado ws |
| 20 * determined by the 'povDepthShader' and the shadow maps stored in each of the | 32 * determined by the 'povDepthShader' and the shadow maps stored in each of the |
| 21 * lights in 'lights' | 33 * lights in 'lights' |
| 22 */ | 34 */ |
| 23 static sk_sp<SkShader> Make(sk_sp<SkShader> povDepthShader, | 35 static sk_sp<SkShader> Make(sk_sp<SkShader> povDepthShader, |
| 24 sk_sp<SkShader> diffuseShader, | 36 sk_sp<SkShader> diffuseShader, |
| 25 sk_sp<SkLights> lights, | 37 sk_sp<SkLights> lights, |
| 26 int diffuseWidth, int diffuseHeight); | 38 int diffuseWidth, int diffuseHeight, |
| 39 SkShadowType sType); | |
|
jvanverth1
2016/08/15 16:37:17
const SkShadowType& sType
vjiaoblack
2016/08/15 17:43:31
Done.
| |
| 27 | 40 |
| 28 // The shadow shader supports any number of ambient lights, but only | 41 // The shadow shader supports any number of ambient lights, but only |
| 29 // 4 non-ambient lights (currently just refers to directional lights). | 42 // 4 non-ambient lights (currently just refers to directional lights). |
| 30 static constexpr int kMaxNonAmbientLights = 4; | 43 static constexpr int kMaxNonAmbientLights = 4; |
| 31 | 44 |
| 32 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() | 45 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
| 33 }; | 46 }; |
| 34 | 47 |
| 35 #endif | 48 #endif |
| 36 #endif | 49 #endif |
| OLD | NEW |