#include "SkGr.h"
#include "effects/GrConstColorProcessor.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#endif
}
void GrGLPerlinNoise2::emitCode(EmitArgs& args) {
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString vCoords = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
- fBaseFrequencyUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fBaseFrequencyUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"baseFrequency");
const char* baseFrequencyUni = args.fBuilder->getUniformCStr(fBaseFrequencyUni);
const char* stitchDataUni = nullptr;
if (fStitchTiles) {
- fStitchDataUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fStitchDataUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"stitchData");
stitchDataUni = args.fBuilder->getUniformCStr(fStitchDataUni);
}
void GrGLPerlinNoise2::GenKey(const GrProcessor& processor, const GrGLSLCaps&,
- GrProcessorKeyBuilder* b) {
+ GrProcessorKeyBuilder* b) {
const GrPerlinNoise2Effect& turbulence = processor.cast<GrPerlinNoise2Effect>();
uint32_t key = turbulence.numOctaves();
}
void GrGLImprovedPerlinNoise::emitCode(EmitArgs& args) {
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString vCoords = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
- fBaseFrequencyUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fBaseFrequencyUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"baseFrequency");
const char* baseFrequencyUni = args.fBuilder->getUniformCStr(fBaseFrequencyUni);
- fOctavesUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fOctavesUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"octaves");
const char* octavesUni = args.fBuilder->getUniformCStr(fOctavesUni);
- fZUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fZUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"z");
const char* zUni = args.fBuilder->getUniformCStr(fZUni);
#include "GrCoordTransform.h"
#include "effects/GrXfermodeFragmentProcessor.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "Resources.h"
#include "SkReadBuffer.h"
GrGLFragmentProcessor* onCreateGLInstance() const override {
class DCGLFP : public GrGLFragmentProcessor {
void emitCode(EmitArgs& args) override {
- GrGLFragmentBuilder* fpb = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fpb = args.fBuilder->getFragmentShaderBuilder();
fpb->codeAppendf("vec2 c = %s;", fpb->ensureFSCoords2D(args.fCoords, 0).c_str());
fpb->codeAppend("vec2 r = mod(c, vec2(20.0));");
fpb->codeAppend("vec4 color = vec4(0.5*sin(c.x / 15.0) + 0.5,"
# Files for building GLSL shaders
'<(skia_src_path)/gpu/gl/builders/GrGLProgramBuilder.cpp',
'<(skia_src_path)/gpu/gl/builders/GrGLProgramBuilder.h',
- '<(skia_src_path)/gpu/gl/builders/GrGLShaderBuilder.cpp',
- '<(skia_src_path)/gpu/gl/builders/GrGLShaderBuilder.h',
'<(skia_src_path)/gpu/gl/builders/GrGLShaderStringBuilder.cpp',
'<(skia_src_path)/gpu/gl/builders/GrGLShaderStringBuilder.h',
'<(skia_src_path)/gpu/gl/builders/GrGLSLPrettyPrint.cpp',
- '<(skia_src_path)/gpu/gl/builders/GrGLVertexShaderBuilder.cpp',
- '<(skia_src_path)/gpu/gl/builders/GrGLVertexShaderBuilder.h',
- '<(skia_src_path)/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp',
- '<(skia_src_path)/gpu/gl/builders/GrGLFragmentShaderBuilder.h',
- '<(skia_src_path)/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp',
- '<(skia_src_path)/gpu/gl/builders/GrGLGeometryShaderBuilder.h',
# GLSL
'<(skia_src_path)/gpu/glsl/GrGLSL.cpp',
'<(skia_src_path)/gpu/glsl/GrGLSL_impl.h',
'<(skia_src_path)/gpu/glsl/GrGLSLCaps.cpp',
'<(skia_src_path)/gpu/glsl/GrGLSLCaps.h',
+ '<(skia_src_path)/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp',
+ '<(skia_src_path)/gpu/glsl/GrGLSLFragmentShaderBuilder.h',
+ '<(skia_src_path)/gpu/glsl/GrGLSLGeometryShaderBuilder.cpp',
+ '<(skia_src_path)/gpu/glsl/GrGLSLGeometryShaderBuilder.h',
'<(skia_src_path)/gpu/glsl/GrGLSLProcessorTypes.h',
'<(skia_src_path)/gpu/glsl/GrGLSLProgramBuilder.cpp',
'<(skia_src_path)/gpu/glsl/GrGLSLProgramBuilder.h',
'<(skia_src_path)/gpu/glsl/GrGLSLProgramDataManager.h',
+ '<(skia_src_path)/gpu/glsl/GrGLSLShaderBuilder.cpp',
+ '<(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/GrGLSLVertexShaderBuilder.cpp',
+ '<(skia_src_path)/gpu/glsl/GrGLSLVertexShaderBuilder.h',
# Sk files
'<(skia_include_path)/gpu/SkGr.h',
#include "GrFragmentProcessor.h"
#include "GrTextureAccess.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "SkGr.h"
#include "SkGrPriv.h"
void emitCode(EmitArgs& args) override {
- GrGLFragmentBuilder* fpb = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fpb = args.fBuilder->getFragmentShaderBuilder();
// add uniforms
const char* lightDirUniName = nullptr;
- fLightDirUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fLightDirUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, kDefault_GrSLPrecision,
"LightDir", &lightDirUniName);
const char* lightColorUniName = nullptr;
- fLightColorUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fLightColorUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, kDefault_GrSLPrecision,
"LightColor", &lightColorUniName);
const char* ambientColorUniName = nullptr;
- fAmbientColorUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fAmbientColorUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, kDefault_GrSLPrecision,
"AmbientColor", &ambientColorUniName);
const char* xformUniName = nullptr;
- fXformUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fXformUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"Xform", &xformUniName);
#include "GrTextureProvider.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
class GrGLCircleBlurFragmentProcessor : public GrGLFragmentProcessor {
// x,y - the center of the circle
// z - the distance at which the intensity starts falling off (e.g., the start of the table)
// w - the size of the profile texture
- fDataUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fDataUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType,
kDefault_GrSLPrecision,
"data",
&dataName);
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const char *fragmentPos = fsBuilder->fragmentPosition();
if (args.fInputColor) {
#include "SkGr.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
class AlphaThresholdEffect : public GrFragmentProcessor {
};
void GrGLAlphaThresholdEffect::emitCode(EmitArgs& args) {
- fInnerThresholdVar = args.fBuilder->addUniform(
- GrGLProgramBuilder::kFragment_Visibility,
- kFloat_GrSLType, kDefault_GrSLPrecision,
- "inner_threshold");
- fOuterThresholdVar = args.fBuilder->addUniform(
- GrGLProgramBuilder::kFragment_Visibility,
- kFloat_GrSLType, kDefault_GrSLPrecision,
- "outer_threshold");
-
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ fInnerThresholdVar = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kFloat_GrSLType, kDefault_GrSLPrecision,
+ "inner_threshold");
+ fOuterThresholdVar = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kFloat_GrSLType, kDefault_GrSLPrecision,
+ "outer_threshold");
+
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
SkString maskCoords2D = fsBuilder->ensureFSCoords2D(args.fCoords, 1);
///////////////////////////////////////////////////////////////////////////////
void AlphaThresholdEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GrGLAlphaThresholdEffect::GenKey(*this, caps, b);
}
#include "GrTexture.h"
#include "gl/GrGLCaps.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "gl/GrGLXferProcessor.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
static const bool gUseUnpremul = false;
-static void add_arithmetic_code(GrGLFragmentBuilder* fsBuilder,
+static void add_arithmetic_code(GrGLSLFragmentBuilder* fsBuilder,
const char* srcColor,
const char* dstColor,
const char* outputColor,
~GLArithmeticFP() override {}
void emitCode(EmitArgs& args) override {
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString dstColor("dstColor");
this->emitChild(0, nullptr, &dstColor, args);
- fKUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fKUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"k");
const char* kUni = args.fBuilder->getUniformCStr(fKUni);
private:
void emitBlendCodeForDstRead(GrGLSLXPBuilder* pb, const char* srcColor, const char* dstColor,
const char* outColor, const GrXferProcessor& proc) override {
- GrGLXPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
+ GrGLSLXPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
- fKUni = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fKUni = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"k");
const char* kUni = pb->getUniformCStr(fKUni);
#include "SkDraw.h"
#include "effects/GrSimpleTextureEffect.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "glsl/GrGLSLTextureSampler.h"
#endif
typedef GrGLFragmentProcessor INHERITED;
};
-void OutputRectBlurProfileLookup(GrGLFragmentBuilder* fsBuilder,
+void OutputRectBlurProfileLookup(GrGLSLFragmentBuilder* fsBuilder,
const GrGLSLTextureSampler& sampler,
const char *output,
const char *profileSize, const char *loc,
const char* precisionString = GrGLSLShaderVar::PrecisionString(args.fBuilder->glslCaps(),
fPrecision);
- fProxyRectUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fProxyRectUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType,
fPrecision,
"proxyRect",
&rectName);
- fProfileSizeUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fProfileSizeUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType,
kDefault_GrSLPrecision,
"profileSize",
&profileSizeName);
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const char *fragmentPos = fsBuilder->fragmentPosition();
if (args.fInputColor) {
}
void GrRectBlurEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GrGLRectBlurEffect::GenKey(fPrecision, b);
}
// The proxy rect has left, top, right, and bottom edges correspond to
// components x, y, z, and w, respectively.
- fProxyRectUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kVec4f_GrSLType,
- kDefault_GrSLPrecision,
- "proxyRect",
- &rectName);
- fCornerRadiusUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kFloat_GrSLType,
- kDefault_GrSLPrecision,
- "cornerRadius",
- &cornerRadiusName);
- fBlurRadiusUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kFloat_GrSLType,
- kDefault_GrSLPrecision,
- "blurRadius",
- &blurRadiusName);
-
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ fProxyRectUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kVec4f_GrSLType,
+ kDefault_GrSLPrecision,
+ "proxyRect",
+ &rectName);
+ fCornerRadiusUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kFloat_GrSLType,
+ kDefault_GrSLPrecision,
+ "cornerRadius",
+ &cornerRadiusName);
+ fBlurRadiusUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kFloat_GrSLType,
+ kDefault_GrSLPrecision,
+ "blurRadius",
+ &blurRadiusName);
+
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const char* fragmentPos = fsBuilder->fragmentPosition();
// warp the fragment position to the appropriate part of the 9patch blur texture
#include "GrTexturePriv.h"
#include "SkGr.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#endif
args.fInputColor = "vec4(1)";
}
- fColorCubeSizeUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorCubeSizeUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"Size");
const char* colorCubeSizeUni = args.fBuilder->getUniformCStr(fColorCubeSizeUni);
- fColorCubeInvSizeUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorCubeInvSizeUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"InvSize");
const char* colorCubeInvSizeUni = args.fBuilder->getUniformCStr(fColorCubeInvSizeUni);
// Note: if implemented using texture3D in OpenGL ES older than OpenGL ES 3.0,
// the shader might need "#extension GL_OES_texture_3D : enable".
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
// Unpremultiply color
fsBuilder->codeAppendf("\tfloat %s = max(%s.a, 0.00001);\n", nonZeroAlpha, args.fInputColor);
#include "GrFragmentProcessor.h"
#include "GrInvariantOutput.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
class ColorMatrixEffect : public GrFragmentProcessor {
GLProcessor(const GrProcessor&) {}
virtual void emitCode(EmitArgs& args) override {
- fMatrixHandle = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fMatrixHandle = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kMat44f_GrSLType, kDefault_GrSLPrecision,
"ColorMatrix");
- fVectorHandle = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fVectorHandle = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"ColorMatrixVector");
// could optimize this case, but we aren't for now.
args.fInputColor = "vec4(1)";
}
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
// The max() is to guard against 0 / 0 during unpremul when the incoming color is
// transparent black.
fsBuilder->codeAppendf("\tfloat nonZeroAlpha = max(%s.a, 0.00001);\n",
#include "GrInvariantOutput.h"
#include "effects/GrTextureDomain.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#endif
void GrGLDisplacementMapEffect::emitCode(EmitArgs& args) {
const GrTextureDomain& domain = args.fFp.cast<GrDisplacementMapEffect>().domain();
- fScaleUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kVec2f_GrSLType, kDefault_GrSLPrecision, "Scale");
+ fScaleUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kVec2f_GrSLType, kDefault_GrSLPrecision, "Scale");
const char* scaleUni = args.fBuilder->getUniformCStr(fScaleUni);
const char* dColor = "dColor";
const char* cCoords = "cCoords";
// a number smaller than that to approximate 0, but
// leave room for 32-bit float GPU rounding errors.
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
fsBuilder->codeAppendf("\t\tvec4 %s = ", dColor);
fsBuilder->appendTextureLookup(args.fSamplers[0], args.fCoords[0].c_str(),
args.fCoords[0].getType());
#include "GrPaint.h"
#include "effects/GrSingleTextureEffect.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
class GrGLDiffuseLightingEffect;
}
void GrDiffuseLightingEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GrGLDiffuseLightingEffect::GenKey(*this, caps, b);
}
}
void GrGLLightingEffect::emitCode(EmitArgs& args) {
- fImageIncrementUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fImageIncrementUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"ImageIncrement");
- fSurfaceScaleUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fSurfaceScaleUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"SurfaceScale");
fLight->emitLightColorUniform(args.fBuilder);
GrGLSLShaderVar("scale", kFloat_GrSLType),
};
SkString sobelFuncName;
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
fsBuilder->emitFunction(kFloat_GrSLType,
void GrGLDiffuseLightingEffect::emitLightFunc(GrGLSLFPBuilder* builder, SkString* funcName) {
const char* kd;
- fKDUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fKDUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"KD", &kd);
}
void GrSpecularLightingEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GrGLSpecularLightingEffect::GenKey(*this, caps, b);
}
const char* ks;
const char* shininess;
- fKSUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fKSUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision, "KS", &ks);
- fShininessUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fShininessUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType,
kDefault_GrSLPrecision,
"Shininess",
///////////////////////////////////////////////////////////////////////////////
void GrGLLight::emitLightColorUniform(GrGLSLFPBuilder* builder) {
- fColorUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, kDefault_GrSLPrecision,
"LightColor");
}
void GrGLDistantLight::emitSurfaceToLight(GrGLSLFPBuilder* builder, const char* z) {
const char* dir;
- fDirectionUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fDirectionUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, kDefault_GrSLPrecision,
"LightDirection", &dir);
builder->getFragmentShaderBuilder()->codeAppend(dir);
void GrGLPointLight::emitSurfaceToLight(GrGLSLFPBuilder* builder, const char* z) {
const char* loc;
- fLocationUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fLocationUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, kDefault_GrSLPrecision,
"LightLocation", &loc);
- GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
fsBuilder->codeAppendf("normalize(%s - vec3(%s.xy, %s))",
loc, fsBuilder->fragmentPosition(), z);
}
void GrGLSpotLight::emitSurfaceToLight(GrGLSLFPBuilder* builder, const char* z) {
const char* location;
- fLocationUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fLocationUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, kDefault_GrSLPrecision,
"LightLocation", &location);
- GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
fsBuilder->codeAppendf("normalize(%s - vec3(%s.xy, %s))",
location, fsBuilder->fragmentPosition(), z);
}
const char* cosOuter;
const char* coneScale;
const char* s;
- fExponentUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fExponentUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"Exponent", &exponent);
- fCosInnerConeAngleUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fCosInnerConeAngleUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"CosInnerConeAngle", &cosInner);
- fCosOuterConeAngleUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fCosOuterConeAngleUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"CosOuterConeAngle", &cosOuter);
- fConeScaleUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fConeScaleUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"ConeScale", &coneScale);
- fSUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fSUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, kDefault_GrSLPrecision, "S", &s);
static const GrGLSLShaderVar gLightColorArgs[] = {
color, cosOuter, coneScale);
lightColorBody.appendf("\t}\n");
lightColorBody.appendf("\treturn %s;\n", color);
- GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
fsBuilder->emitFunction(kVec3f_GrSLType,
"lightColor",
SK_ARRAY_COUNT(gLightColorArgs),
#include "GrContext.h"
#include "GrInvariantOutput.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#endif
void SkLumaColorFilter::filterSpan(const SkPMColor src[], int count,
args.fInputColor = "vec4(1)";
}
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
fsBuilder->codeAppendf("\tfloat luma = dot(vec3(%f, %f, %f), %s.rgb);\n",
SK_ITU_BT709_LUM_COEFF_R,
SK_ITU_BT709_LUM_COEFF_G,
#include "effects/GrSingleTextureEffect.h"
#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLTexture.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
class GrMagnifierEffect : public GrSingleTextureEffect {
void GrGLMagnifierEffect::emitCode(EmitArgs& args) {
fOffsetVar = args.fBuilder->addUniform(
- GrGLProgramBuilder::kFragment_Visibility |
- GrGLProgramBuilder::kVertex_Visibility,
+ GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision, "Offset");
fInvZoomVar = args.fBuilder->addUniform(
- GrGLProgramBuilder::kFragment_Visibility |
- GrGLProgramBuilder::kVertex_Visibility,
+ GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision, "InvZoom");
fInvInsetVar = args.fBuilder->addUniform(
- GrGLProgramBuilder::kFragment_Visibility |
- GrGLProgramBuilder::kVertex_Visibility,
+ GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision, "InvInset");
fBoundsVar = args.fBuilder->addUniform(
- GrGLProgramBuilder::kFragment_Visibility |
- GrGLProgramBuilder::kVertex_Visibility,
+ GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision, "Bounds");
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
fsBuilder->codeAppendf("\t\tvec2 coord = %s;\n", coords2D.c_str());
fsBuilder->codeAppendf("\t\tvec2 zoom_coord = %s + %s * %s;\n",
#include "GrTexture.h"
#include "effects/Gr1DKernelEffect.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#endif
}
void GrGLMorphologyEffect::emitCode(EmitArgs& args) {
- fPixelSizeUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fPixelSizeUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"PixelSize");
const char* pixelSizeInc = args.fBuilder->getUniformCStr(fPixelSizeUni);
- fRangeUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fRangeUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"Range");
const char* range = args.fBuilder->getUniformCStr(fRangeUni);
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
const char* func;
switch (fType) {
#include "SkGr.h"
#include "effects/GrConstColorProcessor.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#endif
}
void GrGLPerlinNoise::emitCode(EmitArgs& args) {
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString vCoords = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
- fBaseFrequencyUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fBaseFrequencyUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"baseFrequency");
const char* baseFrequencyUni = args.fBuilder->getUniformCStr(fBaseFrequencyUni);
const char* stitchDataUni = nullptr;
if (fStitchTiles) {
- fStitchDataUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fStitchDataUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"stitchData");
stitchDataUni = args.fBuilder->getUniformCStr(fStitchDataUni);
#include "SkGr.h"
#include "effects/GrTextureStripAtlas.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
class ColorTableEffect : public GrFragmentProcessor {
"yoffsets", &yoffsets);
static const float kColorScaleFactor = 255.0f / 256.0f;
static const float kColorOffsetFactor = 1.0f / 512.0f;
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
if (nullptr == args.fInputColor) {
// the input color is solid white (all ones).
static const float kMaxValue = kColorScaleFactor + kColorOffsetFactor;
}
void ColorTableEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GLColorTableEffect::GenKey(*this, caps, b);
}
#include "effects/GrTextureStripAtlas.h"
#include "GrInvariantOutput.h"
#include "gl/GrGLContext.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "SkGr.h"
void GrGLGradientEffect::emitUniforms(GrGLSLFPBuilder* builder, const GrGradientEffect& ge) {
if (SkGradientShaderBase::kTwo_GpuColorType == ge.getColorType()) { // 2 Color case
- fColorStartUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorStartUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"GradientStartColor");
- fColorEndUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorEndUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"GradientEndColor");
} else if (SkGradientShaderBase::kThree_GpuColorType == ge.getColorType()) { // 3 Color Case
- fColorStartUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorStartUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"GradientStartColor");
- fColorMidUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorMidUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"GradientMidColor");
- fColorEndUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorEndUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"GradientEndColor");
} else { // if not a fast case
- fFSYUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fFSYUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"GradientYCoordFS");
}
const char* outputColor,
const char* inputColor,
const TextureSamplerArray& samplers) {
- GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
if (SkGradientShaderBase::kTwo_GpuColorType == ge.getColorType()){
fsBuilder->codeAppendf("\tvec4 colorTemp = mix(%s, %s, clamp(%s, 0.0, 1.0));\n",
builder->getUniformVariable(fColorStartUni).c_str(),
#if SK_SUPPORT_GPU
#include "GrPaint.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
// For brevity
typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
};
void Edge2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GLEdge2PtConicalEffect::GenKey(*this, caps, b);
}
void GLEdge2PtConicalEffect::emitCode(EmitArgs& args) {
const Edge2PtConicalEffect& ge = args.fFp.cast<Edge2PtConicalEffect>();
this->emitUniforms(args.fBuilder, ge);
- fParamUni = args.fBuilder->addUniformArray(GrGLProgramBuilder::kFragment_Visibility,
+ fParamUni = args.fBuilder->addUniformArray(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"Conical2FSParams", 3);
SkASSERT(args.fCoords[0].getType() == args.fCoords[1].getType());
const char* coords2D;
SkString bVar;
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
if (kVec3f_GrSLType == args.fCoords[0].getType()) {
fsBuilder->codeAppendf("\tvec3 interpolants = vec3(%s.xy / %s.z, %s.x / %s.z);\n",
args.fCoords[0].c_str(), args.fCoords[0].c_str(),
};
void FocalOutside2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GLFocalOutside2PtConicalEffect::GenKey(*this, caps, b);
}
void GLFocalOutside2PtConicalEffect::emitCode(EmitArgs& args) {
const FocalOutside2PtConicalEffect& ge = args.fFp.cast<FocalOutside2PtConicalEffect>();
this->emitUniforms(args.fBuilder, ge);
- fParamUni = args.fBuilder->addUniformArray(GrGLProgramBuilder::kFragment_Visibility,
+ fParamUni = args.fBuilder->addUniformArray(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"Conical2FSParams", 2);
SkString tName("t");
args.fBuilder->getUniformVariable(fParamUni).appendArrayAccess(1, &p1);
// if we have a vec3 from being in perspective, convert it to a vec2 first
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString coords2DString = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
const char* coords2D = coords2DString.c_str();
};
void FocalInside2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GLFocalInside2PtConicalEffect::GenKey(*this, caps, b);
}
void GLFocalInside2PtConicalEffect::emitCode(EmitArgs& args) {
const FocalInside2PtConicalEffect& ge = args.fFp.cast<FocalInside2PtConicalEffect>();
this->emitUniforms(args.fBuilder, ge);
- fFocalUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kFloat_GrSLType, kDefault_GrSLPrecision,
- "Conical2FSParams");
+ fFocalUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kFloat_GrSLType, kDefault_GrSLPrecision,
+ "Conical2FSParams");
SkString tName("t");
// this is the distance along x-axis from the end center to focal point in
GrGLSLShaderVar focal = args.fBuilder->getUniformVariable(fFocalUni);
// if we have a vec3 from being in perspective, convert it to a vec2 first
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString coords2DString = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
const char* coords2D = coords2DString.c_str();
};
void CircleInside2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GLCircleInside2PtConicalEffect::GenKey(*this, caps, b);
}
void GLCircleInside2PtConicalEffect::emitCode(EmitArgs& args) {
const CircleInside2PtConicalEffect& ge = args.fFp.cast<CircleInside2PtConicalEffect>();
this->emitUniforms(args.fBuilder, ge);
- fCenterUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kVec2f_GrSLType, kDefault_GrSLPrecision,
- "Conical2FSCenter");
- fParamUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kVec3f_GrSLType, kDefault_GrSLPrecision,
- "Conical2FSParams");
+ fCenterUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kVec2f_GrSLType, kDefault_GrSLPrecision,
+ "Conical2FSCenter");
+ fParamUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kVec3f_GrSLType, kDefault_GrSLPrecision,
+ "Conical2FSParams");
SkString tName("t");
GrGLSLShaderVar center = args.fBuilder->getUniformVariable(fCenterUni);
GrGLSLShaderVar params = args.fBuilder->getUniformVariable(fParamUni);
// if we have a vec3 from being in perspective, convert it to a vec2 first
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString coords2DString = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
const char* coords2D = coords2DString.c_str();
};
void CircleOutside2PtConicalEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GLCircleOutside2PtConicalEffect::GenKey(*this, caps, b);
}
void GLCircleOutside2PtConicalEffect::emitCode(EmitArgs& args) {
const CircleOutside2PtConicalEffect& ge = args.fFp.cast<CircleOutside2PtConicalEffect>();
this->emitUniforms(args.fBuilder, ge);
- fCenterUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kVec2f_GrSLType, kDefault_GrSLPrecision,
- "Conical2FSCenter");
- fParamUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kVec4f_GrSLType, kDefault_GrSLPrecision,
- "Conical2FSParams");
+ fCenterUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kVec2f_GrSLType, kDefault_GrSLPrecision,
+ "Conical2FSCenter");
+ fParamUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kVec4f_GrSLType, kDefault_GrSLPrecision,
+ "Conical2FSParams");
SkString tName("t");
GrGLSLShaderVar center = args.fBuilder->getUniformVariable(fCenterUni);
GrGLSLShaderVar params = args.fBuilder->getUniformVariable(fParamUni);
// if we have a vec3 from being in perspective, convert it to a vec2 first
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString coords2DString = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
const char* coords2D = coords2DString.c_str();
#include "GrInvariantOutput.h"
#include "gl/GrGLGeometryProcessor.h"
#include "gl/GrGLUtil.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
+#include "glsl/GrGLSLVertexShaderBuilder.h"
/*
* The default Geometry Processor simply takes position and multiplies it by the uniform view
void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override {
const DefaultGeoProc& gp = args.fGP.cast<DefaultGeoProc>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
- GrGLFragmentBuilder* fs = args.fPB->getFragmentShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
+ GrGLSLFragmentBuilder* fs = args.fPB->getFragmentShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(gp);
fs->codeAppendf("%s = vec4(1);", args.fOutputCoverage);
} else {
const char* fragCoverage;
- fCoverageUniform = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fCoverageUniform = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType,
kDefault_GrSLPrecision,
"Coverage",
#include "GrFragmentProcessor.h"
#include "GrCoordTransform.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "effects/GrConstColorProcessor.h"
#include "effects/GrXfermodeFragmentProcessor.h"
GLFP() {}
void emitCode(EmitArgs& args) override {
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
this->emitChild(0, nullptr, args);
fsBuilder->codeAppendf("%s.rgb *= %s.rgb;", args.fOutputColor,
args.fInputColor);
GLFP() : fHaveSetColor(false) {}
void emitCode(EmitArgs& args) override {
const char* colorName;
- fColorUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"Color", &colorName);
this->emitChild(0, colorName, args);
#include "effects/GrRRectEffect.h"
#include "gl/GrGLUtil.h"
#include "gl/GrGLGeometryProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLVertexShaderBuilder.h"
// TODO(joshualitt) - Break this file up during GrBatch post implementation cleanup
void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override{
const CircleEdgeEffect& ce = args.fGP.cast<CircleEdgeEffect>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(ce);
this->emitTransforms(args.fPB, gpArgs->fPositionVar, ce.inPosition()->fName,
ce.localMatrix(), args.fTransformsIn, args.fTransformsOut);
- GrGLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
fsBuilder->codeAppendf("float d = length(%s.xy);", v.fsIn());
fsBuilder->codeAppendf("float edgeAlpha = clamp(%s.z * (1.0 - d), 0.0, 1.0);", v.fsIn());
if (ce.isStroked()) {
void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override{
const EllipseEdgeEffect& ee = args.fGP.cast<EllipseEdgeEffect>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(ee);
ee.localMatrix(), args.fTransformsIn, args.fTransformsOut);
// for outer curve
- GrGLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
fsBuilder->codeAppendf("vec2 scaledOffset = %s*%s.xy;", ellipseOffsets.fsIn(),
ellipseRadii.fsIn());
fsBuilder->codeAppend("float test = dot(scaledOffset, scaledOffset) - 1.0;");
void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override {
const DIEllipseEdgeEffect& ee = args.fGP.cast<DIEllipseEdgeEffect>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(ee);
this->emitTransforms(args.fPB, gpArgs->fPositionVar, ee.inPosition()->fName,
args.fTransformsIn, args.fTransformsOut);
- GrGLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
// for outer curve
fsBuilder->codeAppendf("vec2 scaledOffset = %s.xy;", offsets0.fsIn());
fsBuilder->codeAppend("float test = dot(scaledOffset, scaledOffset) - 1.0;");
#include "gl/GrGLGpu.h"
#include "glsl/GrGLSLCaps.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProcessorTypes.h"
+#include "glsl/GrGLSLProgramBuilder.h"
class GrGLPathProcessor : public GrGLPrimitiveProcessor {
public:
void emitCode(EmitArgs& args) override {
GrGLSLGPBuilder* pb = args.fPB;
- GrGLFragmentBuilder* fs = args.fPB->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fs = args.fPB->getFragmentShaderBuilder();
const GrPathProcessor& pathProc = args.fGP.cast<GrPathProcessor>();
// emit transforms
// Setup uniform color
if (pathProc.opts().readsColor()) {
const char* stagedLocalVarName;
- fColorUniform = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorUniform = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType,
kDefault_GrSLPrecision,
"Color",
#include "SkTraceEvent.h"
#include "batches/GrVertexBatch.h"
#include "gl/GrGLGeometryProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
GrAAConvexPathRenderer::GrAAConvexPathRenderer() {
void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override {
const QuadEdgeEffect& qe = args.fGP.cast<QuadEdgeEffect>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(qe);
this->emitTransforms(args.fPB, gpArgs->fPositionVar, qe.inPosition()->fName,
qe.localMatrix(), args.fTransformsIn, args.fTransformsOut);
- GrGLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
fsBuilder->codeAppendf("float edgeAlpha;");
// keep the derivative instructions outside the conditional
#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLGeometryProcessor.h"
#include "gl/GrGLUtil.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
class GrGLConicEffect : public GrGLGeometryProcessor {
void GrGLConicEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
GrGLSLGPBuilder* pb = args.fPB;
- GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
const GrConicEffect& gp = args.fGP.cast<GrConicEffect>();
// emit attributes
this->emitTransforms(pb, gpArgs->fPositionVar, gp.inPosition()->fName, gp.localMatrix(),
args.fTransformsIn, args.fTransformsOut);
- GrGLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
fsBuilder->codeAppend("float edgeAlpha;");
switch (fEdgeType) {
case kHairlineAA_GrProcessorEdgeType: {
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
fsBuilder->codeAppendf("vec3 dklmdx = dFdx(%s.xyz);", v.fsIn());
fsBuilder->codeAppendf("vec3 dklmdy = dFdy(%s.xyz);", v.fsIn());
fsBuilder->codeAppendf("float dfdx ="
}
case kFillAA_GrProcessorEdgeType: {
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
fsBuilder->codeAppendf("vec3 dklmdx = dFdx(%s.xyz);", v.fsIn());
fsBuilder->codeAppendf("vec3 dklmdy = dFdy(%s.xyz);", v.fsIn());
fsBuilder->codeAppendf("float dfdx ="
// TODO should we really be doing this?
if (gp.coverageScale() != 0xff) {
const char* coverageScale;
- fCoverageScaleUniform = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fCoverageScaleUniform = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType,
kDefault_GrSLPrecision,
"Coverage",
void GrGLQuadEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
GrGLSLGPBuilder* pb = args.fPB;
- GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
const GrQuadEffect& gp = args.fGP.cast<GrQuadEffect>();
// emit attributes
this->emitTransforms(pb, gpArgs->fPositionVar, gp.inPosition()->fName, gp.localMatrix(),
args.fTransformsIn, args.fTransformsOut);
- GrGLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
fsBuilder->codeAppendf("float edgeAlpha;");
switch (fEdgeType) {
case kHairlineAA_GrProcessorEdgeType: {
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
fsBuilder->codeAppendf("vec2 duvdx = dFdx(%s.xy);", v.fsIn());
fsBuilder->codeAppendf("vec2 duvdy = dFdy(%s.xy);", v.fsIn());
fsBuilder->codeAppendf("vec2 gF = vec2(2.0 * %s.x * duvdx.x - duvdx.y,"
}
case kFillAA_GrProcessorEdgeType: {
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
fsBuilder->codeAppendf("vec2 duvdx = dFdx(%s.xy);", v.fsIn());
fsBuilder->codeAppendf("vec2 duvdy = dFdy(%s.xy);", v.fsIn());
fsBuilder->codeAppendf("vec2 gF = vec2(2.0 * %s.x * duvdx.x - duvdx.y,"
if (0xff != gp.coverageScale()) {
const char* coverageScale;
- fCoverageScaleUniform = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fCoverageScaleUniform = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType,
kDefault_GrSLPrecision,
"Coverage",
}
void GrGLCubicEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
- GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
const GrCubicEffect& gp = args.fGP.cast<GrCubicEffect>();
// emit attributes
this->emitTransforms(args.fPB, gpArgs->fPositionVar, gp.inPosition()->fName, args.fTransformsIn,
args.fTransformsOut);
- GrGLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
GrGLSLShaderVar edgeAlpha("edgeAlpha", kFloat_GrSLType, 0, kHigh_GrSLPrecision);
GrGLSLShaderVar dklmdx("dklmdx", kVec3f_GrSLType, 0, kHigh_GrSLPrecision);
switch (fEdgeType) {
case kHairlineAA_GrProcessorEdgeType: {
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
fsBuilder->codeAppendf("%s = dFdx(%s.xyz);", dklmdx.c_str(), v.fsIn());
fsBuilder->codeAppendf("%s = dFdy(%s.xyz);", dklmdy.c_str(), v.fsIn());
fsBuilder->codeAppendf("%s = 3.0 * %s.x * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;",
}
case kFillAA_GrProcessorEdgeType: {
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
fsBuilder->codeAppendf("%s = dFdx(%s.xyz);", dklmdx.c_str(), v.fsIn());
fsBuilder->codeAppendf("%s = dFdy(%s.xyz);", dklmdy.c_str(), v.fsIn());
fsBuilder->codeAppendf("%s ="
#include "GrBicubicEffect.h"
#include "GrInvariantOutput.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#define DS(x) SkDoubleToScalar(x)
void GrGLBicubicEffect::emitCode(EmitArgs& args) {
const GrTextureDomain& domain = args.fFp.cast<GrBicubicEffect>().domain();
- fCoefficientsUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fCoefficientsUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kMat44f_GrSLType, kDefault_GrSLPrecision,
"Coefficients");
- fImageIncrementUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fImageIncrementUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"ImageIncrement");
GrGLSLShaderVar("c2", kVec4f_GrSLType),
GrGLSLShaderVar("c3", kVec4f_GrSLType),
};
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
fsBuilder->emitFunction(kVec4f_GrSLType,
"cubicBlend",
#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLTexture.h"
#include "gl/GrGLGeometryProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLVertexShaderBuilder.h"
class GrGLBitmapTextGeoProc : public GrGLGeometryProcessor {
public:
const GrBitmapTextGeoProc& cte = args.fGP.cast<GrBitmapTextGeoProc>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(cte);
this->emitTransforms(args.fPB, gpArgs->fPositionVar, cte.inPosition()->fName,
cte.localMatrix(), args.fTransformsIn, args.fTransformsOut);
- GrGLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
if (cte.maskFormat() == kARGB_GrMaskFormat) {
fsBuilder->codeAppendf("%s = ", args.fOutputColor);
fsBuilder->appendTextureLookupAndModulate(args.fOutputColor,
#include "GrSimpleTextureEffect.h"
#include "SkMatrix.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
class GrGLConfigConversionEffect : public GrGLFragmentProcessor {
public:
SkString tmpDecl;
tmpVar.appendDecl(args.fBuilder->glslCaps(), &tmpDecl);
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
fsBuilder->codeAppendf("%s;", tmpDecl.c_str());
///////////////////////////////////////////////////////////////////////////////
void GrConfigConversionEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GrGLConfigConversionEffect::GenKey(*this, caps, b);
}
#include "effects/GrConstColorProcessor.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
class GLConstColorProcessor : public GrGLFragmentProcessor {
GLConstColorProcessor() : fPrevColor(GrColor_ILLEGAL) {}
void emitCode(EmitArgs& args) override {
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const char* colorUni;
- fColorUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kMedium_GrSLPrecision, "constantColor",
&colorUni);
GrConstColorProcessor::InputMode mode = args.fFp.cast<GrConstColorProcessor>().inputMode();
#include "SkPathPriv.h"
#include "gl/GrGLContext.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
//////////////////////////////////////////////////////////////////////////////
const char *rectName;
// The rect uniform's xyzw refer to (left + 0.5, top + 0.5, right - 0.5, bottom - 0.5),
// respectively.
- fRectUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fRectUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType,
kDefault_GrSLPrecision,
"rect",
&rectName);
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const char* fragmentPos = fsBuilder->fragmentPosition();
if (GrProcessorEdgeTypeIsAA(aare.getEdgeType())) {
// The amount of coverage removed in x and y by the edges is computed as a pair of negative
const GrConvexPolyEffect& cpe = args.fFp.cast<GrConvexPolyEffect>();
const char *edgeArrayName;
- fEdgeUniform = args.fBuilder->addUniformArray(GrGLProgramBuilder::kFragment_Visibility,
+ fEdgeUniform = args.fBuilder->addUniformArray(GrGLSLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType,
kDefault_GrSLPrecision,
"edges",
cpe.getEdgeCount(),
&edgeArrayName);
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
fsBuilder->codeAppend("\t\tfloat alpha = 1.0;\n");
fsBuilder->codeAppend("\t\tfloat edge;\n");
const char* fragmentPos = fsBuilder->fragmentPosition();
}
void GrConvexPolyEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GrGLConvexPolyEffect::GenKey(*this, caps, b);
}
#include "GrConvolutionEffect.h"
#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLTexture.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
// For brevity
}
void GrGLConvolutionEffect::emitCode(EmitArgs& args) {
- fImageIncrementUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fImageIncrementUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"ImageIncrement");
if (this->useBounds()) {
- fBoundsUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fBoundsUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"Bounds");
}
- fKernelUni = args.fBuilder->addUniformArray(GrGLProgramBuilder::kFragment_Visibility,
+ fKernelUni = args.fBuilder->addUniformArray(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"Kernel", this->width());
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
fsBuilder->codeAppendf("\t\t%s = vec4(0, 0, 0, 0);\n", args.fOutputColor);
#include "GrProcessor.h"
#include "GrProcOptInfo.h"
#include "gl/GrGLXferProcessor.h"
-#include "gl/builders/GrGLFragmentShaderBuilder.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
class CoverageSetOpXP : public GrXferProcessor {
public:
private:
void emitOutputsForBlendState(const EmitArgs& args) override {
const CoverageSetOpXP& xp = args.fXP.cast<CoverageSetOpXP>();
- GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
if (xp.invertCoverage()) {
fsBuilder->codeAppendf("%s = 1.0 - %s;", args.fOutputPrimary, args.fInputCoverage);
#include "gl/GrGLSLBlend.h"
#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLProgramDataManager.h"
-#include "gl/builders/GrGLProgramBuilder.h"
#include "glsl/GrGLSLCaps.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
bool GrCustomXfermode::IsSupportedMode(SkXfermode::Mode mode) {
const CustomXP& xp = args.fXP.cast<CustomXP>();
SkASSERT(xp.hasHWBlendEquation());
- GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
fsBuilder->enableAdvancedBlendEquationIfNeeded(xp.hwBlendEquation());
// Apply coverage by multiplying it into the src color before blending. Mixed samples will
const CustomXP& xp = proc.cast<CustomXP>();
SkASSERT(!xp.hasHWBlendEquation());
- GrGLXPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
+ GrGLSLXPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
GrGLSLBlend::AppendMode(fsBuilder, srcColor, dstColor, outColor, xp.mode());
}
#include "batches/GrVertexBatch.h"
#include "gl/GrGLGeometryProcessor.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLVertexShaderBuilder.h"
///////////////////////////////////////////////////////////////////////////////
void GLDashingCircleEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
const DashingCircleEffect& dce = args.fGP.cast<DashingCircleEffect>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(dce);
args.fTransformsIn, args.fTransformsOut);
// transforms all points so that we can compare them to our test circle
- GrGLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
fsBuilder->codeAppendf("float xShifted = %s.x - floor(%s.x / %s.z) * %s.z;",
dashParams.fsIn(), dashParams.fsIn(), dashParams.fsIn(),
dashParams.fsIn());
const DashingLineEffect& de = args.fGP.cast<DashingLineEffect>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(de);
args.fTransformsIn, args.fTransformsOut);
// transforms all points so that we can compare them to our test rect
- GrGLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
fsBuilder->codeAppendf("float xShifted = %s.x - floor(%s.x / %s.z) * %s.z;",
inDashParams.fsIn(), inDashParams.fsIn(), inDashParams.fsIn(),
inDashParams.fsIn());
#include "effects/GrDisableColorXP.h"
#include "GrProcessor.h"
#include "gl/GrGLXferProcessor.h"
-#include "gl/builders/GrGLFragmentShaderBuilder.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
/**
// This emit code should be empty. However, on the nexus 6 there is a driver bug where if
// you do not give gl_FragColor a value, the gl context is lost and we end up drawing
// nothing. So this fix just sets the gl_FragColor arbitrarily to 0.
- GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
fsBuilder->codeAppendf("%s = vec4(0);", args.fOutputPrimary);
}
#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLTexture.h"
#include "gl/GrGLGeometryProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLVertexShaderBuilder.h"
// Assuming a radius of a little less than the diagonal of the fragment
#define SK_DistanceFieldAAFactor "0.65"
const GrDistanceFieldA8TextGeoProc& dfTexEffect =
args.fGP.cast<GrDistanceFieldA8TextGeoProc>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
- GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(dfTexEffect);
// adjust based on gamma
const char* distanceAdjustUniName = nullptr;
// width, height, 1/(3*width)
- fDistanceAdjustUni = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fDistanceAdjustUni = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"DistanceAdjust", &distanceAdjustUniName);
#endif
const GrDistanceFieldPathGeoProc& dfTexEffect = args.fGP.cast<GrDistanceFieldPathGeoProc>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
- GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(dfTexEffect);
args.fTransformsIn, args.fTransformsOut);
const char* textureSizeUniName = nullptr;
- fTextureSizeUni = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fTextureSizeUni = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"TextureSize", &textureSizeUniName);
args.fGP.cast<GrDistanceFieldLCDTextGeoProc>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(dfTexEffect);
dfTexEffect.inTextureCoords()->fName);
// add frag shader code
- GrGLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
// create LCD offset adjusted by inverse of transform
// Use highp to work around aliasing issues
// adjust width based on gamma
const char* distanceAdjustUniName = nullptr;
- fDistanceAdjustUni = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fDistanceAdjustUni = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, kDefault_GrSLPrecision,
"DistanceAdjust", &distanceAdjustUniName);
fsBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName);
#include "GrInvariantOutput.h"
#include "SkRect.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
//////////////////////////////////////////////////////////////////////////////
}
void GLDitherEffect::emitCode(EmitArgs& args) {
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
// Generate a random number based on the fragment position. For this
// random number generator, we use the "GLSL rand" function
// that seems to be floating around on the internet. It works under
//////////////////////////////////////////////////////////////////////////////
void DitherEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GLDitherEffect::GenKey(*this, caps, b);
}
int kWidth = fKernelSize.width();
int kHeight = fKernelSize.height();
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
fsBuilder->codeAppend("vec4 sum = vec4(0, 0, 0, 0);");
fsBuilder->codeAppendf("vec2 coord = %s - %s * %s;", coords2D.c_str(), kernelOffset,
for (int y = 0; y < kHeight; y++) {
for (int x = 0; x < kWidth; x++) {
- GrGLShaderBuilder::ShaderBlock block(fsBuilder);
+ GrGLSLShaderBuilder::ShaderBlock block(fsBuilder);
fsBuilder->codeAppendf("float k = %s[%d * %d + %d];", kernel, y, kWidth, x);
SkString coord;
coord.printf("coord + vec2(%d, %d) * %s", x, y, imgInc);
#include "GrInvariantOutput.h"
#include "SkRect.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
//////////////////////////////////////////////////////////////////////////////
const char *circleName;
// The circle uniform is (center.x, center.y, radius + 0.5, 1 / (radius + 0.5)) for regular
// fills and (..., radius - 0.5, 1 / (radius - 0.5)) for inverse fills.
- fCircleUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fCircleUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"circle",
&circleName);
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const char* fragmentPos = fsBuilder->fragmentPosition();
SkASSERT(kHairlineAA_GrProcessorEdgeType != ce.getEdgeType());
const char *ellipseName;
// The ellipse uniform is (center.x, center.y, 1 / rx^2, 1 / ry^2)
// The last two terms can underflow on mediump, so we use highp.
- fEllipseUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fEllipseUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kHigh_GrSLPrecision,
"ellipse",
&ellipseName);
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const char* fragmentPos = fsBuilder->fragmentPosition();
// d is the offset to the ellipse center
#include "GrXferProcessor.h"
#include "gl/GrGLSLBlend.h"
#include "gl/GrGLXferProcessor.h"
-#include "gl/builders/GrGLFragmentShaderBuilder.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
/**
///////////////////////////////////////////////////////////////////////////////
-static void append_color_output(const PorterDuffXferProcessor& xp, GrGLXPFragmentBuilder* fsBuilder,
+static void append_color_output(const PorterDuffXferProcessor& xp,
+ GrGLSLXPFragmentBuilder* fsBuilder,
BlendFormula::OutputType outputType, const char* output,
const char* inColor, const char* inCoverage) {
switch (outputType) {
private:
void emitOutputsForBlendState(const EmitArgs& args) override {
const PorterDuffXferProcessor& xp = args.fXP.cast<PorterDuffXferProcessor>();
- GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
BlendFormula blendFormula = xp.getBlendFormula();
if (blendFormula.hasSecondaryOutput()) {
void emitBlendCodeForDstRead(GrGLSLXPBuilder* pb, const char* srcColor, const char* dstColor,
const char* outColor, const GrXferProcessor& proc) override {
const ShaderPDXferProcessor& xp = proc.cast<ShaderPDXferProcessor>();
- GrGLXPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
+ GrGLSLXPFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
GrGLSLBlend::AppendMode(fsBuilder, srcColor, dstColor, outColor, xp.getXfermode());
}
///////////////////////////////////////////////////////////////////////////////
void ShaderPDXferProcessor::onGetGLProcessorKey(const GrGLSLCaps&,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GLShaderPDXferProcessor::GenKey(*this, b);
}
private:
void emitOutputsForBlendState(const EmitArgs& args) override {
- GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
fsBuilder->codeAppendf("%s = %s * %s;", args.fOutputPrimary, args.fInputColor,
args.fInputCoverage);
}
#include "GrOvalEffect.h"
#include "SkRRect.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
// The effects defined here only handle rrect radii >= kRadiusMin.
// edges correspond to components x, y, z, and w, respectively. When a side of the rrect has
// only rectangular corners, that side's value corresponds to the rect edge's value outset by
// half a pixel.
- fInnerRectUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kVec4f_GrSLType, kDefault_GrSLPrecision,
- "innerRect",
- &rectName);
- fRadiusPlusHalfUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kFloat_GrSLType, kDefault_GrSLPrecision,
- "radiusPlusHalf",
- &radiusPlusHalfName);
-
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ fInnerRectUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kVec4f_GrSLType, kDefault_GrSLPrecision,
+ "innerRect",
+ &rectName);
+ fRadiusPlusHalfUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kFloat_GrSLType, kDefault_GrSLPrecision,
+ "radiusPlusHalf",
+ &radiusPlusHalfName);
+
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const char* fragmentPos = fsBuilder->fragmentPosition();
// At each quarter-circle corner we compute a vector that is the offset of the fragment position
// from the circle center. The vector is pinned in x and y to be in the quarter-plane relevant
////////////////////////////////////////////////////////////////////////////////////////////////////
void CircularRRectEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GLCircularRRectEffect::GenKey(*this, caps, b);
}
const EllipticalRRectEffect& erre = args.fFp.cast<EllipticalRRectEffect>();
const char *rectName;
// The inner rect is the rrect bounds inset by the x/y radii
- fInnerRectUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fInnerRectUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"innerRect",
&rectName);
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const char* fragmentPos = fsBuilder->fragmentPosition();
// At each quarter-ellipse corner we compute a vector that is the offset of the fragment pos
// to the ellipse center. The vector is pinned in x and y to be in the quarter-plane relevant
switch (erre.getRRect().getType()) {
case SkRRect::kSimple_Type: {
const char *invRadiiXYSqdName;
- fInvRadiiSqdUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kVec2f_GrSLType, kHigh_GrSLPrecision,
- "invRadiiXY",
- &invRadiiXYSqdName);
+ fInvRadiiSqdUniform = args.fBuilder->addUniform(
+ GrGLSLProgramBuilder::kFragment_Visibility,
+ kVec2f_GrSLType, kHigh_GrSLPrecision,
+ "invRadiiXY",
+ &invRadiiXYSqdName);
fsBuilder->codeAppend("\t\tvec2 dxy = max(max(dxy0, dxy1), 0.0);\n");
// Z is the x/y offsets divided by squared radii.
fsBuilder->codeAppendf("\t\tvec2 Z = dxy * %s;\n", invRadiiXYSqdName);
}
case SkRRect::kNinePatch_Type: {
const char *invRadiiLTRBSqdName;
- fInvRadiiSqdUniform = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kVec4f_GrSLType, kHigh_GrSLPrecision,
- "invRadiiLTRB",
- &invRadiiLTRBSqdName);
+ fInvRadiiSqdUniform = args.fBuilder->addUniform(
+ GrGLSLProgramBuilder::kFragment_Visibility,
+ kVec4f_GrSLType, kHigh_GrSLPrecision,
+ "invRadiiLTRB",
+ &invRadiiLTRBSqdName);
fsBuilder->codeAppend("\t\tvec2 dxy = max(max(dxy0, dxy1), 0.0);\n");
// Z is the x/y offsets divided by squared radii. We only care about the (at most) one
// corner where both the x and y offsets are positive, hence the maxes. (The inverse
////////////////////////////////////////////////////////////////////////////////////////////////////
void EllipticalRRectEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GLEllipticalRRectEffect::GenKey(*this, caps, b);
}
#include "gl/GrGLCaps.h"
#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLTexture.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
class GrGLSimpleTextureEffect : public GrGLFragmentProcessor {
public:
GrGLSimpleTextureEffect(const GrProcessor&) {}
virtual void emitCode(EmitArgs& args) override {
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
fsBuilder->codeAppendf("\t%s = ", args.fOutputColor);
fsBuilder->appendTextureLookupAndModulate(args.fInputColor,
args.fSamplers[0],
}
void GrSimpleTextureEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
- GrProcessorKeyBuilder* b) const {
+ GrProcessorKeyBuilder* b) const {
GrGLSimpleTextureEffect::GenKey(*this, caps, b);
}
//////////////////////////////////////////////////////////////////////////////
-void GrTextureDomain::GLDomain::sampleTexture(GrGLShaderBuilder* builder,
+void GrTextureDomain::GLDomain::sampleTexture(GrGLSLShaderBuilder* builder,
const GrTextureDomain& textureDomain,
const char* outColor,
const SkString& inCoords,
}
case kDecal_Mode: {
// Add a block since we're going to declare variables.
- GrGLShaderBuilder::ShaderBlock block(builder);
+ GrGLSLShaderBuilder::ShaderBlock block(builder);
const char* domain = fDomainName.c_str();
if (!program->glslCaps()->canUseAnyFunctionInShader()) {
const GrTextureDomainEffect& textureDomainEffect = args.fFp.cast<GrTextureDomainEffect>();
const GrTextureDomain& domain = textureDomainEffect.textureDomain();
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(args.fCoords, 0);
fGLDomain.sampleTexture(fsBuilder, domain, args.fOutputColor, coords2D, args.fSamplers[0],
args.fInputColor);
#include "glsl/GrGLSLProgramDataManager.h"
class GrGLProgramBuilder;
-class GrGLShaderBuilder;
+class GrGLSLShaderBuilder;
class GrInvariantOutput;
class GrGLSLTextureSampler;
struct SkRect;
* @param inModulateColor if non-nullptr the sampled color will be modulated with this
* expression before being written to outColor.
*/
- void sampleTexture(GrGLShaderBuilder* builder,
+ void sampleTexture(GrGLSLShaderBuilder* builder,
const GrTextureDomain& textureDomain,
const char* outColor,
const SkString& inCoords,
#include "effects/GrConstColorProcessor.h"
#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLSLBlend.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "SkGrPriv.h"
class ComposeTwoFragmentProcessor : public GrFragmentProcessor {
void GLComposeTwoFragmentProcessor::emitCode(EmitArgs& args) {
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const ComposeTwoFragmentProcessor& cs = args.fFp.cast<ComposeTwoFragmentProcessor>();
const char* inputColor = nullptr;
GLComposeOneFragmentProcessor(const GrProcessor& processor) {}
void emitCode(EmitArgs& args) override {
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
SkXfermode::Mode mode = args.fFp.cast<ComposeOneFragmentProcessor>().mode();
ComposeOneFragmentProcessor::Child child =
args.fFp.cast<ComposeOneFragmentProcessor>().child();
#include "GrInvariantOutput.h"
#include "GrProcessor.h"
#include "gl/GrGLFragmentProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
namespace {
GLProcessor(const GrProcessor&) {}
virtual void emitCode(EmitArgs& args) override {
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
const char* yuvMatrix = nullptr;
- fMatrixUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
- kMat44f_GrSLType, kDefault_GrSLPrecision,
- "YUVMatrix", &yuvMatrix);
+ fMatrixUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
+ kMat44f_GrSLType, kDefault_GrSLPrecision,
+ "YUVMatrix", &yuvMatrix);
fsBuilder->codeAppendf("\t%s = vec4(\n\t\t", args.fOutputColor);
fsBuilder->appendTextureLookup(args.fSamplers[0], args.fCoords[0].c_str(),
args.fCoords[0].getType());
#include "GrGLFragmentProcessor.h"
#include "GrFragmentProcessor.h"
#include "GrProcessor.h"
-#include "builders/GrGLFragmentShaderBuilder.h"
-#include "builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
void GrGLFragmentProcessor::setData(const GrGLSLProgramDataManager& pdman,
const GrFragmentProcessor& processor) {
SkString* outputColor, EmitArgs& args) {
SkASSERT(outputColor);
- GrGLFragmentBuilder* fb = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fb = args.fBuilder->getFragmentShaderBuilder();
outputColor->append(fb->getMangleString());
fb->codeAppendf("vec4 %s;", outputColor->c_str());
this->internalEmitChild(childIndex, inputColor, outputColor->c_str(), args);
void GrGLFragmentProcessor::internalEmitChild(int childIndex, const char* inputColor,
const char* outputColor, EmitArgs& args) {
- GrGLFragmentBuilder* fb = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fb = args.fBuilder->getFragmentShaderBuilder();
fb->onBeforeChildProcEmitCode(); // call first so mangleString is updated
#include "GrGLGeometryProcessor.h"
-#include "builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProcessorTypes.h"
+#include "glsl/GrGLSLProgramBuilder.h"
+#include "glsl/GrGLSLVertexShaderBuilder.h"
void GrGLGeometryProcessor::emitCode(EmitArgs& args) {
- GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
GrGPArgs gpArgs;
this->onEmitCode(args, &gpArgs);
vsBuilder->transformToNormalizedDeviceSpace(gpArgs.fPositionVar);
const SkMatrix& localMatrix,
const TransformsIn& tin,
TransformsOut* tout) {
- GrGLVertexBuilder* vb = pb->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vb = pb->getVertexShaderBuilder();
tout->push_back_n(tin.count());
fInstalledTransforms.push_back_n(tin.count());
for (int i = 0; i < tin.count(); i++) {
const char* uniName;
fInstalledTransforms[i][t].fHandle =
- pb->addUniform(GrGLProgramBuilder::kVertex_Visibility,
+ pb->addUniform(GrGLSLProgramBuilder::kVertex_Visibility,
kMat33f_GrSLType, precision,
strUniName.c_str(),
&uniName).toIndex();
const char* localCoords,
const TransformsIn& tin,
TransformsOut* tout) {
- GrGLVertexBuilder* vb = pb->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vb = pb->getVertexShaderBuilder();
tout->push_back_n(tin.count());
for (int i = 0; i < tin.count(); i++) {
const ProcCoords& coordTransforms = tin[i];
void GrGLGeometryProcessor::setupPosition(GrGLSLGPBuilder* pb,
GrGPArgs* gpArgs,
const char* posName) {
- GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
vsBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName);
}
const char* posName,
const SkMatrix& mat,
UniformHandle* viewMatrixUniform) {
- GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
if (mat.isIdentity()) {
gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
vsBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName);
} else {
const char* viewMatrixName;
- *viewMatrixUniform = pb->addUniform(GrGLProgramBuilder::kVertex_Visibility,
+ *viewMatrixUniform = pb->addUniform(GrGLSLProgramBuilder::kVertex_Visibility,
kMat33f_GrSLType, kHigh_GrSLPrecision,
"uViewM",
&viewMatrixName);
#include "GrGLPrimitiveProcessor.h"
-#include "builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
SkMatrix GrGLPrimitiveProcessor::GetTransformMatrix(const SkMatrix& localMatrix,
const GrCoordTransform& coordTransform) {
void GrGLPrimitiveProcessor::setupUniformColor(GrGLSLGPBuilder* pb,
const char* outputName,
UniformHandle* colorUniform) {
- GrGLFragmentBuilder* fs = pb->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fs = pb->getFragmentShaderBuilder();
SkASSERT(colorUniform);
const char* stagedLocalVarName;
- *colorUniform = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ *colorUniform = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType,
kDefault_GrSLPrecision,
"Color",
#include "GrGLGpu.h"
#include "GrPipeline.h"
#include "SkChecksum.h"
-#include "gl/builders/GrGLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
/**
* Do we need to either map r,g,b->a or a->r. configComponentMask indicates which channels are
if (pipeline.readsFragPosition()) {
header->fFragPosKey =
- GrGLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.getRenderTarget());
+ GrGLSLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.getRenderTarget());
} else {
header->fFragPosKey = 0;
}
* found in the LICENSE file.
*/
#include "GrGLSLBlend.h"
-#include "gl/builders/GrGLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
//////////////////////////////////////////////////////////////////////////////
// Advanced (non-coeff) blend helpers
//////////////////////////////////////////////////////////////////////////////
-static void hard_light(GrGLFragmentBuilder* fsBuilder,
+static void hard_light(GrGLSLFragmentBuilder* fsBuilder,
const char* final,
const char* src,
const char* dst) {
}
// Does one component of color-dodge
-static void color_dodge_component(GrGLFragmentBuilder* fsBuilder,
+static void color_dodge_component(GrGLSLFragmentBuilder* fsBuilder,
const char* final,
const char* src,
const char* dst,
}
// Does one component of color-burn
-static void color_burn_component(GrGLFragmentBuilder* fsBuilder,
+static void color_burn_component(GrGLSLFragmentBuilder* fsBuilder,
const char* final,
const char* src,
const char* dst,
}
// Does one component of soft-light. Caller should have already checked that dst alpha > 0.
-static void soft_light_component_pos_dst_alpha(GrGLFragmentBuilder* fsBuilder,
+static void soft_light_component_pos_dst_alpha(GrGLSLFragmentBuilder* fsBuilder,
const char* final,
const char* src,
const char* dst,
// hue and saturation of the first color, the luminosity of the second color, and the input
// alpha. It has this signature:
// vec3 set_luminance(vec3 hueSatColor, float alpha, vec3 lumColor).
-static void add_lum_function(GrGLFragmentBuilder* fsBuilder, SkString* setLumFunction) {
+static void add_lum_function(GrGLSLFragmentBuilder* fsBuilder, SkString* setLumFunction) {
// Emit a helper that gets the luminance of a color.
SkString getFunction;
GrGLSLShaderVar getLumArgs[] = {
// Adds a function that creates a color with the hue and luminosity of one input color and
// the saturation of another color. It will have this signature:
// float set_saturation(vec3 hueLumColor, vec3 satColor)
-static void add_sat_function(GrGLFragmentBuilder* fsBuilder, SkString* setSatFunction) {
+static void add_sat_function(GrGLSLFragmentBuilder* fsBuilder, SkString* setSatFunction) {
// Emit a helper that gets the saturation of a color
SkString getFunction;
GrGLSLShaderVar getSatArgs[] = { GrGLSLShaderVar("color", kVec3f_GrSLType) };
setSatFunction);
}
-static void emit_advanced_xfermode_code(GrGLFragmentBuilder* fsBuilder, const char* srcColor,
+static void emit_advanced_xfermode_code(GrGLSLFragmentBuilder* fsBuilder, const char* srcColor,
const char* dstColor, const char* outputColor,
SkXfermode::Mode mode) {
SkASSERT(srcColor);
// Porter-Duff blend helper
//////////////////////////////////////////////////////////////////////////////
-static bool append_porterduff_term(GrGLFragmentBuilder* fsBuilder, SkXfermode::Coeff coeff,
+static bool append_porterduff_term(GrGLSLFragmentBuilder* fsBuilder, SkXfermode::Coeff coeff,
const char* colorName, const char* srcColorName,
const char* dstColorName, bool hasPrevious) {
if (SkXfermode::kZero_Coeff == coeff) {
//////////////////////////////////////////////////////////////////////////////
-void GrGLSLBlend::AppendMode(GrGLFragmentBuilder* fsBuilder, const char* srcColor,
+void GrGLSLBlend::AppendMode(GrGLSLFragmentBuilder* fsBuilder, const char* srcColor,
const char* dstColor, const char* outColor,
SkXfermode::Mode mode) {
#include "SkXfermode.h"
-class GrGLFragmentBuilder;
+class GrGLSLFragmentBuilder;
namespace GrGLSLBlend {
/*
* Appends GLSL code to fsBuilder that assigns a specified blend of the srcColor and dstColor
* variables to the outColor variable.
*/
- void AppendMode(GrGLFragmentBuilder* fsBuilder, const char* srcColor,
+ void AppendMode(GrGLSLFragmentBuilder* fsBuilder, const char* srcColor,
const char* dstColor, const char* outColor, SkXfermode::Mode mode);
};
#include "gl/GrGLXferProcessor.h"
#include "GrXferProcessor.h"
-#include "gl/builders/GrGLFragmentShaderBuilder.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
void GrGLXferProcessor::emitCode(const EmitArgs& args) {
return;
}
- GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
+ GrGLSLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
const char* dstColor = fsBuilder->dstColor();
if (args.fXP.getDstTexture()) {
const char* dstTopLeftName;
const char* dstCoordScaleName;
- fDstTopLeftUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fDstTopLeftUni = args.fPB->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType,
kDefault_GrSLPrecision,
"DstTextureUpperLeft",
&dstTopLeftName);
- fDstScaleUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fDstScaleUni = args.fPB->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType,
kDefault_GrSLPrecision,
"DstTextureCoordScale",
}
}
-bool GrGLProgramBuilder::compileAndAttachShaders(GrGLShaderBuilder& shader,
+bool GrGLProgramBuilder::compileAndAttachShaders(GrGLSLShaderBuilder& shader,
GrGLuint programId,
GrGLenum type,
SkTDArray<GrGLuint>* shaderIds) {
const GrGLCaps& caps = this->gpu()->glCaps();
if (fFS.hasCustomColorOutput() && caps.bindFragDataLocationSupport()) {
GL_CALL(BindFragDataLocation(programID, 0,
- GrGLFragmentShaderBuilder::DeclaredColorOutputName()));
+ GrGLSLFragmentShaderBuilder::DeclaredColorOutputName()));
}
if (fFS.hasSecondaryOutput() && caps.glslCaps()->mustDeclareFragmentShaderOutput()) {
GL_CALL(BindFragDataLocationIndexed(programID, 0, 1,
- GrGLFragmentShaderBuilder::DeclaredSecondaryColorOutputName()));
+ GrGLSLFragmentShaderBuilder::DeclaredSecondaryColorOutputName()));
}
// handle NVPR separable varyings
class GrFragmentProcessor;
class GrGLContextInfo;
-class GrGLShaderBuilder;
+class GrGLSLShaderBuilder;
class GrGLSLCaps;
-// Enough precision to represent 1 / 2048 accurately in printf
-#define GR_SIGNIFICANT_POW2_DECIMAL_DIG 11
-
/**
* The below struct represent processors installed in programs.
*/
GrGLSLTextureSampler::TextureSamplerArray* outSamplers,
GrGLInstalledProc<Proc>*);
- bool compileAndAttachShaders(GrGLShaderBuilder& shader,
+ bool compileAndAttachShaders(GrGLSLShaderBuilder& shader,
GrGLuint programId,
GrGLenum type,
SkTDArray<GrGLuint>* shaderIds);
SkTArray<UniformHandle> fSamplerUniforms;
SeparableVaryingInfoArray fSeparableVaryingInfos;
- friend class GrGLShaderBuilder;
- friend class GrGLVertexBuilder;
- friend class GrGLFragmentShaderBuilder;
- friend class GrGLGeometryBuilder;
+ friend class GrGLSLShaderBuilder;
+ friend class GrGLSLVertexBuilder;
+ friend class GrGLSLFragmentShaderBuilder;
+ friend class GrGLSLGeometryBuilder;
typedef GrGLSLProgramBuilder INHERITED;
};
* found in the LICENSE file.
*/
-#include "GrGLFragmentShaderBuilder.h"
+#include "GrGLSLFragmentShaderBuilder.h"
#include "GrRenderTarget.h"
#include "glsl/GrGLSL.h"
#include "glsl/GrGLSLCaps.h"
#include "glsl/GrGLSLProgramBuilder.h"
-const char* GrGLFragmentShaderBuilder::kDstTextureColorName = "_dstColor";
+const char* GrGLSLFragmentShaderBuilder::kDstTextureColorName = "_dstColor";
static const char* specific_layout_qualifier_name(GrBlendEquation equation) {
SkASSERT(GrBlendEquationIsAdvanced(equation));
kGrBlendEquationCnt - kFirstAdvancedGrBlendEquation);
}
-GrGLFragmentShaderBuilder::FragPosKey
-GrGLFragmentShaderBuilder::KeyForFragmentPosition(const GrRenderTarget* dst) {
+GrGLSLFragmentShaderBuilder::FragPosKey
+GrGLSLFragmentShaderBuilder::KeyForFragmentPosition(const GrRenderTarget* dst) {
if (kTopLeft_GrSurfaceOrigin == dst->origin()) {
return kTopLeftFragPosRead_FragPosKey;
} else {
}
}
-GrGLFragmentShaderBuilder::GrGLFragmentShaderBuilder(GrGLSLProgramBuilder* program,
- uint8_t fragPosKey)
+GrGLSLFragmentShaderBuilder::GrGLSLFragmentShaderBuilder(GrGLSLProgramBuilder* program,
+ uint8_t fragPosKey)
: INHERITED(program)
, fSetupFragPosition(false)
, fTopLeftFragPosRead(kTopLeftFragPosRead_FragPosKey == fragPosKey)
, fHasReadFragmentPosition(false) {
}
-bool GrGLFragmentShaderBuilder::enableFeature(GLSLFeature feature) {
+bool GrGLSLFragmentShaderBuilder::enableFeature(GLSLFeature feature) {
switch (feature) {
case kStandardDerivatives_GLSLFeature: {
if (!fProgramBuilder->glslCaps()->shaderDerivativeSupport()) {
}
}
-SkString GrGLFragmentShaderBuilder::ensureFSCoords2D(const GrGLSLTransformedCoordsArray& coords,
- int index) {
+SkString GrGLSLFragmentShaderBuilder::ensureFSCoords2D(const GrGLSLTransformedCoordsArray& coords,
+ int index) {
if (kVec3f_GrSLType != coords[index].getType()) {
SkASSERT(kVec2f_GrSLType == coords[index].getType());
return coords[index].getName();
return coords2D;
}
-const char* GrGLFragmentShaderBuilder::fragmentPosition() {
+const char* GrGLSLFragmentShaderBuilder::fragmentPosition() {
fHasReadFragmentPosition = true;
const GrGLSLCaps* glslCaps = fProgramBuilder->glslCaps();
}
}
-const char* GrGLFragmentShaderBuilder::dstColor() {
+const char* GrGLSLFragmentShaderBuilder::dstColor() {
fHasReadDstColor = true;
const GrGLSLCaps* glslCaps = fProgramBuilder->glslCaps();
if (glslCaps->fbFetchSupport()) {
- this->addFeature(1 << (GrGLFragmentShaderBuilder::kLastGLSLPrivateFeature + 1),
+ this->addFeature(1 << (GrGLSLFragmentShaderBuilder::kLastGLSLPrivateFeature + 1),
glslCaps->fbFetchExtensionString());
// Some versions of this extension string require declaring custom color output on ES 3.0+
}
}
-void GrGLFragmentShaderBuilder::enableAdvancedBlendEquationIfNeeded(GrBlendEquation equation) {
+void GrGLSLFragmentShaderBuilder::enableAdvancedBlendEquationIfNeeded(GrBlendEquation equation) {
SkASSERT(GrBlendEquationIsAdvanced(equation));
const GrGLSLCaps& caps = *fProgramBuilder->glslCaps();
}
}
-void GrGLFragmentShaderBuilder::enableCustomOutput() {
+void GrGLSLFragmentShaderBuilder::enableCustomOutput() {
if (!fHasCustomColorOutput) {
fHasCustomColorOutput = true;
fCustomColorOutputIndex = fOutputs.count();
}
}
-void GrGLFragmentShaderBuilder::enableSecondaryOutput() {
+void GrGLSLFragmentShaderBuilder::enableSecondaryOutput() {
SkASSERT(!fHasSecondaryOutput);
fHasSecondaryOutput = true;
const GrGLSLCaps& caps = *fProgramBuilder->glslCaps();
}
}
-const char* GrGLFragmentShaderBuilder::getPrimaryColorOutputName() const {
+const char* GrGLSLFragmentShaderBuilder::getPrimaryColorOutputName() const {
return fHasCustomColorOutput ? DeclaredColorOutputName() : "gl_FragColor";
}
-const char* GrGLFragmentShaderBuilder::getSecondaryColorOutputName() const {
+const char* GrGLSLFragmentShaderBuilder::getSecondaryColorOutputName() const {
const GrGLSLCaps& caps = *fProgramBuilder->glslCaps();
return caps.mustDeclareFragmentShaderOutput() ? DeclaredSecondaryColorOutputName()
: "gl_SecondaryFragColorEXT";
}
-void GrGLFragmentShaderBuilder::onFinalize() {
+void GrGLSLFragmentShaderBuilder::onFinalize() {
GrGLSLAppendDefaultFloatPrecisionDeclaration(kDefault_GrSLPrecision,
*fProgramBuilder->glslCaps(),
&this->precisionQualifier());
}
-void GrGLFragmentShaderBuilder::addVarying(GrGLSLVarying* v, GrSLPrecision fsPrec) {
+void GrGLSLFragmentShaderBuilder::addVarying(GrGLSLVarying* v, GrSLPrecision fsPrec) {
v->fFsIn = v->fVsOut;
if (v->fGsOut) {
v->fFsIn = v->fGsOut;
fInputs.push_back().set(v->fType, GrGLSLShaderVar::kVaryingIn_TypeModifier, v->fFsIn, fsPrec);
}
-void GrGLFragmentBuilder::onBeforeChildProcEmitCode() {
+void GrGLSLFragmentBuilder::onBeforeChildProcEmitCode() {
SkASSERT(fSubstageIndices.count() >= 1);
fSubstageIndices.push_back(0);
// second-to-last value in the fSubstageIndices stack is the index of the child proc
fMangleString.appendf("_c%d", fSubstageIndices[fSubstageIndices.count() - 2]);
}
-void GrGLFragmentBuilder::onAfterChildProcEmitCode() {
+void GrGLSLFragmentBuilder::onAfterChildProcEmitCode() {
SkASSERT(fSubstageIndices.count() >= 2);
fSubstageIndices.pop_back();
fSubstageIndices.back()++;
* found in the LICENSE file.
*/
-#ifndef GrGLFragmentShaderBuilder_DEFINED
-#define GrGLFragmentShaderBuilder_DEFINED
+#ifndef GrGLSLFragmentShaderBuilder_DEFINED
+#define GrGLSLFragmentShaderBuilder_DEFINED
-#include "GrGLShaderBuilder.h"
+#include "GrGLSLShaderBuilder.h"
#include "glsl/GrGLSLProcessorTypes.h"
/*
* This base class encapsulates the functionality which the GP uses to build fragment shaders
*/
-class GrGLFragmentBuilder : public GrGLShaderBuilder {
+class GrGLSLFragmentBuilder : public GrGLSLShaderBuilder {
public:
- GrGLFragmentBuilder(GrGLSLProgramBuilder* program)
+ GrGLSLFragmentBuilder(GrGLSLProgramBuilder* program)
: INHERITED(program)
, fHasCustomColorOutput(false)
, fHasSecondaryOutput(false) {
fSubstageIndices.push_back(0);
}
- virtual ~GrGLFragmentBuilder() {}
+ virtual ~GrGLSLFragmentBuilder() {}
/**
* Use of these features may require a GLSL extension to be enabled. Shaders may not compile
* if code is added that uses one of these features without calling enableFeature()
friend class GrGLPathProcessor;
- typedef GrGLShaderBuilder INHERITED;
+ typedef GrGLSLShaderBuilder INHERITED;
};
/*
* this builder to create their shader. Because this is the only shader builder the FP sees, we
* just call it FPShaderBuilder
*/
-class GrGLXPFragmentBuilder : public GrGLFragmentBuilder {
+class GrGLSLXPFragmentBuilder : public GrGLSLFragmentBuilder {
public:
- GrGLXPFragmentBuilder(GrGLSLProgramBuilder* program) : INHERITED(program) {}
+ GrGLSLXPFragmentBuilder(GrGLSLProgramBuilder* program) : INHERITED(program) {}
/** Returns the variable name that holds the color of the destination pixel. This may be nullptr if
no effect advertised that it will read the destination. */
virtual void enableAdvancedBlendEquationIfNeeded(GrBlendEquation) = 0;
private:
- typedef GrGLFragmentBuilder INHERITED;
+ typedef GrGLSLFragmentBuilder INHERITED;
};
// TODO rename to Fragment Builder
-class GrGLFragmentShaderBuilder : public GrGLXPFragmentBuilder {
+class GrGLSLFragmentShaderBuilder : public GrGLSLXPFragmentBuilder {
public:
typedef uint8_t FragPosKey;
the key is 0. */
static FragPosKey KeyForFragmentPosition(const GrRenderTarget* dst);
- GrGLFragmentShaderBuilder(GrGLSLProgramBuilder* program, uint8_t fragPosKey);
+ GrGLSLFragmentShaderBuilder(GrGLSLProgramBuilder* program, uint8_t fragPosKey);
// true public interface, defined explicitly in the abstract interfaces above
bool enableFeature(GLSLFeature) override;
void onFinalize() override;
/**
- * Features that should only be enabled by GrGLFragmentShaderBuilder itself.
+ * Features that should only be enabled by GrGLSLFragmentShaderBuilder itself.
*/
enum GLSLPrivateFeature {
kFragCoordConventions_GLSLPrivateFeature = kLastGLSLFeature + 1,
friend class GrGLProgramBuilder;
- typedef GrGLXPFragmentBuilder INHERITED;
+ typedef GrGLSLXPFragmentBuilder INHERITED;
};
#endif
* found in the LICENSE file.
*/
-#include "GrGLGeometryShaderBuilder.h"
-#include "GrGLProgramBuilder.h"
-#include "../GrGLGpu.h"
+#include "GrGLSLGeometryShaderBuilder.h"
+#include "GrGLSLProgramBuilder.h"
-GrGLGeometryBuilder::GrGLGeometryBuilder(GrGLSLProgramBuilder* program)
+GrGLSLGeometryBuilder::GrGLSLGeometryBuilder(GrGLSLProgramBuilder* program)
: INHERITED(program) {
}
-void GrGLGeometryBuilder::addVarying(const char* name, GrSLPrecision precision, GrGLSLVarying* v) {
+void GrGLSLGeometryBuilder::addVarying(const char* name,
+ GrSLPrecision precision,
+ GrGLSLVarying* v) {
// if we have a GS take each varying in as an array
// and output as non-array.
if (v->vsVarying()) {
* found in the LICENSE file.
*/
-#ifndef GrGLGeometryShaderBuilder_DEFINED
-#define GrGLGeometryShaderBuilder_DEFINED
+#ifndef GrGLSLGeometryShaderBuilder_DEFINED
+#define GrGLSLGeometryShaderBuilder_DEFINED
-#include "GrGLShaderBuilder.h"
+#include "GrGLSLShaderBuilder.h"
class GrGLSLVarying;
-class GrGLGeometryBuilder : public GrGLShaderBuilder {
+class GrGLSLGeometryBuilder : public GrGLSLShaderBuilder {
public:
- GrGLGeometryBuilder(GrGLSLProgramBuilder* program);
+ GrGLSLGeometryBuilder(GrGLSLProgramBuilder* program);
private:
/*
friend class GrGLProgramBuilder;
- typedef GrGLShaderBuilder INHERITED;
+ typedef GrGLSLShaderBuilder INHERITED;
};
#endif
#include "GrGeometryProcessor.h"
#include "GrGpu.h"
-#include "gl/builders/GrGLFragmentShaderBuilder.h"
-#include "gl/builders/GrGLGeometryShaderBuilder.h"
-#include "gl/builders/GrGLVertexShaderBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLGeometryShaderBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLVertexShaderBuilder.h"
class GrGLSLCaps;
class GrGLSLShaderVar;
+// Enough precision to represent 1 / 2048 accurately in printf
+#define GR_SIGNIFICANT_POW2_DECIMAL_DIG 11
+
class GrGLSLUniformBuilder {
public:
enum ShaderVisibility {
const char* fGsOut;
const char* fFsIn;
- friend class GrGLVertexBuilder;
- friend class GrGLGeometryBuilder;
- friend class GrGLXferBuilder;
- friend class GrGLFragmentShaderBuilder;
+ friend class GrGLSLVertexBuilder;
+ friend class GrGLSLGeometryBuilder;
+ friend class GrGLSLXferBuilder;
+ friend class GrGLSLFragmentShaderBuilder;
};
struct GrGLSLVertToFrag : public GrGLSLVarying {
GrSLPrecision fsPrecision = kDefault_GrSLPrecision) = 0;
// TODO rename getFragmentBuilder
- virtual GrGLFragmentBuilder* getFragmentShaderBuilder() = 0;
- virtual GrGLVertexBuilder* getVertexShaderBuilder() = 0;
+ virtual GrGLSLFragmentBuilder* getFragmentShaderBuilder() = 0;
+ virtual GrGLSLVertexBuilder* getVertexShaderBuilder() = 0;
/*
* *NOTE* NO MEMBERS ALLOWED, MULTIPLE INHERITANCE
/* a specializations for FPs. Lets the user add uniforms and FS code */
class GrGLSLFPBuilder : public virtual GrGLSLUniformBuilder {
public:
- virtual GrGLFragmentBuilder* getFragmentShaderBuilder() = 0;
+ virtual GrGLSLFragmentBuilder* getFragmentShaderBuilder() = 0;
/*
* *NOTE* NO MEMBERS ALLOWED, MULTIPLE INHERITANCE
/* a specializations for XPs. Lets the user add uniforms and FS code */
class GrGLSLXPBuilder : public virtual GrGLSLUniformBuilder {
public:
- virtual GrGLXPFragmentBuilder* getFragmentShaderBuilder() = 0;
+ virtual GrGLSLXPFragmentBuilder* getFragmentShaderBuilder() = 0;
/*
* *NOTE* NO MEMBERS ALLOWED, MULTIPLE INHERITANCE
public:
typedef GrGpu::DrawArgs DrawArgs;
- GrGLXPFragmentBuilder* getFragmentShaderBuilder() override { return &fFS; }
- GrGLVertexBuilder* getVertexShaderBuilder() override { return &fVS; }
+ GrGLSLXPFragmentBuilder* getFragmentShaderBuilder() override { return &fFS; }
+ GrGLSLVertexBuilder* getVertexShaderBuilder() override { return &fVS; }
// Handles for program uniforms (other than per-effect uniforms)
struct BuiltinUniformHandles {
// number of each input/output type in a single allocation block, used by many builders
static const int kVarsPerBlock;
- GrGLVertexBuilder fVS;
- GrGLGeometryBuilder fGS;
- GrGLFragmentShaderBuilder fFS;
+ GrGLSLVertexBuilder fVS;
+ GrGLSLGeometryBuilder fGS;
+ GrGLSLFragmentShaderBuilder fFS;
int fStageIndex;
BuiltinUniformHandles fUniformHandles;
private:
virtual void onAppendUniformDecls(ShaderVisibility visibility, SkString* out) const = 0;
- friend class GrGLShaderBuilder;
- friend class GrGLVertexBuilder;
- friend class GrGLFragmentShaderBuilder;
- friend class GrGLGeometryBuilder;
+ friend class GrGLSLShaderBuilder;
+ friend class GrGLSLVertexBuilder;
+ friend class GrGLSLFragmentShaderBuilder;
+ friend class GrGLSLGeometryBuilder;
};
#endif
* found in the LICENSE file.
*/
-#include "GrGLShaderBuilder.h"
+#include "glsl/GrGLSLShaderBuilder.h"
#include "glsl/GrGLSLCaps.h"
#include "glsl/GrGLSLShaderVar.h"
#include "glsl/GrGLSLTextureSampler.h"
}
}
-GrGLShaderBuilder::GrGLShaderBuilder(GrGLSLProgramBuilder* program)
+GrGLSLShaderBuilder::GrGLSLShaderBuilder(GrGLSLProgramBuilder* program)
: fProgramBuilder(program)
, fInputs(GrGLSLProgramBuilder::kVarsPerBlock)
, fOutputs(GrGLSLProgramBuilder::kVarsPerBlock)
this->main() = "void main() {";
}
-void GrGLShaderBuilder::declAppend(const GrGLSLShaderVar& var) {
+void GrGLSLShaderBuilder::declAppend(const GrGLSLShaderVar& var) {
SkString tempDecl;
var.appendDecl(fProgramBuilder->glslCaps(), &tempDecl);
this->codeAppendf("%s;", tempDecl.c_str());
}
-void GrGLShaderBuilder::emitFunction(GrSLType returnType,
- const char* name,
- int argCnt,
- const GrGLSLShaderVar* args,
- const char* body,
- SkString* outName) {
+void GrGLSLShaderBuilder::emitFunction(GrSLType returnType,
+ const char* name,
+ int argCnt,
+ const GrGLSLShaderVar* args,
+ const char* body,
+ SkString* outName) {
this->functions().append(GrGLSLTypeString(returnType));
fProgramBuilder->nameVariable(outName, '\0', name);
this->functions().appendf(" %s", outName->c_str());
this->functions().append("}\n\n");
}
-void GrGLShaderBuilder::appendTextureLookup(SkString* out,
- const GrGLSLTextureSampler& sampler,
- const char* coordName,
- GrSLType varyingType) const {
+void GrGLSLShaderBuilder::appendTextureLookup(SkString* out,
+ const GrGLSLTextureSampler& sampler,
+ const char* coordName,
+ GrSLType varyingType) const {
append_texture_lookup(out,
fProgramBuilder->glslCaps(),
fProgramBuilder->getUniformCStr(sampler.fSamplerUniform),
varyingType);
}
-void GrGLShaderBuilder::appendTextureLookup(const GrGLSLTextureSampler& sampler,
- const char* coordName,
- GrSLType varyingType) {
+void GrGLSLShaderBuilder::appendTextureLookup(const GrGLSLTextureSampler& sampler,
+ const char* coordName,
+ GrSLType varyingType) {
this->appendTextureLookup(&this->code(), sampler, coordName, varyingType);
}
-void GrGLShaderBuilder::appendTextureLookupAndModulate(const char* modulation,
- const GrGLSLTextureSampler& sampler,
- const char* coordName,
- GrSLType varyingType) {
+void GrGLSLShaderBuilder::appendTextureLookupAndModulate(const char* modulation,
+ const GrGLSLTextureSampler& sampler,
+ const char* coordName,
+ GrSLType varyingType) {
SkString lookup;
this->appendTextureLookup(&lookup, sampler, coordName, varyingType);
this->codeAppend((GrGLSLExpr4(modulation) * GrGLSLExpr4(lookup)).c_str());
}
-void GrGLShaderBuilder::addFeature(uint32_t featureBit, const char* extensionName) {
+void GrGLSLShaderBuilder::addFeature(uint32_t featureBit, const char* extensionName) {
if (!(featureBit & fFeaturesAddedMask)) {
this->extensions().appendf("#extension %s: require\n", extensionName);
fFeaturesAddedMask |= featureBit;
}
}
-void GrGLShaderBuilder::appendDecls(const VarArray& vars, SkString* out) const {
+void GrGLSLShaderBuilder::appendDecls(const VarArray& vars, SkString* out) const {
for (int i = 0; i < vars.count(); ++i) {
vars[i].appendDecl(fProgramBuilder->glslCaps(), out);
out->append(";\n");
}
}
-void GrGLShaderBuilder::addLayoutQualifier(const char* param, InterfaceQualifier interface) {
+void GrGLSLShaderBuilder::addLayoutQualifier(const char* param, InterfaceQualifier interface) {
SkASSERT(fProgramBuilder->glslCaps()->generation() >= k330_GrGLSLGeneration ||
fProgramBuilder->glslCaps()->mustEnableAdvBlendEqs());
fLayoutParams[interface].push_back() = param;
}
-void GrGLShaderBuilder::compileAndAppendLayoutQualifiers() {
+void GrGLSLShaderBuilder::compileAndAppendLayoutQualifiers() {
static const char* interfaceQualifierNames[] = {
"out"
};
this->layoutQualifiers().appendf(") %s;\n", interfaceQualifierNames[interface]);
}
- GR_STATIC_ASSERT(0 == GrGLShaderBuilder::kOut_InterfaceQualifier);
+ GR_STATIC_ASSERT(0 == GrGLSLShaderBuilder::kOut_InterfaceQualifier);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(interfaceQualifierNames) == kLastInterfaceQualifier + 1);
}
-void GrGLShaderBuilder::finalize(uint32_t visibility) {
+void GrGLSLShaderBuilder::finalize(uint32_t visibility) {
SkASSERT(!fFinalized);
this->versionDecl() = fProgramBuilder->glslCaps()->versionDeclString();
this->compileAndAppendLayoutQualifiers();
* found in the LICENSE file.
*/
-#ifndef GrGLShaderBuilder_DEFINED
-#define GrGLShaderBuilder_DEFINED
+#ifndef GrGLSLShaderBuilder_DEFINED
+#define GrGLSLShaderBuilder_DEFINED
#include "GrAllocator.h"
#include "glsl/GrGLSLShaderVar.h"
/**
base class for all shaders builders
*/
-class GrGLShaderBuilder {
+class GrGLSLShaderBuilder {
public:
- GrGLShaderBuilder(GrGLSLProgramBuilder* program);
- virtual ~GrGLShaderBuilder() {}
+ GrGLSLShaderBuilder(GrGLSLProgramBuilder* program);
+ virtual ~GrGLSLShaderBuilder() {}
void addInput(const GrGLSLShaderVar& input) { fInputs.push_back(input); }
void addOutput(const GrGLSLShaderVar& output) { fOutputs.push_back(output); }
*/
class ShaderBlock {
public:
- ShaderBlock(GrGLShaderBuilder* builder) : fBuilder(builder) {
+ ShaderBlock(GrGLSLShaderBuilder* builder) : fBuilder(builder) {
SkASSERT(builder);
fBuilder->codeAppend("{");
}
fBuilder->codeAppend("}");
}
private:
- GrGLShaderBuilder* fBuilder;
+ GrGLSLShaderBuilder* fBuilder;
};
protected:
GrPixelConfig fConfig;
char fSwizzle[5];
- friend class GrGLShaderBuilder;
+ friend class GrGLSLShaderBuilder;
};
#endif
* found in the LICENSE file.
*/
-#include "GrGLVertexShaderBuilder.h"
+#include "GrGLSLVertexShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
-GrGLVertexBuilder::GrGLVertexBuilder(GrGLSLProgramBuilder* program)
+GrGLSLVertexBuilder::GrGLSLVertexBuilder(GrGLSLProgramBuilder* program)
: INHERITED(program)
, fRtAdjustName(nullptr) {
}
-void GrGLVertexBuilder::addVarying(const char* name, GrSLPrecision precision, GrGLSLVarying* v) {
+void GrGLSLVertexBuilder::addVarying(const char* name, GrSLPrecision precision, GrGLSLVarying* v) {
fOutputs.push_back();
fOutputs.back().setType(v->fType);
fOutputs.back().setTypeModifier(GrGLSLShaderVar::kVaryingOut_TypeModifier);
v->fVsOut = fOutputs.back().getName().c_str();
}
-void GrGLVertexBuilder::emitAttributes(const GrGeometryProcessor& gp) {
+void GrGLSLVertexBuilder::emitAttributes(const GrGeometryProcessor& gp) {
int vaCount = gp.numAttribs();
for (int i = 0; i < vaCount; i++) {
this->addAttribute(&gp.getAttrib(i));
return;
}
-void GrGLVertexBuilder::transformToNormalizedDeviceSpace(const GrShaderVar& posVar) {
+void GrGLSLVertexBuilder::transformToNormalizedDeviceSpace(const GrShaderVar& posVar) {
SkASSERT(!fRtAdjustName);
GrSLPrecision precision = kDefault_GrSLPrecision;
this->codeAppend("gl_PointSize = 1.0;");
}
-bool GrGLVertexBuilder::addAttribute(const GrShaderVar& var) {
+bool GrGLSLVertexBuilder::addAttribute(const GrShaderVar& var) {
SkASSERT(GrShaderVar::kAttribute_TypeModifier == var.getTypeModifier());
for (int i = 0; i < fInputs.count(); ++i) {
const GrGLSLShaderVar& attr = fInputs[i];
* found in the LICENSE file.
*/
-#ifndef GrGLVertexShader_DEFINED
-#define GrGLVertexShader_DEFINED
+#ifndef GrGLSLVertexShader_DEFINED
+#define GrGLSLVertexShader_DEFINED
-#include "GrGLShaderBuilder.h"
+#include "GrGLSLShaderBuilder.h"
#include "GrGeometryProcessor.h"
class GrGLSLVarying;
-class GrGLVertexBuilder : public GrGLShaderBuilder {
+class GrGLSLVertexBuilder : public GrGLSLShaderBuilder {
public:
- GrGLVertexBuilder(GrGLSLProgramBuilder* program);
+ GrGLSLVertexBuilder(GrGLSLProgramBuilder* program);
void transformToNormalizedDeviceSpace(const GrShaderVar& posVar);
void emitAttributes(const GrGeometryProcessor& gp);
friend class GrGLProgramBuilder;
- typedef GrGLShaderBuilder INHERITED;
+ typedef GrGLSLShaderBuilder INHERITED;
};
#endif
#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLGpu.h"
-#include "gl/GrGLPathRendering.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
/*
* A dummy processor which just tries to insert a massive key and verify that it can retrieve the
virtual void emitCode(EmitArgs& args) override {
// pass through
- GrGLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
if (args.fInputColor) {
fsBuilder->codeAppendf("%s = %s;\n", args.fOutputColor, args.fInputColor);
} else {