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

Unified Diff: src/effects/SkBlurMaskFilter.cpp

Issue 1661143003: Next round of GrGLSLFragmentProcessor-derived class cleanup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix overlength line Created 4 years, 11 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/SkArithmeticMode_gpu.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBlurMaskFilter.cpp
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index d55c669e74da8c858a78ca663be50c0989a05828..5a7fc50b24027c45822c34264c71c2478d892f46 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -646,6 +646,7 @@ public:
const SkRect& getRect() const { return fRect; }
float getSigma() const { return fSigma; }
+ GrSLPrecision precision() const { return fPrecision; }
private:
GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *blurProfile,
@@ -673,12 +674,9 @@ private:
class GrGLRectBlurEffect : public GrGLSLFragmentProcessor {
public:
- GrGLRectBlurEffect(const GrProcessor&, GrSLPrecision precision)
- : fPrecision(precision) {
- }
void emitCode(EmitArgs&) override;
- static void GenKey(GrSLPrecision precision, GrProcessorKeyBuilder* b);
+ static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b);
protected:
void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override;
@@ -688,7 +686,6 @@ private:
UniformHandle fProxyRectUniform;
UniformHandle fProfileSizeUniform;
- GrSLPrecision fPrecision;
typedef GrGLSLFragmentProcessor INHERITED;
};
@@ -710,21 +707,26 @@ void OutputRectBlurProfileLookup(GrGLSLFragmentBuilder* fragBuilder,
}
-void GrGLRectBlurEffect::GenKey(GrSLPrecision precision, GrProcessorKeyBuilder* b) {
- b->add32(precision);
+void GrGLRectBlurEffect::GenKey(const GrProcessor& proc, const GrGLSLCaps&,
+ GrProcessorKeyBuilder* b) {
+ const GrRectBlurEffect& rbe = proc.cast<GrRectBlurEffect>();
+
+ b->add32(rbe.precision());
}
void GrGLRectBlurEffect::emitCode(EmitArgs& args) {
+ const GrRectBlurEffect& rbe = args.fFp.cast<GrRectBlurEffect>();
+
GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
const char *rectName;
const char *profileSizeName;
- const char* precisionString = GrGLSLShaderVar::PrecisionString(args.fGLSLCaps, fPrecision);
+ const char* precisionString = GrGLSLShaderVar::PrecisionString(args.fGLSLCaps, rbe.precision());
fProxyRectUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
kVec4f_GrSLType,
- fPrecision,
+ rbe.precision(),
"proxyRect",
&rectName);
fProfileSizeUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
@@ -814,11 +816,11 @@ GrRectBlurEffect::GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *b
void GrRectBlurEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
- GrGLRectBlurEffect::GenKey(fPrecision, b);
+ GrGLRectBlurEffect::GenKey(*this, caps, b);
}
GrGLSLFragmentProcessor* GrRectBlurEffect::onCreateGLSLInstance() const {
- return new GrGLRectBlurEffect(*this, fPrecision);
+ return new GrGLRectBlurEffect;
}
bool GrRectBlurEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
« no previous file with comments | « src/effects/SkArithmeticMode_gpu.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698