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

Side by Side Diff: src/effects/SkLightingShader.cpp

Issue 1266633003: Added registerChild; transforms, textures, glKey automatically handled. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: refactored to onGetGLProcessorKey; removed emitSamplers specialized template; fixed nits Created 5 years, 4 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 | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkLumaColorFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 ///////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkLumaColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698