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

Unified Diff: src/effects/SkLightingShader.cpp

Issue 1287023009: Added tree structure to GrGLFragmentProcessor, i.e. GL instances (Closed) Base URL: https://skia.googlesource.com/skia@cs3_isequal_nonrecursive
Patch Set: moved onSetData from public to protected, onCreateGLInstance from public to private in subclasses 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkLumaColorFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLightingShader.cpp
diff --git a/src/effects/SkLightingShader.cpp b/src/effects/SkLightingShader.cpp
index 6ed98746397cfcfb5d193d6281b9d543cb0a911c..d441d9ba9fd298c6b6a44503e591e0939f47e91c 100644
--- a/src/effects/SkLightingShader.cpp
+++ b/src/effects/SkLightingShader.cpp
@@ -185,7 +185,15 @@ public:
fpb->codeAppendf("%s = vec4(result.rgb, diffuseColor.a);", args.fOutputColor);
}
- void setData(const GrGLProgramDataManager& pdman, const GrProcessor& proc) override {
+ static void GenKey(const GrProcessor& proc, const GrGLSLCaps&,
+ GrProcessorKeyBuilder* b) {
+// const LightingFP& lightingFP = proc.cast<LightingFP>();
+ // only one shader generated currently
+ b->add32(0x0);
+ }
+
+ protected:
+ void onSetData(const GrGLProgramDataManager& pdman, const GrProcessor& proc) override {
const LightingFP& lightingFP = proc.cast<LightingFP>();
const SkVector3& lightDir = lightingFP.lightDir();
@@ -207,13 +215,6 @@ public:
}
}
- static void GenKey(const GrProcessor& proc, const GrGLSLCaps&,
- GrProcessorKeyBuilder* b) {
-// const LightingFP& lightingFP = proc.cast<LightingFP>();
- // only one shader generated currently
- b->add32(0x0);
- }
-
private:
SkVector3 fLightDir;
GrGLProgramDataManager::UniformHandle fLightDirUni;
@@ -225,8 +226,6 @@ public:
GrGLProgramDataManager::UniformHandle fAmbientColorUni;
};
- GrGLFragmentProcessor* createGLInstance() const override { return SkNEW(LightingGLFP); }
-
void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override {
LightingGLFP::GenKey(*this, caps, b);
}
@@ -242,6 +241,8 @@ public:
const SkColor3f& ambientColor() const { return fAmbientColor; }
private:
+ GrGLFragmentProcessor* onCreateGLInstance() const override { return SkNEW(LightingGLFP); }
+
bool onIsEqual(const GrFragmentProcessor& proc) const override {
const LightingFP& lightingFP = proc.cast<LightingFP>();
return fDeviceTransform == lightingFP.fDeviceTransform &&
« 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