OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkBitmapProcState.h" | 9 #include "SkBitmapProcState.h" |
10 #include "SkColor.h" | 10 #include "SkColor.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 220 |
221 SkColor3f fLightColor; | 221 SkColor3f fLightColor; |
222 GrGLProgramDataManager::UniformHandle fLightColorUni; | 222 GrGLProgramDataManager::UniformHandle fLightColorUni; |
223 | 223 |
224 SkColor3f fAmbientColor; | 224 SkColor3f fAmbientColor; |
225 GrGLProgramDataManager::UniformHandle fAmbientColorUni; | 225 GrGLProgramDataManager::UniformHandle fAmbientColorUni; |
226 }; | 226 }; |
227 | 227 |
228 GrGLFragmentProcessor* createGLInstance() const override { return SkNEW(Ligh
tingGLFP); } | 228 GrGLFragmentProcessor* createGLInstance() const override { return SkNEW(Ligh
tingGLFP); } |
229 | 229 |
230 void getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) con
st override { | 230 void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c
onst override { |
231 LightingGLFP::GenKey(*this, caps, b); | 231 LightingGLFP::GenKey(*this, caps, b); |
232 } | 232 } |
233 | 233 |
234 const char* name() const override { return "LightingFP"; } | 234 const char* name() const override { return "LightingFP"; } |
235 | 235 |
236 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { | 236 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { |
237 inout->mulByUnknownFourComponents(); | 237 inout->mulByUnknownFourComponents(); |
238 } | 238 } |
239 | 239 |
240 const SkVector3& lightDir() const { return fLightDir; } | 240 const SkVector3& lightDir() const { return fLightDir; } |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 return SkNEW_ARGS(SkLightingShaderImpl, (diffuse, normal, light, ambient, lo
calMatrix)); | 578 return SkNEW_ARGS(SkLightingShaderImpl, (diffuse, normal, light, ambient, lo
calMatrix)); |
579 } | 579 } |
580 | 580 |
581 /////////////////////////////////////////////////////////////////////////////// | 581 /////////////////////////////////////////////////////////////////////////////// |
582 | 582 |
583 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingShader) | 583 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingShader) |
584 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingShaderImpl) | 584 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingShaderImpl) |
585 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 585 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
586 | 586 |
587 /////////////////////////////////////////////////////////////////////////////// | 587 /////////////////////////////////////////////////////////////////////////////// |
OLD | NEW |