diff options
70 files changed, 335 insertions, 318 deletions
diff --git a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp index 6504df2629..f4429dbe3b 100644 --- a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp +++ b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp @@ -20,7 +20,7 @@ #include "GrInvariantOutput.h" #include "SkGr.h" #include "effects/GrConstColorProcessor.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -620,7 +620,7 @@ void SkPerlinNoiseShader2::PerlinNoiseShaderContext::shadeSpan16( #if SK_SUPPORT_GPU -class GrGLPerlinNoise2 : public GrGLFragmentProcessor { +class GrGLPerlinNoise2 : public GrGLSLFragmentProcessor { public: GrGLPerlinNoise2(const GrProcessor&); virtual ~GrGLPerlinNoise2() {} @@ -641,7 +641,7 @@ private: GrGLSLProgramDataManager::UniformHandle fBaseFrequencyUni; private: - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; ///////////////////////////////////////////////////////////////////// @@ -670,7 +670,7 @@ public: const SkMatrix& matrix() const { return fCoordTransform.getMatrix(); } private: - GrGLFragmentProcessor* onCreateGLInstance() const override { + GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new GrGLPerlinNoise2(*this); } @@ -1050,7 +1050,7 @@ void GrGLPerlinNoise2::onSetData(const GrGLSLProgramDataManager& pdman, ///////////////////////////////////////////////////////////////////// -class GrGLImprovedPerlinNoise : public GrGLFragmentProcessor { +class GrGLImprovedPerlinNoise : public GrGLSLFragmentProcessor { public: GrGLImprovedPerlinNoise(const GrProcessor&); virtual ~GrGLImprovedPerlinNoise() {} @@ -1070,7 +1070,7 @@ private: GrGLSLProgramDataManager::UniformHandle fBaseFrequencyUni; private: - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; ///////////////////////////////////////////////////////////////////// @@ -1095,7 +1095,7 @@ public: const SkMatrix& matrix() const { return fCoordTransform.getMatrix(); } private: - GrGLFragmentProcessor* onCreateGLInstance() const override { + GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new GrGLImprovedPerlinNoise(*this); } diff --git a/gm/dcshader.cpp b/gm/dcshader.cpp index 828c8dcf51..6a6bf05ec8 100644 --- a/gm/dcshader.cpp +++ b/gm/dcshader.cpp @@ -11,7 +11,7 @@ #include "GrFragmentProcessor.h" #include "GrCoordTransform.h" #include "effects/GrXfermodeFragmentProcessor.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -64,8 +64,8 @@ public: this->initClassID<DCFP>(); } - GrGLFragmentProcessor* onCreateGLInstance() const override { - class DCGLFP : public GrGLFragmentProcessor { + GrGLSLFragmentProcessor* onCreateGLInstance() const override { + class DCGLFP : public GrGLSLFragmentProcessor { void emitCode(EmitArgs& args) override { GrGLSLFragmentBuilder* fpb = args.fBuilder->getFragmentShaderBuilder(); fpb->codeAppendf("vec2 c = %s;", fpb->ensureFSCoords2D(args.fCoords, 0).c_str()); diff --git a/gyp/gpu.gypi b/gyp/gpu.gypi index 960e857a48..9fa159167c 100644 --- a/gyp/gpu.gypi +++ b/gyp/gpu.gypi @@ -288,8 +288,6 @@ '<(skia_src_path)/gpu/gl/GrGLAssembleInterface.cpp', '<(skia_src_path)/gpu/gl/GrGLAssembleInterface.h', - '<(skia_src_path)/gpu/gl/GrGLSLBlend.cpp', - '<(skia_src_path)/gpu/gl/GrGLSLBlend.h', '<(skia_src_path)/gpu/gl/GrGLBufferImpl.cpp', '<(skia_src_path)/gpu/gl/GrGLBufferImpl.h', '<(skia_src_path)/gpu/gl/GrGLCaps.cpp', @@ -307,8 +305,6 @@ '<(skia_src_path)/gpu/gl/GrGLGpu.h', '<(skia_src_path)/gpu/gl/GrGLGpuProgramCache.cpp', '<(skia_src_path)/gpu/gl/GrGLExtensions.cpp', - '<(skia_src_path)/gpu/gl/GrGLFragmentProcessor.cpp', - '<(skia_src_path)/gpu/gl/GrGLFragmentProcessor.h', '<(skia_src_path)/gpu/gl/GrGLIndexBuffer.cpp', '<(skia_src_path)/gpu/gl/GrGLIndexBuffer.h', '<(skia_src_path)/gpu/gl/GrGLInterface.cpp', @@ -359,8 +355,12 @@ '<(skia_src_path)/gpu/glsl/GrGLSL.cpp', '<(skia_src_path)/gpu/glsl/GrGLSL.h', '<(skia_src_path)/gpu/glsl/GrGLSL_impl.h', + '<(skia_src_path)/gpu/glsl/GrGLSLBlend.cpp', + '<(skia_src_path)/gpu/glsl/GrGLSLBlend.h', '<(skia_src_path)/gpu/glsl/GrGLSLCaps.cpp', '<(skia_src_path)/gpu/glsl/GrGLSLCaps.h', + '<(skia_src_path)/gpu/glsl/GrGLSLFragmentProcessor.cpp', + '<(skia_src_path)/gpu/glsl/GrGLSLFragmentProcessor.h', '<(skia_src_path)/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp', '<(skia_src_path)/gpu/glsl/GrGLSLFragmentShaderBuilder.h', '<(skia_src_path)/gpu/glsl/GrGLSLGeometryShaderBuilder.cpp', @@ -373,6 +373,8 @@ '<(skia_src_path)/gpu/glsl/GrGLSLShaderBuilder.h', '<(skia_src_path)/gpu/glsl/GrGLSLShaderVar.h', '<(skia_src_path)/gpu/glsl/GrGLSLTextureSampler.h', + '<(skia_src_path)/gpu/glsl/GrGLSLUtil.cpp', + '<(skia_src_path)/gpu/glsl/GrGLSLUtil.h', '<(skia_src_path)/gpu/glsl/GrGLSLVertexShaderBuilder.cpp', '<(skia_src_path)/gpu/glsl/GrGLSLVertexShaderBuilder.h', diff --git a/include/gpu/GrFragmentProcessor.h b/include/gpu/GrFragmentProcessor.h index 571139578a..428466212c 100644 --- a/include/gpu/GrFragmentProcessor.h +++ b/include/gpu/GrFragmentProcessor.h @@ -12,7 +12,7 @@ class GrCoordTransform; class GrGLSLCaps; -class GrGLFragmentProcessor; +class GrGLSLFragmentProcessor; class GrInvariantOutput; class GrProcessorKeyBuilder; @@ -63,7 +63,7 @@ public: ~GrFragmentProcessor() override; - GrGLFragmentProcessor* createGLInstance() const; + GrGLSLFragmentProcessor* createGLInstance() const; void getGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const { this->onGetGLProcessorKey(caps, b); @@ -166,7 +166,7 @@ private: /** Returns a new instance of the appropriate *GL* implementation class for the given GrFragmentProcessor; caller is responsible for deleting the object. */ - virtual GrGLFragmentProcessor* onCreateGLInstance() const = 0; + virtual GrGLSLFragmentProcessor* onCreateGLInstance() const = 0; /** Implemented using GLFragmentProcessor::GenKey as described in this class's comment. */ virtual void onGetGLProcessorKey(const GrGLSLCaps& caps, diff --git a/include/gpu/effects/GrConstColorProcessor.h b/include/gpu/effects/GrConstColorProcessor.h index f5fdb7e35c..9f28167bc7 100644 --- a/include/gpu/effects/GrConstColorProcessor.h +++ b/include/gpu/effects/GrConstColorProcessor.h @@ -41,7 +41,7 @@ private: this->initClassID<GrConstColorProcessor>(); } - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp index a1a09b7491..ef88e69475 100644 --- a/src/core/SkLightingShader.cpp +++ b/src/core/SkLightingShader.cpp @@ -130,7 +130,7 @@ private: #include "GrCoordTransform.h" #include "GrFragmentProcessor.h" #include "GrTextureAccess.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -168,7 +168,7 @@ public: this->initClassID<LightingFP>(); } - class LightingGLFP : public GrGLFragmentProcessor { + class LightingGLFP : public GrGLSLFragmentProcessor { public: LightingGLFP() { fLightDir.fX = 10000.0f; @@ -297,7 +297,7 @@ public: const SkVector& invNormRotation() const { return fInvNormRotation; } private: - GrGLFragmentProcessor* onCreateGLInstance() const override { return new LightingGLFP; } + GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new LightingGLFP; } bool onIsEqual(const GrFragmentProcessor& proc) const override { const LightingFP& lightingFP = proc.cast<LightingFP>(); diff --git a/src/effects/GrCircleBlurFragmentProcessor.cpp b/src/effects/GrCircleBlurFragmentProcessor.cpp index 7776b630d0..b7f394c1a8 100644 --- a/src/effects/GrCircleBlurFragmentProcessor.cpp +++ b/src/effects/GrCircleBlurFragmentProcessor.cpp @@ -13,12 +13,12 @@ #include "GrContext.h" #include "GrTextureProvider.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" -class GrGLCircleBlurFragmentProcessor : public GrGLFragmentProcessor { +class GrGLCircleBlurFragmentProcessor : public GrGLSLFragmentProcessor { public: GrGLCircleBlurFragmentProcessor(const GrProcessor&) {} void emitCode(EmitArgs&) override; @@ -29,7 +29,7 @@ protected: private: GrGLSLProgramDataManager::UniformHandle fDataUniform; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; void GrGLCircleBlurFragmentProcessor::emitCode(EmitArgs& args) { @@ -93,7 +93,7 @@ GrCircleBlurFragmentProcessor::GrCircleBlurFragmentProcessor(const SkRect& circl this->setWillReadFragmentPosition(); } -GrGLFragmentProcessor* GrCircleBlurFragmentProcessor::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrCircleBlurFragmentProcessor::onCreateGLInstance() const { return new GrGLCircleBlurFragmentProcessor(*this); } diff --git a/src/effects/GrCircleBlurFragmentProcessor.h b/src/effects/GrCircleBlurFragmentProcessor.h index 4d39ec8e11..67f1a252cb 100644 --- a/src/effects/GrCircleBlurFragmentProcessor.h +++ b/src/effects/GrCircleBlurFragmentProcessor.h @@ -48,7 +48,7 @@ private: GrCircleBlurFragmentProcessor(const SkRect& circle, float sigma, float offset, GrTexture* blurProfile); - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override; diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp index 167489b689..6497111690 100644 --- a/src/effects/SkAlphaThresholdFilter.cpp +++ b/src/effects/SkAlphaThresholdFilter.cpp @@ -57,7 +57,7 @@ SkImageFilter* SkAlphaThresholdFilter::Create(const SkRegion& region, #include "SkGr.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -101,7 +101,7 @@ private: this->addTextureAccess(&fMaskTextureAccess); } - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -121,7 +121,7 @@ private: typedef GrFragmentProcessor INHERITED; }; -class GrGLAlphaThresholdEffect : public GrGLFragmentProcessor { +class GrGLAlphaThresholdEffect : public GrGLSLFragmentProcessor { public: GrGLAlphaThresholdEffect(const GrFragmentProcessor&) {} @@ -135,7 +135,7 @@ private: GrGLSLProgramDataManager::UniformHandle fInnerThresholdVar; GrGLSLProgramDataManager::UniformHandle fOuterThresholdVar; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; void GrGLAlphaThresholdEffect::emitCode(EmitArgs& args) { @@ -208,7 +208,7 @@ void AlphaThresholdEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrGLAlphaThresholdEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* AlphaThresholdEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* AlphaThresholdEffect::onCreateGLInstance() const { return new GrGLAlphaThresholdEffect(*this); } diff --git a/src/effects/SkArithmeticMode_gpu.cpp b/src/effects/SkArithmeticMode_gpu.cpp index ebc8293b20..2ab5172b57 100644 --- a/src/effects/SkArithmeticMode_gpu.cpp +++ b/src/effects/SkArithmeticMode_gpu.cpp @@ -13,9 +13,8 @@ #include "GrInvariantOutput.h" #include "GrProcessor.h" #include "GrTexture.h" -#include "gl/GrGLCaps.h" -#include "gl/GrGLFragmentProcessor.h" #include "gl/GrGLXferProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -54,7 +53,7 @@ static void add_arithmetic_code(GrGLSLFragmentBuilder* fsBuilder, } } -class GLArithmeticFP : public GrGLFragmentProcessor { +class GLArithmeticFP : public GrGLSLFragmentProcessor { public: GLArithmeticFP(const GrArithmeticFP& arithmeticFP) : fEnforcePMColor(arithmeticFP.enforcePMColor()) {} @@ -92,7 +91,7 @@ private: GrGLSLProgramDataManager::UniformHandle fKUni; bool fEnforcePMColor; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; /////////////////////////////////////////////////////////////////////////////// @@ -111,7 +110,7 @@ void GrArithmeticFP::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyB GLArithmeticFP::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrArithmeticFP::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrArithmeticFP::onCreateGLInstance() const { return new GLArithmeticFP(*this); } diff --git a/src/effects/SkArithmeticMode_gpu.h b/src/effects/SkArithmeticMode_gpu.h index 4810baed4a..2f8013ff16 100644 --- a/src/effects/SkArithmeticMode_gpu.h +++ b/src/effects/SkArithmeticMode_gpu.h @@ -47,7 +47,7 @@ public: bool enforcePMColor() const { return fEnforcePMColor; } private: - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override; diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp index 2ec5b90a40..7ec9464533 100644 --- a/src/effects/SkBlurMaskFilter.cpp +++ b/src/effects/SkBlurMaskFilter.cpp @@ -27,7 +27,7 @@ #include "SkGrPixelRef.h" #include "SkDraw.h" #include "effects/GrSimpleTextureEffect.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -655,7 +655,7 @@ private: GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *blurProfile, GrSLPrecision fPrecision); - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override; @@ -675,7 +675,7 @@ private: typedef GrFragmentProcessor INHERITED; }; -class GrGLRectBlurEffect : public GrGLFragmentProcessor { +class GrGLRectBlurEffect : public GrGLSLFragmentProcessor { public: GrGLRectBlurEffect(const GrProcessor&, GrSLPrecision precision) : fPrecision(precision) { @@ -694,7 +694,7 @@ private: UniformHandle fProfileSizeUniform; GrSLPrecision fPrecision; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; void OutputRectBlurProfileLookup(GrGLSLFragmentBuilder* fsBuilder, @@ -821,7 +821,7 @@ void GrRectBlurEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrGLRectBlurEffect::GenKey(fPrecision, b); } -GrGLFragmentProcessor* GrRectBlurEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrRectBlurEffect::onCreateGLInstance() const { return new GrGLRectBlurEffect(*this, fPrecision); } @@ -912,7 +912,7 @@ public: float getSigma() const { return fSigma; } private: - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; GrRRectBlurEffect(float sigma, const SkRRect&, GrTexture* profileTexture); @@ -1043,7 +1043,7 @@ const GrFragmentProcessor* GrRRectBlurEffect::TestCreate(GrProcessorTestData* d) ////////////////////////////////////////////////////////////////////////////// -class GrGLRRectBlurEffect : public GrGLFragmentProcessor { +class GrGLRRectBlurEffect : public GrGLSLFragmentProcessor { public: GrGLRRectBlurEffect(const GrProcessor&) {} @@ -1056,7 +1056,7 @@ private: GrGLSLProgramDataManager::UniformHandle fProxyRectUniform; GrGLSLProgramDataManager::UniformHandle fCornerRadiusUniform; GrGLSLProgramDataManager::UniformHandle fBlurRadiusUniform; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; void GrGLRRectBlurEffect::emitCode(EmitArgs& args) { @@ -1135,7 +1135,7 @@ void GrRRectBlurEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorK GrGLRRectBlurEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrRRectBlurEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrRRectBlurEffect::onCreateGLInstance() const { return new GrGLRRectBlurEffect(*this); } diff --git a/src/effects/SkColorCubeFilter.cpp b/src/effects/SkColorCubeFilter.cpp index 3abda5fe48..541f43aab2 100644 --- a/src/effects/SkColorCubeFilter.cpp +++ b/src/effects/SkColorCubeFilter.cpp @@ -18,7 +18,7 @@ #include "GrInvariantOutput.h" #include "GrTexturePriv.h" #include "SkGr.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -175,7 +175,7 @@ public: void onComputeInvariantOutput(GrInvariantOutput*) const override; - class GLProcessor : public GrGLFragmentProcessor { + class GLProcessor : public GrGLSLFragmentProcessor { public: GLProcessor(const GrProcessor&); virtual ~GLProcessor(); @@ -191,14 +191,14 @@ public: GrGLSLProgramDataManager::UniformHandle fColorCubeSizeUni; GrGLSLProgramDataManager::UniformHandle fColorCubeInvSizeUni; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; private: virtual void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override; - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; bool onIsEqual(const GrFragmentProcessor&) const override { return true; } @@ -224,7 +224,7 @@ void GrColorCubeEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorK GLProcessor::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrColorCubeEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrColorCubeEffect::onCreateGLInstance() const { return new GLProcessor(*this); } diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp index fd3200e2cd..bc72b1fa63 100644 --- a/src/effects/SkColorMatrixFilter.cpp +++ b/src/effects/SkColorMatrixFilter.cpp @@ -385,7 +385,7 @@ SkColorFilter* SkColorMatrixFilter::newComposed(const SkColorFilter* innerFilter #if SK_SUPPORT_GPU #include "GrFragmentProcessor.h" #include "GrInvariantOutput.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -400,7 +400,7 @@ public: GR_DECLARE_FRAGMENT_PROCESSOR_TEST; - class GLProcessor : public GrGLFragmentProcessor { + class GLProcessor : public GrGLSLFragmentProcessor { public: // this class always generates the same code. static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {} @@ -458,7 +458,7 @@ public: GrGLSLProgramDataManager::UniformHandle fMatrixHandle; GrGLSLProgramDataManager::UniformHandle fVectorHandle; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; private: @@ -466,7 +466,7 @@ private: this->initClassID<ColorMatrixEffect>(); } - GrGLFragmentProcessor* onCreateGLInstance() const override { return new GLProcessor(*this); } + GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new GLProcessor(*this); } virtual void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override { diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index b9411b2e12..d90e9f3200 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -17,7 +17,7 @@ #include "GrCoordTransform.h" #include "GrInvariantOutput.h" #include "effects/GrTextureDomain.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -304,7 +304,7 @@ void SkDisplacementMapEffect::toString(SkString* str) const { /////////////////////////////////////////////////////////////////////////////// #if SK_SUPPORT_GPU -class GrGLDisplacementMapEffect : public GrGLFragmentProcessor { +class GrGLDisplacementMapEffect : public GrGLSLFragmentProcessor { public: GrGLDisplacementMapEffect(const GrProcessor&); virtual ~GrGLDisplacementMapEffect(); @@ -324,7 +324,7 @@ private: GrGLSLProgramDataManager::UniformHandle fScaleUni; GrTextureDomain::GLDomain fGLDomain; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; /////////////////////////////////////////////////////////////////////////////// @@ -352,7 +352,7 @@ public: const GrTextureDomain& domain() const { return fDomain; } private: - GrGLFragmentProcessor* onCreateGLInstance() const override { + GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new GrGLDisplacementMapEffect(*this); } diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index 1f120c0466..46daea1f4a 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -21,7 +21,7 @@ #include "GrInvariantOutput.h" #include "GrPaint.h" #include "effects/GrSingleTextureEffect.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -531,7 +531,7 @@ public: SkScalar kd() const { return fKD; } private: - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -564,7 +564,7 @@ public: const char* name() const override { return "SpecularLighting"; } - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; SkScalar ks() const { return fKS; } SkScalar shininess() const { return fShininess; } @@ -1508,7 +1508,7 @@ SkString emitNormalFunc(BoundaryMode mode, } -class GrGLLightingEffect : public GrGLFragmentProcessor { +class GrGLLightingEffect : public GrGLSLFragmentProcessor { public: GrGLLightingEffect(const GrProcessor&); virtual ~GrGLLightingEffect(); @@ -1526,7 +1526,7 @@ protected: virtual void emitLightFunc(GrGLSLFPBuilder*, SkString* funcName) = 0; private: - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; UniformHandle fImageIncrementUni; UniformHandle fSurfaceScaleUni; @@ -1619,7 +1619,7 @@ void GrDiffuseLightingEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrGLDiffuseLightingEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrDiffuseLightingEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrDiffuseLightingEffect::onCreateGLInstance() const { return new GrGLDiffuseLightingEffect(*this); } @@ -1820,7 +1820,7 @@ void GrSpecularLightingEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrGLSpecularLightingEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrSpecularLightingEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrSpecularLightingEffect::onCreateGLInstance() const { return new GrGLSpecularLightingEffect(*this); } diff --git a/src/effects/SkLumaColorFilter.cpp b/src/effects/SkLumaColorFilter.cpp index bdedf3b8b7..107331a37a 100644 --- a/src/effects/SkLumaColorFilter.cpp +++ b/src/effects/SkLumaColorFilter.cpp @@ -13,7 +13,7 @@ #if SK_SUPPORT_GPU #include "GrContext.h" #include "GrInvariantOutput.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #endif @@ -61,7 +61,7 @@ public: const char* name() const override { return "Luminance-to-Alpha"; } - class GLProcessor : public GrGLFragmentProcessor { + class GLProcessor : public GrGLSLFragmentProcessor { public: GLProcessor(const GrProcessor&) {} @@ -84,7 +84,7 @@ public: } private: - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; private: @@ -92,7 +92,7 @@ private: this->initClassID<LumaColorFilterEffect>(); } - GrGLFragmentProcessor* onCreateGLInstance() const override { return new GLProcessor(*this); } + GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new GLProcessor(*this); } virtual void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override { diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp index 2d90c44781..6c0b00fe9c 100644 --- a/src/effects/SkMagnifierImageFilter.cpp +++ b/src/effects/SkMagnifierImageFilter.cpp @@ -17,8 +17,7 @@ #if SK_SUPPORT_GPU #include "GrInvariantOutput.h" #include "effects/GrSingleTextureEffect.h" -#include "gl/GrGLFragmentProcessor.h" -#include "gl/GrGLTexture.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -75,7 +74,7 @@ private: this->initClassID<GrMagnifierEffect>(); } - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -99,7 +98,7 @@ private: // For brevity typedef GrGLSLProgramDataManager::UniformHandle UniformHandle; -class GrGLMagnifierEffect : public GrGLFragmentProcessor { +class GrGLMagnifierEffect : public GrGLSLFragmentProcessor { public: GrGLMagnifierEffect(const GrProcessor&); @@ -114,7 +113,7 @@ private: UniformHandle fInvInsetVar; UniformHandle fBoundsVar; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GrGLMagnifierEffect::GrGLMagnifierEffect(const GrProcessor&) { @@ -186,7 +185,7 @@ void GrMagnifierEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrGLMagnifierEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrMagnifierEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrMagnifierEffect::onCreateGLInstance() const { return new GrGLMagnifierEffect(*this); } diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index 1d465edcb5..b0b84908a9 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -19,7 +19,7 @@ #include "GrInvariantOutput.h" #include "GrTexture.h" #include "effects/Gr1DKernelEffect.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -236,7 +236,7 @@ protected: float fRange[2]; private: - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -255,7 +255,7 @@ private: /////////////////////////////////////////////////////////////////////////////// -class GrGLMorphologyEffect : public GrGLFragmentProcessor { +class GrGLMorphologyEffect : public GrGLSLFragmentProcessor { public: GrGLMorphologyEffect(const GrProcessor&); @@ -276,7 +276,7 @@ private: GrGLSLProgramDataManager::UniformHandle fPixelSizeUni; GrGLSLProgramDataManager::UniformHandle fRangeUni; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GrGLMorphologyEffect::GrGLMorphologyEffect(const GrProcessor& proc) { @@ -427,7 +427,7 @@ void GrMorphologyEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessor GrGLMorphologyEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrMorphologyEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrMorphologyEffect::onCreateGLInstance() const { return new GrGLMorphologyEffect(*this); } bool GrMorphologyEffect::onIsEqual(const GrFragmentProcessor& sBase) const { diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp index 045f3beff2..2d4ab8ff2a 100644 --- a/src/effects/SkPerlinNoiseShader.cpp +++ b/src/effects/SkPerlinNoiseShader.cpp @@ -20,7 +20,7 @@ #include "GrInvariantOutput.h" #include "SkGr.h" #include "effects/GrConstColorProcessor.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -484,7 +484,7 @@ void SkPerlinNoiseShader::PerlinNoiseShaderContext::shadeSpan16( #if SK_SUPPORT_GPU -class GrGLPerlinNoise : public GrGLFragmentProcessor { +class GrGLPerlinNoise : public GrGLSLFragmentProcessor { public: GrGLPerlinNoise(const GrProcessor&); virtual ~GrGLPerlinNoise() {} @@ -505,7 +505,7 @@ private: GrGLSLProgramDataManager::UniformHandle fBaseFrequencyUni; private: - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; ///////////////////////////////////////////////////////////////////// @@ -534,7 +534,7 @@ public: const SkMatrix& matrix() const { return fCoordTransform.getMatrix(); } private: - GrGLFragmentProcessor* onCreateGLInstance() const override { + GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new GrGLPerlinNoise(*this); } diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp index 872fdfddc2..55de828cca 100644 --- a/src/effects/SkTableColorFilter.cpp +++ b/src/effects/SkTableColorFilter.cpp @@ -335,7 +335,7 @@ SkColorFilter* SkTable_ColorFilter::newComposed(const SkColorFilter* innerFilter #include "GrInvariantOutput.h" #include "SkGr.h" #include "effects/GrTextureStripAtlas.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -352,7 +352,7 @@ public: int atlasRow() const { return fRow; } private: - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -375,7 +375,7 @@ private: typedef GrFragmentProcessor INHERITED; }; -class GLColorTableEffect : public GrGLFragmentProcessor { +class GLColorTableEffect : public GrGLSLFragmentProcessor { public: GLColorTableEffect(const GrProcessor&); @@ -388,7 +388,7 @@ protected: private: UniformHandle fRGBAYValuesUni; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GLColorTableEffect::GLColorTableEffect(const GrProcessor&) { @@ -506,7 +506,7 @@ void ColorTableEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GLColorTableEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* ColorTableEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* ColorTableEffect::onCreateGLInstance() const { return new GLColorTableEffect(*this); } diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h index a295b5cf93..003191d397 100644 --- a/src/effects/gradients/SkGradientShaderPriv.h +++ b/src/effects/gradients/SkGradientShaderPriv.h @@ -296,7 +296,7 @@ static inline int next_dither_toggle16(int toggle) { #include "GrCoordTransform.h" #include "GrFragmentProcessor.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLProgramDataManager.h" class GrInvariantOutput; @@ -396,7 +396,7 @@ private: /////////////////////////////////////////////////////////////////////////////// // Base class for GL gradient effects -class GrGLGradientEffect : public GrGLFragmentProcessor { +class GrGLGradientEffect : public GrGLSLFragmentProcessor { public: GrGLGradientEffect(); virtual ~GrGLGradientEffect(); @@ -450,7 +450,7 @@ private: GrGLSLProgramDataManager::UniformHandle fColorMidUni; GrGLSLProgramDataManager::UniformHandle fColorEndUni; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; #endif diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp index 11c79f0956..1726bb6d59 100644 --- a/src/effects/gradients/SkLinearGradient.cpp +++ b/src/effects/gradients/SkLinearGradient.cpp @@ -487,7 +487,7 @@ private: this->initClassID<GrLinearGradient>(); } - GrGLFragmentProcessor* onCreateGLInstance() const override { + GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new GrGLLinearGradient(*this); } diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp index a9cdb2a912..05adcb1cb7 100644 --- a/src/effects/gradients/SkRadialGradient.cpp +++ b/src/effects/gradients/SkRadialGradient.cpp @@ -459,7 +459,7 @@ private: this->initClassID<GrRadialGradient>(); } - GrGLFragmentProcessor* onCreateGLInstance() const override { + GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new GrGLRadialGradient(*this); } diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp index 172c7d152a..71e8957fd8 100644 --- a/src/effects/gradients/SkSweepGradient.cpp +++ b/src/effects/gradients/SkSweepGradient.cpp @@ -208,7 +208,7 @@ private: this->initClassID<GrSweepGradient>(); } - GrGLFragmentProcessor* onCreateGLInstance() const override { + GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new GrGLSweepGradient(*this); } diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp index dec3e96bdb..fef8b43ba1 100644 --- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp +++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp @@ -79,7 +79,7 @@ public: SkScalar radius() const { return fRadius0; } private: - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -174,7 +174,7 @@ void Edge2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GLEdge2PtConicalEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* Edge2PtConicalEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* Edge2PtConicalEffect::onCreateGLInstance() const { return new GLEdge2PtConicalEffect(*this); } @@ -385,7 +385,7 @@ public: SkScalar focal() const { return fFocalX; } private: - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -451,7 +451,7 @@ void FocalOutside2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GLFocalOutside2PtConicalEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* FocalOutside2PtConicalEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* FocalOutside2PtConicalEffect::onCreateGLInstance() const { return new GLFocalOutside2PtConicalEffect(*this); } @@ -595,7 +595,7 @@ public: typedef GLFocalInside2PtConicalEffect GLProcessor; private: - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -655,7 +655,7 @@ void FocalInside2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GLFocalInside2PtConicalEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* FocalInside2PtConicalEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* FocalInside2PtConicalEffect::onCreateGLInstance() const { return new GLFocalInside2PtConicalEffect(*this); } @@ -828,7 +828,7 @@ public: SkScalar C() const { return fInfo.fC; } private: - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; virtual void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override; @@ -897,7 +897,7 @@ void CircleInside2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GLCircleInside2PtConicalEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* CircleInside2PtConicalEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* CircleInside2PtConicalEffect::onCreateGLInstance() const { return new GLCircleInside2PtConicalEffect(*this); } @@ -1040,7 +1040,7 @@ public: bool isFlipped() const { return fIsFlipped; } private: - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -1122,7 +1122,7 @@ void CircleOutside2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GLCircleOutside2PtConicalEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* CircleOutside2PtConicalEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* CircleOutside2PtConicalEffect::onCreateGLInstance() const { return new GLCircleOutside2PtConicalEffect(*this); } diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp index 6c73c361ca..4ce5b0d5fc 100644 --- a/src/gpu/GrDefaultGeoProcFactory.cpp +++ b/src/gpu/GrDefaultGeoProcFactory.cpp @@ -9,10 +9,10 @@ #include "GrInvariantOutput.h" #include "gl/GrGLGeometryProcessor.h" -#include "gl/GrGLUtil.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLVertexShaderBuilder.h" +#include "glsl/GrGLSLUtil.h" /* * The default Geometry Processor simply takes position and multiplies it by the uniform view @@ -140,7 +140,7 @@ public: if (!dgp.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dgp.viewMatrix())) { fViewMatrix = dgp.viewMatrix(); float viewMatrix[3 * 3]; - GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix); pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); } diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp index 9b5677ae8f..37416399b2 100644 --- a/src/gpu/GrFragmentProcessor.cpp +++ b/src/gpu/GrFragmentProcessor.cpp @@ -8,7 +8,7 @@ #include "GrFragmentProcessor.h" #include "GrCoordTransform.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -50,8 +50,8 @@ bool GrFragmentProcessor::isEqual(const GrFragmentProcessor& that, return true; } -GrGLFragmentProcessor* GrFragmentProcessor::createGLInstance() const { - GrGLFragmentProcessor* glFragProc = this->onCreateGLInstance(); +GrGLSLFragmentProcessor* GrFragmentProcessor::createGLInstance() const { + GrGLSLFragmentProcessor* glFragProc = this->onCreateGLInstance(); glFragProc->fChildProcessors.push_back_n(fChildProcessors.count()); for (int i = 0; i < fChildProcessors.count(); ++i) { glFragProc->fChildProcessors[i] = fChildProcessors[i]->createGLInstance(); @@ -147,8 +147,8 @@ const GrFragmentProcessor* GrFragmentProcessor::MulOutputByInputUnpremulColor( const char* name() const override { return "Premultiply"; } private: - GrGLFragmentProcessor* onCreateGLInstance() const override { - class GLFP : public GrGLFragmentProcessor { + GrGLSLFragmentProcessor* onCreateGLInstance() const override { + class GLFP : public GrGLSLFragmentProcessor { public: GLFP() {} @@ -220,8 +220,8 @@ const GrFragmentProcessor* GrFragmentProcessor::OverrideInput(const GrFragmentPr const char* name() const override { return "Replace Color"; } - GrGLFragmentProcessor* onCreateGLInstance() const override { - class GLFP : public GrGLFragmentProcessor { + GrGLSLFragmentProcessor* onCreateGLInstance() const override { + class GLFP : public GrGLSLFragmentProcessor { public: GLFP() : fHaveSetColor(false) {} void emitCode(EmitArgs& args) override { @@ -297,8 +297,8 @@ const GrFragmentProcessor* GrFragmentProcessor::RunInSeries(const GrFragmentProc const char* name() const override { return "Series"; } - GrGLFragmentProcessor* onCreateGLInstance() const override { - class GLFP : public GrGLFragmentProcessor { + GrGLSLFragmentProcessor* onCreateGLInstance() const override { + class GLFP : public GrGLSLFragmentProcessor { public: GLFP() {} void emitCode(EmitArgs& args) override { diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp index c5d807c8e8..ec79a95e5d 100644 --- a/src/gpu/GrOvalRenderer.cpp +++ b/src/gpu/GrOvalRenderer.cpp @@ -21,12 +21,12 @@ #include "SkTLazy.h" #include "batches/GrVertexBatch.h" #include "effects/GrRRectEffect.h" -#include "gl/GrGLUtil.h" #include "gl/GrGLGeometryProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" #include "glsl/GrGLSLVertexShaderBuilder.h" +#include "glsl/GrGLSLUtil.h" // TODO(joshualitt) - Break this file up during GrBatch post implementation cleanup @@ -507,7 +507,7 @@ public: if (!dee.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dee.viewMatrix())) { fViewMatrix = dee.viewMatrix(); float viewMatrix[3 * 3]; - GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix); pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); } diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp index febf18fbd2..d57861d29a 100644 --- a/src/gpu/effects/GrBezierEffect.cpp +++ b/src/gpu/effects/GrBezierEffect.cpp @@ -7,11 +7,11 @@ #include "GrBezierEffect.h" -#include "gl/GrGLFragmentProcessor.h" #include "gl/GrGLGeometryProcessor.h" -#include "gl/GrGLUtil.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" +#include "glsl/GrGLSLUtil.h" class GrGLConicEffect : public GrGLGeometryProcessor { public: @@ -30,7 +30,7 @@ public: if (!ce.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(ce.viewMatrix())) { fViewMatrix = ce.viewMatrix(); float viewMatrix[3 * 3]; - GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix); pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); } @@ -246,7 +246,7 @@ public: if (!qe.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(qe.viewMatrix())) { fViewMatrix = qe.viewMatrix(); float viewMatrix[3 * 3]; - GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix); pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); } @@ -448,7 +448,7 @@ public: if (!ce.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(ce.viewMatrix())) { fViewMatrix = ce.viewMatrix(); float viewMatrix[3 * 3]; - GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix); pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); } diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp index 2857641edc..dedb92740f 100644 --- a/src/gpu/effects/GrBicubicEffect.cpp +++ b/src/gpu/effects/GrBicubicEffect.cpp @@ -21,7 +21,7 @@ const SkScalar GrBicubicEffect::gMitchellCoefficients[16] = { }; -class GrGLBicubicEffect : public GrGLFragmentProcessor { +class GrGLBicubicEffect : public GrGLSLFragmentProcessor { public: GrGLBicubicEffect(const GrProcessor&); @@ -43,7 +43,7 @@ private: UniformHandle fImageIncrementUni; GrTextureDomain::GLDomain fDomain; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GrGLBicubicEffect::GrGLBicubicEffect(const GrProcessor&) { @@ -157,7 +157,7 @@ void GrBicubicEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrGLBicubicEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrBicubicEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrBicubicEffect::onCreateGLInstance() const { return new GrGLBicubicEffect(*this); } diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h index 5a54cc167d..67569d8855 100644 --- a/src/gpu/effects/GrBicubicEffect.h +++ b/src/gpu/effects/GrBicubicEffect.h @@ -10,7 +10,7 @@ #include "GrSingleTextureEffect.h" #include "GrTextureDomain.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" class GrGLBicubicEffect; class GrInvariantOutput; @@ -87,7 +87,7 @@ private: GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], const SkMatrix &matrix, const SkRect& domain); - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp index 21dd5e7265..7b179244a1 100644 --- a/src/gpu/effects/GrBitmapTextGeoProc.cpp +++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp @@ -8,9 +8,8 @@ #include "GrBitmapTextGeoProc.h" #include "GrInvariantOutput.h" #include "GrTexture.h" -#include "gl/GrGLFragmentProcessor.h" -#include "gl/GrGLTexture.h" #include "gl/GrGLGeometryProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp index 160773d81e..0273858a3b 100644 --- a/src/gpu/effects/GrConfigConversionEffect.cpp +++ b/src/gpu/effects/GrConfigConversionEffect.cpp @@ -11,11 +11,11 @@ #include "GrInvariantOutput.h" #include "GrSimpleTextureEffect.h" #include "SkMatrix.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" -class GrGLConfigConversionEffect : public GrGLFragmentProcessor { +class GrGLConfigConversionEffect : public GrGLSLFragmentProcessor { public: GrGLConfigConversionEffect(const GrProcessor& processor) { const GrConfigConversionEffect& configConversionEffect = @@ -91,7 +91,7 @@ private: bool fSwapRedAndBlue; GrConfigConversionEffect::PMConversion fPMConversion; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; @@ -147,7 +147,7 @@ void GrConfigConversionEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrGLConfigConversionEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrConfigConversionEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrConfigConversionEffect::onCreateGLInstance() const { return new GrGLConfigConversionEffect(*this); } diff --git a/src/gpu/effects/GrConfigConversionEffect.h b/src/gpu/effects/GrConfigConversionEffect.h index cf2fea3640..bf13afb01d 100644 --- a/src/gpu/effects/GrConfigConversionEffect.h +++ b/src/gpu/effects/GrConfigConversionEffect.h @@ -56,7 +56,7 @@ private: PMConversion pmConversion, const SkMatrix& matrix); - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; diff --git a/src/gpu/effects/GrConstColorProcessor.cpp b/src/gpu/effects/GrConstColorProcessor.cpp index 5440dd3125..09aa75dba0 100644 --- a/src/gpu/effects/GrConstColorProcessor.cpp +++ b/src/gpu/effects/GrConstColorProcessor.cpp @@ -6,12 +6,12 @@ */ #include "effects/GrConstColorProcessor.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" -class GLConstColorProcessor : public GrGLFragmentProcessor { +class GLConstColorProcessor : public GrGLSLFragmentProcessor { public: GLConstColorProcessor() : fPrevColor(GrColor_ILLEGAL) {} @@ -63,7 +63,7 @@ private: GrGLSLProgramDataManager::UniformHandle fColorUniform; GrColor fPrevColor; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; /////////////////////////////////////////////////////////////////////////////// @@ -96,7 +96,7 @@ void GrConstColorProcessor::onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKe b->add32(fMode); } -GrGLFragmentProcessor* GrConstColorProcessor::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrConstColorProcessor::onCreateGLInstance() const { return new GLConstColorProcessor; } diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp index c373b041fe..3beecb42b0 100644 --- a/src/gpu/effects/GrConvexPolyEffect.cpp +++ b/src/gpu/effects/GrConvexPolyEffect.cpp @@ -8,8 +8,7 @@ #include "GrConvexPolyEffect.h" #include "GrInvariantOutput.h" #include "SkPathPriv.h" -#include "gl/GrGLContext.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -36,7 +35,7 @@ private: this->setWillReadFragmentPosition(); } - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; bool onIsEqual(const GrFragmentProcessor& other) const override { const AARectEffect& aare = other.cast<AARectEffect>(); @@ -80,7 +79,7 @@ const GrFragmentProcessor* AARectEffect::TestCreate(GrProcessorTestData* d) { ////////////////////////////////////////////////////////////////////////////// -class GLAARectEffect : public GrGLFragmentProcessor { +class GLAARectEffect : public GrGLSLFragmentProcessor { public: GLAARectEffect(const GrProcessor&); @@ -94,7 +93,7 @@ protected: private: GrGLSLProgramDataManager::UniformHandle fRectUniform; SkRect fPrevRect; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GLAARectEffect::GLAARectEffect(const GrProcessor& effect) { @@ -161,13 +160,13 @@ void AARectEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBui GLAARectEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* AARectEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* AARectEffect::onCreateGLInstance() const { return new GLAARectEffect(*this); } ////////////////////////////////////////////////////////////////////////////// -class GrGLConvexPolyEffect : public GrGLFragmentProcessor { +class GrGLConvexPolyEffect : public GrGLSLFragmentProcessor { public: GrGLConvexPolyEffect(const GrProcessor&); @@ -181,7 +180,7 @@ protected: private: GrGLSLProgramDataManager::UniformHandle fEdgeUniform; SkScalar fPrevEdges[3 * GrConvexPolyEffect::kMaxEdges]; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GrGLConvexPolyEffect::GrGLConvexPolyEffect(const GrProcessor&) { @@ -309,7 +308,7 @@ void GrConvexPolyEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrGLConvexPolyEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrConvexPolyEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrConvexPolyEffect::onCreateGLInstance() const { return new GrGLConvexPolyEffect(*this); } diff --git a/src/gpu/effects/GrConvexPolyEffect.h b/src/gpu/effects/GrConvexPolyEffect.h index 9e7f1542c2..6622ca38ff 100644 --- a/src/gpu/effects/GrConvexPolyEffect.h +++ b/src/gpu/effects/GrConvexPolyEffect.h @@ -72,7 +72,7 @@ public: private: GrConvexPolyEffect(GrPrimitiveEdgeType edgeType, int n, const SkScalar edges[]); - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp index 5367b27902..55b44b7f56 100644 --- a/src/gpu/effects/GrConvolutionEffect.cpp +++ b/src/gpu/effects/GrConvolutionEffect.cpp @@ -6,8 +6,7 @@ */ #include "GrConvolutionEffect.h" -#include "gl/GrGLFragmentProcessor.h" -#include "gl/GrGLTexture.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -15,7 +14,7 @@ // For brevity typedef GrGLSLProgramDataManager::UniformHandle UniformHandle; -class GrGLConvolutionEffect : public GrGLFragmentProcessor { +class GrGLConvolutionEffect : public GrGLSLFragmentProcessor { public: GrGLConvolutionEffect(const GrProcessor&); @@ -38,7 +37,7 @@ private: UniformHandle fImageIncrementUni; UniformHandle fBoundsUni; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GrGLConvolutionEffect::GrGLConvolutionEffect(const GrProcessor& processor) { @@ -200,7 +199,7 @@ void GrConvolutionEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrGLConvolutionEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrConvolutionEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrConvolutionEffect::onCreateGLInstance() const { return new GrGLConvolutionEffect(*this); } diff --git a/src/gpu/effects/GrConvolutionEffect.h b/src/gpu/effects/GrConvolutionEffect.h index 9db173a8ca..0396415b6f 100644 --- a/src/gpu/effects/GrConvolutionEffect.h +++ b/src/gpu/effects/GrConvolutionEffect.h @@ -80,7 +80,7 @@ private: bool useBounds, float bounds[2]); - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp index 574310c49c..e54627c4e5 100644 --- a/src/gpu/effects/GrCustomXfermode.cpp +++ b/src/gpu/effects/GrCustomXfermode.cpp @@ -15,12 +15,10 @@ #include "GrTexture.h" #include "GrTextureAccess.h" #include "SkXfermode.h" -#include "gl/GrGLCaps.h" -#include "gl/GrGLGpu.h" -#include "gl/GrGLSLBlend.h" -#include "gl/GrGLFragmentProcessor.h" -#include "gl/GrGLProgramDataManager.h" +#include "gl/GrGLXferProcessor.h" +#include "glsl/GrGLSLBlend.h" #include "glsl/GrGLSLCaps.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp index 3fa3014a9d..612e976f86 100644 --- a/src/gpu/effects/GrDashingEffect.cpp +++ b/src/gpu/effects/GrDashingEffect.cpp @@ -22,7 +22,7 @@ #include "SkGr.h" #include "batches/GrVertexBatch.h" #include "gl/GrGLGeometryProcessor.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp index 90a0898686..a43171a2af 100644 --- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp +++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp @@ -11,13 +11,13 @@ #include "SkDistanceFieldGen.h" -#include "gl/GrGLFragmentProcessor.h" -#include "gl/GrGLTexture.h" #include "gl/GrGLGeometryProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" #include "glsl/GrGLSLVertexShaderBuilder.h" +#include "glsl/GrGLSLUtil.h" // Assuming a radius of a little less than the diagonal of the fragment #define SK_DistanceFieldAAFactor "0.65" @@ -160,7 +160,7 @@ public: if (!dfa8gp.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dfa8gp.viewMatrix())) { fViewMatrix = dfa8gp.viewMatrix(); float viewMatrix[3 * 3]; - GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix); pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); } @@ -390,7 +390,7 @@ public: if (!dfpgp.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dfpgp.viewMatrix())) { fViewMatrix = dfpgp.viewMatrix(); float viewMatrix[3 * 3]; - GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix); pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); } @@ -659,7 +659,7 @@ public: if (!dflcd.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dflcd.viewMatrix())) { fViewMatrix = dflcd.viewMatrix(); float viewMatrix[3 * 3]; - GrGLGetMatrix<3>(viewMatrix, fViewMatrix); + GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix); pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); } diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp index fb02da5544..692d873bf1 100644 --- a/src/gpu/effects/GrDitherEffect.cpp +++ b/src/gpu/effects/GrDitherEffect.cpp @@ -9,7 +9,7 @@ #include "GrFragmentProcessor.h" #include "GrInvariantOutput.h" #include "SkRect.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" @@ -31,7 +31,7 @@ private: this->setWillReadFragmentPosition(); } - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -59,14 +59,14 @@ const GrFragmentProcessor* DitherEffect::TestCreate(GrProcessorTestData*) { ////////////////////////////////////////////////////////////////////////////// -class GLDitherEffect : public GrGLFragmentProcessor { +class GLDitherEffect : public GrGLSLFragmentProcessor { public: GLDitherEffect(const GrProcessor&); virtual void emitCode(EmitArgs& args) override; private: - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GLDitherEffect::GLDitherEffect(const GrProcessor&) { @@ -97,7 +97,7 @@ void DitherEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GLDitherEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* DitherEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* DitherEffect::onCreateGLInstance() const { return new GLDitherEffect(*this); } diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp index 358f8082f2..98611f9ae0 100644 --- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp +++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp @@ -5,12 +5,11 @@ * found in the LICENSE file. */ #include "GrMatrixConvolutionEffect.h" -#include "gl/GrGLFragmentProcessor.h" -#include "gl/GrGLTexture.h" -#include "gl/builders/GrGLProgramBuilder.h" +#include "glsl/GrGLSLFragmentProcessor.h" +#include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" -class GrGLMatrixConvolutionEffect : public GrGLFragmentProcessor { +class GrGLMatrixConvolutionEffect : public GrGLSLFragmentProcessor { public: GrGLMatrixConvolutionEffect(const GrProcessor&); virtual void emitCode(EmitArgs&) override; @@ -32,7 +31,7 @@ private: UniformHandle fBiasUni; GrTextureDomain::GLDomain fDomain; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GrGLMatrixConvolutionEffect::GrGLMatrixConvolutionEffect(const GrProcessor& processor) { @@ -43,18 +42,18 @@ GrGLMatrixConvolutionEffect::GrGLMatrixConvolutionEffect(const GrProcessor& proc void GrGLMatrixConvolutionEffect::emitCode(EmitArgs& args) { const GrTextureDomain& domain = args.fFp.cast<GrMatrixConvolutionEffect>().domain(); - fImageIncrementUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility, + fImageIncrementUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, kVec2f_GrSLType, kDefault_GrSLPrecision, "ImageIncrement"); - fKernelUni = args.fBuilder->addUniformArray(GrGLProgramBuilder::kFragment_Visibility, + fKernelUni = args.fBuilder->addUniformArray(GrGLSLProgramBuilder::kFragment_Visibility, kFloat_GrSLType, kDefault_GrSLPrecision, "Kernel", fKernelSize.width() * fKernelSize.height()); - fKernelOffsetUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility, + fKernelOffsetUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, kVec2f_GrSLType, kDefault_GrSLPrecision, "KernelOffset"); - fGainUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility, + fGainUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, kFloat_GrSLType, kDefault_GrSLPrecision, "Gain"); - fBiasUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility, + fBiasUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility, kFloat_GrSLType, kDefault_GrSLPrecision, "Bias"); const char* kernelOffset = args.fBuilder->getUniformCStr(fKernelOffsetUni); @@ -161,7 +160,7 @@ void GrMatrixConvolutionEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrGLMatrixConvolutionEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrMatrixConvolutionEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrMatrixConvolutionEffect::onCreateGLInstance() const { return new GrGLMatrixConvolutionEffect(*this); } diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.h b/src/gpu/effects/GrMatrixConvolutionEffect.h index 3f16edb0ec..6f6ca9d0ff 100644 --- a/src/gpu/effects/GrMatrixConvolutionEffect.h +++ b/src/gpu/effects/GrMatrixConvolutionEffect.h @@ -66,7 +66,7 @@ private: GrTextureDomain::Mode tileMode, bool convolveAlpha); - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp index d34edbb726..16e1c099dd 100644 --- a/src/gpu/effects/GrOvalEffect.cpp +++ b/src/gpu/effects/GrOvalEffect.cpp @@ -10,7 +10,7 @@ #include "GrFragmentProcessor.h" #include "GrInvariantOutput.h" #include "SkRect.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -33,7 +33,7 @@ public: private: CircleEffect(GrPrimitiveEdgeType, const SkPoint& center, SkScalar radius); - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -91,7 +91,7 @@ const GrFragmentProcessor* CircleEffect::TestCreate(GrProcessorTestData* d) { ////////////////////////////////////////////////////////////////////////////// -class GLCircleEffect : public GrGLFragmentProcessor { +class GLCircleEffect : public GrGLSLFragmentProcessor { public: GLCircleEffect(const GrProcessor&); @@ -107,7 +107,7 @@ private: SkPoint fPrevCenter; SkScalar fPrevRadius; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GLCircleEffect::GLCircleEffect(const GrProcessor&) { @@ -179,7 +179,7 @@ void CircleEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GLCircleEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* CircleEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* CircleEffect::onCreateGLInstance() const { return new GLCircleEffect(*this); } @@ -202,7 +202,7 @@ public: private: EllipseEffect(GrPrimitiveEdgeType, const SkPoint& center, SkScalar rx, SkScalar ry); - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -263,7 +263,7 @@ const GrFragmentProcessor* EllipseEffect::TestCreate(GrProcessorTestData* d) { ////////////////////////////////////////////////////////////////////////////// -class GLEllipseEffect : public GrGLFragmentProcessor { +class GLEllipseEffect : public GrGLSLFragmentProcessor { public: GLEllipseEffect(const GrProcessor&); @@ -279,7 +279,7 @@ private: SkPoint fPrevCenter; SkVector fPrevRadii; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GLEllipseEffect::GLEllipseEffect(const GrProcessor& effect) { @@ -356,7 +356,7 @@ void EllipseEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GLEllipseEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* EllipseEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* EllipseEffect::onCreateGLInstance() const { return new GLEllipseEffect(*this); } diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp index 650a1e7622..78d0f14d7b 100644 --- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp +++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp @@ -13,8 +13,8 @@ #include "GrProcOptInfo.h" #include "GrTypes.h" #include "GrXferProcessor.h" -#include "gl/GrGLSLBlend.h" #include "gl/GrGLXferProcessor.h" +#include "glsl/GrGLSLBlend.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp index 398edccb64..8b3b83dda8 100644 --- a/src/gpu/effects/GrRRectEffect.cpp +++ b/src/gpu/effects/GrRRectEffect.cpp @@ -12,7 +12,7 @@ #include "GrInvariantOutput.h" #include "GrOvalEffect.h" #include "SkRRect.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -60,7 +60,7 @@ public: private: CircularRRectEffect(GrPrimitiveEdgeType, uint32_t circularCornerFlags, const SkRRect&); - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -126,7 +126,7 @@ const GrFragmentProcessor* CircularRRectEffect::TestCreate(GrProcessorTestData* ////////////////////////////////////////////////////////////////////////////// -class GLCircularRRectEffect : public GrGLFragmentProcessor { +class GLCircularRRectEffect : public GrGLSLFragmentProcessor { public: GLCircularRRectEffect(const GrProcessor&); @@ -141,7 +141,7 @@ private: GrGLSLProgramDataManager::UniformHandle fInnerRectUniform; GrGLSLProgramDataManager::UniformHandle fRadiusPlusHalfUniform; SkRRect fPrevRRect; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GLCircularRRectEffect::GLCircularRRectEffect(const GrProcessor& ) { @@ -369,7 +369,7 @@ void CircularRRectEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GLCircularRRectEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* CircularRRectEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* CircularRRectEffect::onCreateGLInstance() const { return new GLCircularRRectEffect(*this); } @@ -390,7 +390,7 @@ public: private: EllipticalRRectEffect(GrPrimitiveEdgeType, const SkRRect&); - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; @@ -472,7 +472,7 @@ const GrFragmentProcessor* EllipticalRRectEffect::TestCreate(GrProcessorTestData ////////////////////////////////////////////////////////////////////////////// -class GLEllipticalRRectEffect : public GrGLFragmentProcessor { +class GLEllipticalRRectEffect : public GrGLSLFragmentProcessor { public: GLEllipticalRRectEffect(const GrProcessor&); @@ -487,7 +487,7 @@ private: GrGLSLProgramDataManager::UniformHandle fInnerRectUniform; GrGLSLProgramDataManager::UniformHandle fInvRadiiSqdUniform; SkRRect fPrevRRect; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GLEllipticalRRectEffect::GLEllipticalRRectEffect(const GrProcessor& effect) { @@ -620,7 +620,7 @@ void EllipticalRRectEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GLEllipticalRRectEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* EllipticalRRectEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* EllipticalRRectEffect::onCreateGLInstance() const { return new GLEllipticalRRectEffect(*this); } diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp index c1bc6dff30..0b03c99811 100644 --- a/src/gpu/effects/GrSimpleTextureEffect.cpp +++ b/src/gpu/effects/GrSimpleTextureEffect.cpp @@ -8,13 +8,11 @@ #include "GrSimpleTextureEffect.h" #include "GrInvariantOutput.h" #include "GrTexture.h" -#include "gl/GrGLCaps.h" -#include "gl/GrGLFragmentProcessor.h" -#include "gl/GrGLTexture.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" -class GrGLSimpleTextureEffect : public GrGLFragmentProcessor { +class GrGLSimpleTextureEffect : public GrGLSLFragmentProcessor { public: GrGLSimpleTextureEffect(const GrProcessor&) {} @@ -29,7 +27,7 @@ public: } private: - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; /////////////////////////////////////////////////////////////////////////////// @@ -43,7 +41,7 @@ void GrSimpleTextureEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrGLSimpleTextureEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrSimpleTextureEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrSimpleTextureEffect::onCreateGLInstance() const { return new GrGLSimpleTextureEffect(*this); } diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h index 4e5b421f3e..e421162120 100644 --- a/src/gpu/effects/GrSimpleTextureEffect.h +++ b/src/gpu/effects/GrSimpleTextureEffect.h @@ -63,7 +63,7 @@ private: this->initClassID<GrSimpleTextureEffect>(); } - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp index cd89a59ac8..42d6d70816 100644 --- a/src/gpu/effects/GrTextureDomain.cpp +++ b/src/gpu/effects/GrTextureDomain.cpp @@ -9,8 +9,7 @@ #include "GrInvariantOutput.h" #include "GrSimpleTextureEffect.h" #include "SkFloatingPoint.h" -#include "gl/GrGLContext.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" #include "glsl/GrGLSLTextureSampler.h" @@ -173,7 +172,7 @@ void GrTextureDomain::GLDomain::setData(const GrGLSLProgramDataManager& pdman, ////////////////////////////////////////////////////////////////////////////// -class GrGLTextureDomainEffect : public GrGLFragmentProcessor { +class GrGLTextureDomainEffect : public GrGLSLFragmentProcessor { public: GrGLTextureDomainEffect(const GrProcessor&); @@ -186,7 +185,7 @@ protected: private: GrTextureDomain::GLDomain fGLDomain; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; GrGLTextureDomainEffect::GrGLTextureDomainEffect(const GrProcessor&) { @@ -253,7 +252,7 @@ void GrTextureDomainEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrGLTextureDomainEffect::GenKey(*this, caps, b); } -GrGLFragmentProcessor* GrTextureDomainEffect::onCreateGLInstance() const { +GrGLSLFragmentProcessor* GrTextureDomainEffect::onCreateGLInstance() const { return new GrGLTextureDomainEffect(*this); } diff --git a/src/gpu/effects/GrTextureDomain.h b/src/gpu/effects/GrTextureDomain.h index 874cdbc080..a215def4ea 100644 --- a/src/gpu/effects/GrTextureDomain.h +++ b/src/gpu/effects/GrTextureDomain.h @@ -9,7 +9,7 @@ #define GrTextureDomainEffect_DEFINED #include "GrSingleTextureEffect.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLProgramDataManager.h" class GrGLProgramBuilder; @@ -89,7 +89,7 @@ public: } /** - * A GrGLFragmentProcessor subclass that corresponds to a GrProcessor subclass that uses + * A GrGLSLFragmentProcessor subclass that corresponds to a GrProcessor subclass that uses * GrTextureDomain should include this helper. It generates the texture domain GLSL, produces * the part of the effect key that reflects the texture domain code, and performs the uniform * uploads necessary for texture domains. @@ -104,8 +104,8 @@ public: } /** - * Call this from GrGLFragmentProcessor::emitCode() to sample the texture W.R.T. the domain - * and mode. + * Call this from GrGLSLFragmentProcessor::emitCode() to sample the texture W.R.T. the + * domain and mode. * * @param outcolor name of vec4 variable to hold the sampled color. * @param inCoords name of vec2 variable containing the coords to be used with the domain. @@ -121,7 +121,7 @@ public: const char* inModulateColor = nullptr); /** - * Call this from GrGLFragmentProcessor::setData() to upload uniforms necessary for the + * Call this from GrGLSLFragmentProcessor::setData() to upload uniforms necessary for the * texture domain. The rectangle is automatically adjusted to account for the texture's * origin. */ @@ -133,7 +133,7 @@ public: }; /** - * GrGLFragmentProcessor::GenKey() must call this and include the returned value in it's + * GrGLSLFragmentProcessor::GenKey() must call this and include the returned value in it's * computed key. The returned will be limited to the lower kDomainKeyBits bits. */ static uint32_t DomainKey(const GrTextureDomain& domain) { @@ -187,7 +187,7 @@ private: GrTextureParams::FilterMode, GrCoordSet); - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override; diff --git a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp index 0dbb6eb534..a705df5e61 100644 --- a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp +++ b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp @@ -9,8 +9,8 @@ #include "GrFragmentProcessor.h" #include "effects/GrConstColorProcessor.h" -#include "gl/GrGLFragmentProcessor.h" -#include "gl/GrGLSLBlend.h" +#include "glsl/GrGLSLFragmentProcessor.h" +#include "glsl/GrGLSLBlend.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "SkGrPriv.h" @@ -46,7 +46,7 @@ protected: } private: - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; SkXfermode::Mode fMode; @@ -57,14 +57,14 @@ private: ///////////////////////////////////////////////////////////////////// -class GLComposeTwoFragmentProcessor : public GrGLFragmentProcessor { +class GLComposeTwoFragmentProcessor : public GrGLSLFragmentProcessor { public: GLComposeTwoFragmentProcessor(const GrProcessor& processor) {} void emitCode(EmitArgs&) override; private: - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; ///////////////////////////////////////////////////////////////////// @@ -81,7 +81,7 @@ const GrFragmentProcessor* ComposeTwoFragmentProcessor::TestCreate(GrProcessorTe return new ComposeTwoFragmentProcessor(fpA, fpB, mode); } -GrGLFragmentProcessor* ComposeTwoFragmentProcessor::onCreateGLInstance() const{ +GrGLSLFragmentProcessor* ComposeTwoFragmentProcessor::onCreateGLInstance() const{ return new GLComposeTwoFragmentProcessor(*this); } @@ -202,7 +202,7 @@ protected: } private: - GrGLFragmentProcessor* onCreateGLInstance() const override; + GrGLSLFragmentProcessor* onCreateGLInstance() const override; SkXfermode::Mode fMode; Child fChild; @@ -214,7 +214,7 @@ private: ////////////////////////////////////////////////////////////////////////////// -class GLComposeOneFragmentProcessor : public GrGLFragmentProcessor { +class GLComposeOneFragmentProcessor : public GrGLSLFragmentProcessor { public: GLComposeOneFragmentProcessor(const GrProcessor& processor) {} @@ -244,7 +244,7 @@ public: } private: - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; ///////////////////////////////////////////////////////////////////// @@ -264,7 +264,7 @@ const GrFragmentProcessor* ComposeOneFragmentProcessor::TestCreate(GrProcessorTe return new ComposeOneFragmentProcessor(dst, mode, child); } -GrGLFragmentProcessor* ComposeOneFragmentProcessor::onCreateGLInstance() const { +GrGLSLFragmentProcessor* ComposeOneFragmentProcessor::onCreateGLInstance() const { return new GLComposeOneFragmentProcessor(*this); } diff --git a/src/gpu/effects/GrYUVtoRGBEffect.cpp b/src/gpu/effects/GrYUVtoRGBEffect.cpp index daf1ca3796..e2825125e8 100644 --- a/src/gpu/effects/GrYUVtoRGBEffect.cpp +++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp @@ -10,7 +10,7 @@ #include "GrCoordTransform.h" #include "GrInvariantOutput.h" #include "GrProcessor.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -52,7 +52,7 @@ public: return fColorSpace; } - class GLProcessor : public GrGLFragmentProcessor { + class GLProcessor : public GrGLSLFragmentProcessor { public: static const float kJPEGConversionMatrix[16]; static const float kRec601ConversionMatrix[16]; @@ -102,7 +102,7 @@ public: private: GrGLSLProgramDataManager::UniformHandle fMatrixUni; - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; private: @@ -125,7 +125,7 @@ private: this->addTextureAccess(&fVAccess); } - GrGLFragmentProcessor* onCreateGLInstance() const override { return new GLProcessor(*this); } + GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new GLProcessor(*this); } virtual void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override { diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp index 84794ac1cc..d5f2b9d23d 100644 --- a/src/gpu/gl/GrGLGpuProgramCache.cpp +++ b/src/gpu/gl/GrGLGpuProgramCache.cpp @@ -9,8 +9,8 @@ #include "builders/GrGLProgramBuilder.h" #include "GrProcessor.h" -#include "GrGLFragmentProcessor.h" #include "GrGLPathRendering.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLProgramDataManager.h" #include "SkRTConf.h" #include "SkTSearch.h" diff --git a/src/gpu/gl/GrGLPathRendering.h b/src/gpu/gl/GrGLPathRendering.h index d61df2fe40..57209fddc1 100644 --- a/src/gpu/gl/GrGLPathRendering.h +++ b/src/gpu/gl/GrGLPathRendering.h @@ -11,8 +11,8 @@ #include "SkRefCnt.h" #include "GrPathRendering.h" #include "GrStencil.h" -#include "gl/GrGLProgram.h" #include "gl/GrGLTypes.h" +#include "glsl/GrGLSLUtil.h" class GrGLNameAllocator; class GrGLGpu; @@ -106,7 +106,7 @@ private: 0, 0, 1); } combined.preConcat(fViewMatrix); - GrGLGetMatrix<Size>(destMatrix, combined); + GrGLSLGetMatrix<Size>(destMatrix, combined); } }; GrGLGpu* gpu(); diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp index 23e0df731c..d6e7facde6 100644 --- a/src/gpu/gl/GrGLProgram.cpp +++ b/src/gpu/gl/GrGLProgram.cpp @@ -17,7 +17,7 @@ #include "GrPathProcessor.h" #include "GrPipeline.h" #include "GrXferProcessor.h" -#include "gl/GrGLFragmentProcessor.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "SkXfermode.h" #define GL_CALL(X) GR_GL_CALL(fGpu->glInterface(), X) diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp index 2255dbde51..7c482d57b8 100644 --- a/src/gpu/gl/GrGLProgramDesc.cpp +++ b/src/gpu/gl/GrGLProgramDesc.cpp @@ -6,11 +6,11 @@ */ #include "GrGLProgramDesc.h" -#include "GrGLFragmentProcessor.h" #include "GrProcessor.h" #include "GrGLGpu.h" #include "GrPipeline.h" #include "SkChecksum.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" /** diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp index 7f0713ed6a..71d54c35c0 100644 --- a/src/gpu/gl/GrGLUtil.cpp +++ b/src/gpu/gl/GrGLUtil.cpp @@ -306,51 +306,6 @@ GrGLRenderer GrGLGetRenderer(const GrGLInterface* gl) { return GrGLGetRendererFromString((const char*) v); } -template<> void GrGLGetMatrix<3>(float* dest, const SkMatrix& src) { - GR_STATIC_ASSERT(sizeof(float) == sizeof (GrGLfloat)); - // Col 0 - dest[0] = SkScalarToFloat(src[SkMatrix::kMScaleX]); - dest[1] = SkScalarToFloat(src[SkMatrix::kMSkewY]); - dest[2] = SkScalarToFloat(src[SkMatrix::kMPersp0]); - - // Col 1 - dest[3] = SkScalarToFloat(src[SkMatrix::kMSkewX]); - dest[4] = SkScalarToFloat(src[SkMatrix::kMScaleY]); - dest[5] = SkScalarToFloat(src[SkMatrix::kMPersp1]); - - // Col 2 - dest[6] = SkScalarToFloat(src[SkMatrix::kMTransX]); - dest[7] = SkScalarToFloat(src[SkMatrix::kMTransY]); - dest[8] = SkScalarToFloat(src[SkMatrix::kMPersp2]); -} - -template<> void GrGLGetMatrix<4>(float* dest, const SkMatrix& src) { - GR_STATIC_ASSERT(sizeof(float) == sizeof (GrGLfloat)); - // Col 0 - dest[0] = SkScalarToFloat(src[SkMatrix::kMScaleX]); - dest[1] = SkScalarToFloat(src[SkMatrix::kMSkewY]); - dest[2] = 0; - dest[3] = SkScalarToFloat(src[SkMatrix::kMPersp0]); - - // Col 1 - dest[4] = SkScalarToFloat(src[SkMatrix::kMSkewX]); - dest[5] = SkScalarToFloat(src[SkMatrix::kMScaleY]); - dest[6] = 0; - dest[7] = SkScalarToFloat(src[SkMatrix::kMPersp1]); - - // Col 2 - dest[8] = 0; - dest[9] = 0; - dest[10] = 1; - dest[11] = 0; - - // Col 3 - dest[12] = SkScalarToFloat(src[SkMatrix::kMTransX]); - dest[13] = SkScalarToFloat(src[SkMatrix::kMTransY]); - dest[14] = 0; - dest[15] = SkScalarToFloat(src[SkMatrix::kMPersp2]); -} - GrGLenum GrToGLStencilFunc(GrStencilFunc basicFunc) { static const GrGLenum gTable[] = { GR_GL_ALWAYS, // kAlways_StencilFunc diff --git a/src/gpu/gl/GrGLUtil.h b/src/gpu/gl/GrGLUtil.h index dec784c977..70af3a36f4 100644 --- a/src/gpu/gl/GrGLUtil.h +++ b/src/gpu/gl/GrGLUtil.h @@ -138,11 +138,6 @@ void GrGLCheckErr(const GrGLInterface* gl, void GrGLClearErr(const GrGLInterface* gl); -/** - * Helper for converting SkMatrix to a column-major GL float array - */ -template<int MatrixSize> void GrGLGetMatrix(float* dest, const SkMatrix& src); - //////////////////////////////////////////////////////////////////////////////// /** diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp index 67ba08339b..51f95237f6 100644 --- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp +++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp @@ -13,7 +13,6 @@ #include "GrTexture.h" #include "SkRTConf.h" #include "SkTraceEvent.h" -#include "gl/GrGLFragmentProcessor.h" #include "gl/GrGLGeometryProcessor.h" #include "gl/GrGLGpu.h" #include "gl/GrGLProgram.h" @@ -21,6 +20,7 @@ #include "gl/GrGLXferProcessor.h" #include "gl/builders/GrGLShaderStringBuilder.h" #include "glsl/GrGLSLCaps.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLProgramDataManager.h" #include "glsl/GrGLSLTextureSampler.h" @@ -259,7 +259,12 @@ void GrGLProgramBuilder::emitAndInstallProc(const GrFragmentProcessor& fp, SkSTArray<4, GrGLSLTextureSampler> samplers(fp.numTextures()); this->emitSamplers(fp, &samplers, ifp); - GrGLFragmentProcessor::EmitArgs args(this, fp, outColor, inColor, fOutCoords[index], samplers); + GrGLSLFragmentProcessor::EmitArgs args(this, + fp, + outColor, + inColor, + fOutCoords[index], + samplers); ifp->fGLProc->emitCode(args); // We have to check that effects and the code they emit are consistent, ie if an effect diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.h b/src/gpu/gl/builders/GrGLProgramBuilder.h index 21724c19f2..cb49c348a4 100644 --- a/src/gpu/gl/builders/GrGLProgramBuilder.h +++ b/src/gpu/gl/builders/GrGLProgramBuilder.h @@ -32,7 +32,7 @@ struct GrGLInstalledProc { typedef GrGLInstalledProc<GrGLPrimitiveProcessor> GrGLInstalledGeoProc; typedef GrGLInstalledProc<GrGLXferProcessor> GrGLInstalledXferProc; -typedef GrGLInstalledProc<GrGLFragmentProcessor> GrGLInstalledFragProc; +typedef GrGLInstalledProc<GrGLSLFragmentProcessor> GrGLInstalledFragProc; struct GrGLInstalledFragProcs : public SkRefCnt { virtual ~GrGLInstalledFragProcs(); diff --git a/src/gpu/gl/GrGLSLBlend.cpp b/src/gpu/glsl/GrGLSLBlend.cpp index 3c83068fc1..3c83068fc1 100644 --- a/src/gpu/gl/GrGLSLBlend.cpp +++ b/src/gpu/glsl/GrGLSLBlend.cpp diff --git a/src/gpu/gl/GrGLSLBlend.h b/src/gpu/glsl/GrGLSLBlend.h index 25ae37b1c1..25ae37b1c1 100644 --- a/src/gpu/gl/GrGLSLBlend.h +++ b/src/gpu/glsl/GrGLSLBlend.h diff --git a/src/gpu/gl/GrGLFragmentProcessor.cpp b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp index 1d6f5992e4..5868043cbc 100644 --- a/src/gpu/gl/GrGLFragmentProcessor.cpp +++ b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp @@ -5,14 +5,14 @@ * found in the LICENSE file. */ -#include "GrGLFragmentProcessor.h" +#include "GrGLSLFragmentProcessor.h" #include "GrFragmentProcessor.h" #include "GrProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" -void GrGLFragmentProcessor::setData(const GrGLSLProgramDataManager& pdman, - const GrFragmentProcessor& processor) { +void GrGLSLFragmentProcessor::setData(const GrGLSLProgramDataManager& pdman, + const GrFragmentProcessor& processor) { this->onSetData(pdman, processor); SkASSERT(fChildProcessors.count() == processor.numChildProcessors()); for (int i = 0; i < fChildProcessors.count(); ++i) { @@ -20,11 +20,11 @@ void GrGLFragmentProcessor::setData(const GrGLSLProgramDataManager& pdman, } } -void GrGLFragmentProcessor::emitChild(int childIndex, const char* inputColor, EmitArgs& args) { +void GrGLSLFragmentProcessor::emitChild(int childIndex, const char* inputColor, EmitArgs& args) { this->internalEmitChild(childIndex, inputColor, args.fOutputColor, args); } -void GrGLFragmentProcessor::emitChild(int childIndex, const char* inputColor, +void GrGLSLFragmentProcessor::emitChild(int childIndex, const char* inputColor, SkString* outputColor, EmitArgs& args) { SkASSERT(outputColor); @@ -34,8 +34,8 @@ void GrGLFragmentProcessor::emitChild(int childIndex, const char* inputColor, this->internalEmitChild(childIndex, inputColor, outputColor->c_str(), args); } -void GrGLFragmentProcessor::internalEmitChild(int childIndex, const char* inputColor, - const char* outputColor, EmitArgs& args) { +void GrGLSLFragmentProcessor::internalEmitChild(int childIndex, const char* inputColor, + const char* outputColor, EmitArgs& args) { GrGLSLFragmentBuilder* fb = args.fBuilder->getFragmentShaderBuilder(); fb->onBeforeChildProcEmitCode(); // call first so mangleString is updated diff --git a/src/gpu/gl/GrGLFragmentProcessor.h b/src/gpu/glsl/GrGLSLFragmentProcessor.h index 311612df7f..fa4f043ff7 100644 --- a/src/gpu/gl/GrGLFragmentProcessor.h +++ b/src/gpu/glsl/GrGLSLFragmentProcessor.h @@ -5,8 +5,8 @@ * found in the LICENSE file. */ -#ifndef GrGLFragmentProcessor_DEFINED -#define GrGLFragmentProcessor_DEFINED +#ifndef GrGLSLFragmentProcessor_DEFINED +#define GrGLSLFragmentProcessor_DEFINED #include "glsl/GrGLSLProcessorTypes.h" #include "glsl/GrGLSLProgramDataManager.h" @@ -17,11 +17,11 @@ class GrProcessorKeyBuilder; class GrGLSLFPBuilder; class GrGLSLCaps; -class GrGLFragmentProcessor { +class GrGLSLFragmentProcessor { public: - GrGLFragmentProcessor() {} + GrGLSLFragmentProcessor() {} - virtual ~GrGLFragmentProcessor() { + virtual ~GrGLSLFragmentProcessor() { for (int i = 0; i < fChildProcessors.count(); ++i) { delete fChildProcessors[i]; } @@ -78,7 +78,7 @@ public: int numChildProcessors() const { return fChildProcessors.count(); } - GrGLFragmentProcessor* childProcessor(int index) const { + GrGLSLFragmentProcessor* childProcessor(int index) const { return fChildProcessors[index]; } @@ -97,18 +97,18 @@ public: void emitChild(int childIndex, const char* inputColor, EmitArgs& parentArgs); protected: - /** A GrGLFragmentProcessor instance can be reused with any GrFragmentProcessor that produces + /** A GrGLSLFragmentProcessor instance can be reused with any GrFragmentProcessor that produces the same stage key; this function reads data from a GrFragmentProcessor and uploads any uniform variables required by the shaders created in emitCode(). The GrFragmentProcessor - parameter is guaranteed to be of the same type that created this GrGLFragmentProcessor and - to have an identical processor key as the one that created this GrGLFragmentProcessor. */ + parameter is guaranteed to be of the same type that created this GrGLSLFragmentProcessor and + to have an identical processor key as the one that created this GrGLSLFragmentProcessor. */ // TODO update this to pass in GrFragmentProcessor virtual void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) {} private: void internalEmitChild(int, const char*, const char*, EmitArgs&); - SkTArray<GrGLFragmentProcessor*, true> fChildProcessors; + SkTArray<GrGLSLFragmentProcessor*, true> fChildProcessors; friend class GrFragmentProcessor; }; diff --git a/src/gpu/glsl/GrGLSLUtil.cpp b/src/gpu/glsl/GrGLSLUtil.cpp new file mode 100644 index 0000000000..5a333244b2 --- /dev/null +++ b/src/gpu/glsl/GrGLSLUtil.cpp @@ -0,0 +1,52 @@ +/* +* Copyright 2015 Google Inc. +* +* Use of this source code is governed by a BSD-style license that can be +* found in the LICENSE file. +*/ + +#include "GrGLSLUtil.h" +#include "SkMatrix.h" + +template<> void GrGLSLGetMatrix<3>(float* dest, const SkMatrix& src) { + // Col 0 + dest[0] = SkScalarToFloat(src[SkMatrix::kMScaleX]); + dest[1] = SkScalarToFloat(src[SkMatrix::kMSkewY]); + dest[2] = SkScalarToFloat(src[SkMatrix::kMPersp0]); + + // Col 1 + dest[3] = SkScalarToFloat(src[SkMatrix::kMSkewX]); + dest[4] = SkScalarToFloat(src[SkMatrix::kMScaleY]); + dest[5] = SkScalarToFloat(src[SkMatrix::kMPersp1]); + + // Col 2 + dest[6] = SkScalarToFloat(src[SkMatrix::kMTransX]); + dest[7] = SkScalarToFloat(src[SkMatrix::kMTransY]); + dest[8] = SkScalarToFloat(src[SkMatrix::kMPersp2]); +} + +template<> void GrGLSLGetMatrix<4>(float* dest, const SkMatrix& src) { + // Col 0 + dest[0] = SkScalarToFloat(src[SkMatrix::kMScaleX]); + dest[1] = SkScalarToFloat(src[SkMatrix::kMSkewY]); + dest[2] = 0; + dest[3] = SkScalarToFloat(src[SkMatrix::kMPersp0]); + + // Col 1 + dest[4] = SkScalarToFloat(src[SkMatrix::kMSkewX]); + dest[5] = SkScalarToFloat(src[SkMatrix::kMScaleY]); + dest[6] = 0; + dest[7] = SkScalarToFloat(src[SkMatrix::kMPersp1]); + + // Col 2 + dest[8] = 0; + dest[9] = 0; + dest[10] = 1; + dest[11] = 0; + + // Col 3 + dest[12] = SkScalarToFloat(src[SkMatrix::kMTransX]); + dest[13] = SkScalarToFloat(src[SkMatrix::kMTransY]); + dest[14] = 0; + dest[15] = SkScalarToFloat(src[SkMatrix::kMPersp2]); +} diff --git a/src/gpu/glsl/GrGLSLUtil.h b/src/gpu/glsl/GrGLSLUtil.h new file mode 100644 index 0000000000..0d2b7e742f --- /dev/null +++ b/src/gpu/glsl/GrGLSLUtil.h @@ -0,0 +1,19 @@ +/* +* Copyright 2015 Google Inc. +* +* Use of this source code is governed by a BSD-style license that can be +* found in the LICENSE file. +*/ + +#ifndef GrGLSLUtil_DEFINED +#define GrGLSLUtil_DEFINED + +class SkMatrix; + +/** + * Helper for converting SkMatrix to a column-major float array. We assume that all GLSL backends + * use a column major representation for matrices. + */ +template<int MatrixSize> void GrGLSLGetMatrix(float* dest, const SkMatrix& src); + +#endif diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index b10c958937..81ce227c64 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -31,8 +31,8 @@ #include "effects/GrPorterDuffXferProcessor.h" #include "effects/GrXfermodeFragmentProcessor.h" -#include "gl/GrGLFragmentProcessor.h" #include "gl/GrGLGpu.h" +#include "glsl/GrGLSLFragmentProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramBuilder.h" @@ -42,7 +42,7 @@ */ static const uint32_t kMaxKeySize = 1024; -class GLBigKeyProcessor : public GrGLFragmentProcessor { +class GLBigKeyProcessor : public GrGLSLFragmentProcessor { public: GLBigKeyProcessor(const GrProcessor&) {} @@ -63,7 +63,7 @@ public: } private: - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; class BigKeyProcessor : public GrFragmentProcessor { @@ -74,7 +74,7 @@ public: const char* name() const override { return "Big Ole Key"; } - GrGLFragmentProcessor* onCreateGLInstance() const override { + GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new GLBigKeyProcessor(*this); } @@ -110,17 +110,17 @@ public: const char* name() const override { return "Block Input"; } - GrGLFragmentProcessor* onCreateGLInstance() const override { return new GLFP; } + GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new GLFP; } private: - class GLFP : public GrGLFragmentProcessor { + class GLFP : public GrGLSLFragmentProcessor { public: void emitCode(EmitArgs& args) override { this->emitChild(0, nullptr, args); } private: - typedef GrGLFragmentProcessor INHERITED; + typedef GrGLSLFragmentProcessor INHERITED; }; BlockInputFragmentProcessor(const GrFragmentProcessor* child) { |