FPs now use the correct builder types(just a rename)

BUG=skia:

Review URL: https://codereview.chromium.org/648463003
This commit is contained in:
joshualitt 2014-10-09 15:04:05 -07:00 committed by Commit bot
parent 1119c87065
commit 1598899975
35 changed files with 141 additions and 139 deletions

View File

@ -813,7 +813,7 @@ public:
GLProcessor(const GrBackendProcessorFactory& factory, const GrProcessor&)
: INHERITED(factory) {
}
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -823,7 +823,7 @@ public:
SkXfermode::Mode mode = fp.cast<XferEffect>().mode();
const GrTexture* backgroundTex =
fp.cast<XferEffect>().backgroundAccess().getTexture();
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
const char* dstColor;
if (backgroundTex) {
dstColor = "bgColor";
@ -973,7 +973,7 @@ public:
}
private:
static void HardLight(GrGLFragmentShaderBuilder* fsBuilder,
static void HardLight(GrGLFPFragmentBuilder* fsBuilder,
const char* final,
const char* src,
const char* dst) {
@ -992,7 +992,7 @@ public:
}
// Does one component of color-dodge
static void ColorDodgeComponent(GrGLFragmentShaderBuilder* fsBuilder,
static void ColorDodgeComponent(GrGLFPFragmentBuilder* fsBuilder,
const char* final,
const char* src,
const char* dst,
@ -1016,7 +1016,7 @@ public:
}
// Does one component of color-burn
static void ColorBurnComponent(GrGLFragmentShaderBuilder* fsBuilder,
static void ColorBurnComponent(GrGLFPFragmentBuilder* fsBuilder,
const char* final,
const char* src,
const char* dst,
@ -1037,7 +1037,7 @@ public:
}
// Does one component of soft-light. Caller should have already checked that dst alpha > 0.
static void SoftLightComponentPosDstAlpha(GrGLFragmentShaderBuilder* fsBuilder,
static void SoftLightComponentPosDstAlpha(GrGLFPFragmentBuilder* fsBuilder,
const char* final,
const char* src,
const char* dst,
@ -1075,7 +1075,7 @@ public:
// 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 AddLumFunction(GrGLFragmentShaderBuilder* fsBuilder, SkString* setLumFunction) {
static void AddLumFunction(GrGLFPFragmentBuilder* fsBuilder, SkString* setLumFunction) {
// Emit a helper that gets the luminance of a color.
SkString getFunction;
GrGLShaderVar getLumArgs[] = {
@ -1117,7 +1117,7 @@ public:
// 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 AddSatFunction(GrGLFragmentShaderBuilder* fsBuilder, SkString* setSatFunction) {
static void AddSatFunction(GrGLFPFragmentBuilder* fsBuilder, SkString* setSatFunction) {
// Emit a helper that gets the saturation of a color
SkString getFunction;
GrGLShaderVar getSatArgs[] = { GrGLShaderVar("color", kVec3f_GrSLType) };

View File

@ -120,7 +120,7 @@ class GrGLAlphaThresholdEffect : public GrGLFragmentProcessor {
public:
GrGLAlphaThresholdEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -143,7 +143,7 @@ GrGLAlphaThresholdEffect::GrGLAlphaThresholdEffect(const GrBackendProcessorFacto
: INHERITED(factory) {
}
void GrGLAlphaThresholdEffect::emitCode(GrGLProgramBuilder* builder,
void GrGLAlphaThresholdEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -157,7 +157,7 @@ void GrGLAlphaThresholdEffect::emitCode(GrGLProgramBuilder* builder,
GrGLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, "outer_threshold");
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0);
SkString maskCoords2D = fsBuilder->ensureFSCoords2D(coords, 1);

View File

@ -253,7 +253,7 @@ public:
GrGLArithmeticEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual ~GrGLArithmeticEffect();
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -361,7 +361,7 @@ GrGLArithmeticEffect::GrGLArithmeticEffect(const GrBackendProcessorFactory& fact
GrGLArithmeticEffect::~GrGLArithmeticEffect() {
}
void GrGLArithmeticEffect::emitCode(GrGLProgramBuilder* builder,
void GrGLArithmeticEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -370,7 +370,7 @@ void GrGLArithmeticEffect::emitCode(GrGLProgramBuilder* builder,
const TextureSamplerArray& samplers) {
GrTexture* backgroundTex = fp.cast<GrArithmeticEffect>().backgroundTexture();
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
const char* dstColor;
if (backgroundTex) {
fsBuilder->codeAppend("\t\tvec4 bgColor = ");

View File

@ -610,7 +610,7 @@ class GrGLRectBlurEffect : public GrGLFragmentProcessor {
public:
GrGLRectBlurEffect(const GrBackendProcessorFactory& factory,
const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -635,7 +635,7 @@ GrGLRectBlurEffect::GrGLRectBlurEffect(const GrBackendProcessorFactory& factory,
: INHERITED(factory) {
}
void OutputRectBlurProfileLookup(GrGLFragmentShaderBuilder* fsBuilder,
void OutputRectBlurProfileLookup(GrGLFPFragmentBuilder* fsBuilder,
const GrGLShaderBuilder::TextureSampler& sampler,
const char *output,
const char *profileSize, const char *loc,
@ -651,7 +651,7 @@ void OutputRectBlurProfileLookup(GrGLFragmentShaderBuilder* fsBuilder,
fsBuilder->codeAppendf("\t\t}\n");
}
void GrGLRectBlurEffect::emitCode(GrGLProgramBuilder* builder,
void GrGLRectBlurEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -671,7 +671,7 @@ void GrGLRectBlurEffect::emitCode(GrGLProgramBuilder* builder,
"profileSize",
&profileSizeName);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
const char *fragmentPos = fsBuilder->fragmentPosition();
if (inputColor) {
@ -974,7 +974,7 @@ class GrGLRRectBlurEffect : public GrGLFragmentProcessor {
public:
GrGLRRectBlurEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -996,7 +996,7 @@ GrGLRRectBlurEffect::GrGLRRectBlurEffect(const GrBackendProcessorFactory& factor
: INHERITED (factory) {
}
void GrGLRRectBlurEffect::emitCode(GrGLProgramBuilder* builder,
void GrGLRRectBlurEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -1023,7 +1023,7 @@ void GrGLRRectBlurEffect::emitCode(GrGLProgramBuilder* builder,
"blurRadius",
&blurRadiusName);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
const char* fragmentPos = fsBuilder->fragmentPosition();
// warp the fragment position to the appropriate part of the 9patch blur texture

View File

@ -212,7 +212,7 @@ public:
GLProcessor(const GrBackendProcessorFactory& factory, const GrProcessor&);
virtual ~GLProcessor();
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -278,7 +278,7 @@ GrColorProfileEffect::GLProcessor::GLProcessor(const GrBackendProcessorFactory&
GrColorProfileEffect::GLProcessor::~GLProcessor() {
}
void GrColorProfileEffect::GLProcessor::emitCode(GrGLProgramBuilder* builder,
void GrColorProfileEffect::GLProcessor::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -305,7 +305,7 @@ void GrColorProfileEffect::GLProcessor::emitCode(GrGLProgramBuilder* builder,
// Note: if implemented using texture3D in OpenGL ES older than OpenGL ES 3.0,
// the shader might need "#extension GL_OES_texture_3D : enable".
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
// Unpremultiply color
fsBuilder->codeAppendf("\tfloat %s = max(%s.a, 0.00001);\n", nonZeroAlpha, inputColor);

View File

@ -220,7 +220,7 @@ public:
: INHERITED(factory) {
}
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey&,
const char* outputColor,

View File

@ -361,7 +361,7 @@ public:
: INHERITED(factory) {
}
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -379,7 +379,7 @@ public:
// could optimize this case, but we aren't for now.
inputColor = "vec4(1)";
}
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->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", inputColor);

View File

@ -303,7 +303,7 @@ public:
const GrProcessor&);
virtual ~GrGLDisplacementMapEffect();
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -540,7 +540,7 @@ GrGLDisplacementMapEffect::GrGLDisplacementMapEffect(const GrBackendProcessorFac
GrGLDisplacementMapEffect::~GrGLDisplacementMapEffect() {
}
void GrGLDisplacementMapEffect::emitCode(GrGLProgramBuilder* builder,
void GrGLDisplacementMapEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -559,7 +559,7 @@ void GrGLDisplacementMapEffect::emitCode(GrGLProgramBuilder* builder,
// a number smaller than that to approximate 0, but
// leave room for 32-bit float GPU rounding errors.
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
fsBuilder->codeAppendf("\t\tvec4 %s = ", dColor);
fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coords[0].getType());
fsBuilder->codeAppend(";\n");

View File

@ -450,7 +450,7 @@ public:
* This is called by GrGLLightingEffect::emitCode() before either of the two virtual functions
* below. It adds a vec3f uniform visible in the FS that represents the constant light color.
*/
void emitLightColorUniform(GrGLProgramBuilder*);
void emitLightColorUniform(GrGLFPBuilder*);
/**
* These two functions are called from GrGLLightingEffect's emitCode() function.
@ -460,8 +460,8 @@ public:
* the FS. The default of emitLightColor appends the name of the constant light color uniform
* and so this function only needs to be overridden if the light color varies spatially.
*/
virtual void emitSurfaceToLight(GrGLProgramBuilder*, const char* z) = 0;
virtual void emitLightColor(GrGLProgramBuilder*, const char *surfaceToLight);
virtual void emitSurfaceToLight(GrGLFPBuilder*, const char* z) = 0;
virtual void emitLightColor(GrGLFPBuilder*, const char *surfaceToLight);
// This is called from GrGLLightingEffect's setData(). Subclasses of GrGLLight must call
// INHERITED::setData().
@ -488,7 +488,7 @@ public:
virtual ~GrGLDistantLight() {}
virtual void setData(const GrGLProgramDataManager&,
const SkLight* light) const SK_OVERRIDE;
virtual void emitSurfaceToLight(GrGLProgramBuilder*, const char* z) SK_OVERRIDE;
virtual void emitSurfaceToLight(GrGLFPBuilder*, const char* z) SK_OVERRIDE;
private:
typedef GrGLLight INHERITED;
@ -502,7 +502,7 @@ public:
virtual ~GrGLPointLight() {}
virtual void setData(const GrGLProgramDataManager&,
const SkLight* light) const SK_OVERRIDE;
virtual void emitSurfaceToLight(GrGLProgramBuilder*, const char* z) SK_OVERRIDE;
virtual void emitSurfaceToLight(GrGLFPBuilder*, const char* z) SK_OVERRIDE;
private:
typedef GrGLLight INHERITED;
@ -516,8 +516,8 @@ public:
virtual ~GrGLSpotLight() {}
virtual void setData(const GrGLProgramDataManager&,
const SkLight* light) const SK_OVERRIDE;
virtual void emitSurfaceToLight(GrGLProgramBuilder*, const char* z) SK_OVERRIDE;
virtual void emitLightColor(GrGLProgramBuilder*, const char *surfaceToLight) SK_OVERRIDE;
virtual void emitSurfaceToLight(GrGLFPBuilder*, const char* z) SK_OVERRIDE;
virtual void emitLightColor(GrGLFPBuilder*, const char *surfaceToLight) SK_OVERRIDE;
private:
typedef GrGLLight INHERITED;
@ -1228,7 +1228,7 @@ public:
GrGLLightingEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual ~GrGLLightingEffect();
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -1244,7 +1244,7 @@ public:
virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_OVERRIDE;
protected:
virtual void emitLightFunc(GrGLProgramBuilder*, SkString* funcName) = 0;
virtual void emitLightFunc(GrGLFPBuilder*, SkString* funcName) = 0;
private:
typedef GrGLFragmentProcessor INHERITED;
@ -1259,7 +1259,7 @@ private:
class GrGLDiffuseLightingEffect : public GrGLLightingEffect {
public:
GrGLDiffuseLightingEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitLightFunc(GrGLProgramBuilder*, SkString* funcName) SK_OVERRIDE;
virtual void emitLightFunc(GrGLFPBuilder*, SkString* funcName) SK_OVERRIDE;
virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_OVERRIDE;
private:
@ -1273,7 +1273,7 @@ private:
class GrGLSpecularLightingEffect : public GrGLLightingEffect {
public:
GrGLSpecularLightingEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitLightFunc(GrGLProgramBuilder*, SkString* funcName) SK_OVERRIDE;
virtual void emitLightFunc(GrGLFPBuilder*, SkString* funcName) SK_OVERRIDE;
virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_OVERRIDE;
private:
@ -1361,7 +1361,7 @@ GrGLLightingEffect::~GrGLLightingEffect() {
delete fLight;
}
void GrGLLightingEffect::emitCode(GrGLProgramBuilder* builder,
void GrGLLightingEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -1387,7 +1387,7 @@ void GrGLLightingEffect::emitCode(GrGLProgramBuilder* builder,
GrGLShaderVar("scale", kFloat_GrSLType),
};
SkString sobelFuncName;
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0);
fsBuilder->emitFunction(kFloat_GrSLType,
@ -1483,7 +1483,7 @@ GrGLDiffuseLightingEffect::GrGLDiffuseLightingEffect(const GrBackendProcessorFac
: INHERITED(factory, proc) {
}
void GrGLDiffuseLightingEffect::emitLightFunc(GrGLProgramBuilder* builder, SkString* funcName) {
void GrGLDiffuseLightingEffect::emitLightFunc(GrGLFPBuilder* builder, SkString* funcName) {
const char* kd;
fKDUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType,
@ -1562,7 +1562,7 @@ GrGLSpecularLightingEffect::GrGLSpecularLightingEffect(const GrBackendProcessorF
: INHERITED(factory, proc) {
}
void GrGLSpecularLightingEffect::emitLightFunc(GrGLProgramBuilder* builder, SkString* funcName) {
void GrGLSpecularLightingEffect::emitLightFunc(GrGLFPBuilder* builder, SkString* funcName) {
const char* ks;
const char* shininess;
@ -1598,12 +1598,12 @@ void GrGLSpecularLightingEffect::setData(const GrGLProgramDataManager& pdman,
}
///////////////////////////////////////////////////////////////////////////////
void GrGLLight::emitLightColorUniform(GrGLProgramBuilder* builder) {
void GrGLLight::emitLightColorUniform(GrGLFPBuilder* builder) {
fColorUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, "LightColor");
}
void GrGLLight::emitLightColor(GrGLProgramBuilder* builder,
void GrGLLight::emitLightColor(GrGLFPBuilder* builder,
const char *surfaceToLight) {
builder->getFragmentShaderBuilder()->codeAppend(builder->getUniformCStr(this->lightColorUni()));
}
@ -1623,7 +1623,7 @@ void GrGLDistantLight::setData(const GrGLProgramDataManager& pdman,
setUniformNormal3(pdman, fDirectionUni, distantLight->direction());
}
void GrGLDistantLight::emitSurfaceToLight(GrGLProgramBuilder* builder, const char* z) {
void GrGLDistantLight::emitSurfaceToLight(GrGLFPBuilder* builder, const char* z) {
const char* dir;
fDirectionUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility, kVec3f_GrSLType,
"LightDirection", &dir);
@ -1640,11 +1640,11 @@ void GrGLPointLight::setData(const GrGLProgramDataManager& pdman,
setUniformPoint3(pdman, fLocationUni, pointLight->location());
}
void GrGLPointLight::emitSurfaceToLight(GrGLProgramBuilder* builder, const char* z) {
void GrGLPointLight::emitSurfaceToLight(GrGLFPBuilder* builder, const char* z) {
const char* loc;
fLocationUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility, kVec3f_GrSLType,
"LightLocation", &loc);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
fsBuilder->codeAppendf("normalize(%s - vec3(%s.xy, %s))",
loc, fsBuilder->fragmentPosition(), z);
}
@ -1664,17 +1664,17 @@ void GrGLSpotLight::setData(const GrGLProgramDataManager& pdman,
setUniformNormal3(pdman, fSUni, spotLight->s());
}
void GrGLSpotLight::emitSurfaceToLight(GrGLProgramBuilder* builder, const char* z) {
void GrGLSpotLight::emitSurfaceToLight(GrGLFPBuilder* builder, const char* z) {
const char* location;
fLocationUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, "LightLocation", &location);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
fsBuilder->codeAppendf("normalize(%s - vec3(%s.xy, %s))",
location, fsBuilder->fragmentPosition(), z);
}
void GrGLSpotLight::emitLightColor(GrGLProgramBuilder* builder,
void GrGLSpotLight::emitLightColor(GrGLFPBuilder* builder,
const char *surfaceToLight) {
const char* color = builder->getUniformCStr(this->lightColorUni()); // created by parent class.
@ -1709,7 +1709,7 @@ void GrGLSpotLight::emitLightColor(GrGLProgramBuilder* builder,
color, cosOuter, coneScale);
lightColorBody.appendf("\t}\n");
lightColorBody.appendf("\treturn %s;\n", color);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
fsBuilder->emitFunction(kVec3f_GrSLType,
"lightColor",
SK_ARRAY_COUNT(gLightColorArgs),

View File

@ -82,7 +82,7 @@ public:
static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilder* b) {}
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -93,7 +93,7 @@ public:
inputColor = "vec4(1)";
}
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->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,

View File

@ -95,7 +95,7 @@ class GrGLMagnifierEffect : public GrGLFragmentProcessor {
public:
GrGLMagnifierEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -118,7 +118,7 @@ GrGLMagnifierEffect::GrGLMagnifierEffect(const GrBackendProcessorFactory& factor
: INHERITED(factory) {
}
void GrGLMagnifierEffect::emitCode(GrGLProgramBuilder* builder,
void GrGLMagnifierEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -138,7 +138,7 @@ void GrGLMagnifierEffect::emitCode(GrGLProgramBuilder* builder,
GrGLProgramBuilder::kVertex_Visibility,
kVec2f_GrSLType, "InvInset");
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0);
fsBuilder->codeAppendf("\t\tvec2 coord = %s;\n", coords2D.c_str());
fsBuilder->codeAppendf("\t\tvec2 zoom_coord = %s + %s * %s;\n",

View File

@ -332,7 +332,7 @@ class GrGLMorphologyEffect : public GrGLFragmentProcessor {
public:
GrGLMorphologyEffect (const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -362,7 +362,7 @@ GrGLMorphologyEffect::GrGLMorphologyEffect(const GrBackendProcessorFactory& fact
fType = m.type();
}
void GrGLMorphologyEffect::emitCode(GrGLProgramBuilder* builder,
void GrGLMorphologyEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -372,7 +372,7 @@ void GrGLMorphologyEffect::emitCode(GrGLProgramBuilder* builder,
fImageIncrementUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, "ImageIncrement");
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0);
const char* func;
switch (fType) {

View File

@ -515,7 +515,7 @@ public:
const GrProcessor&);
virtual ~GrGLPerlinNoise() {}
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -665,7 +665,7 @@ GrGLPerlinNoise::GrGLPerlinNoise(const GrBackendProcessorFactory& factory,
, fNumOctaves(processor.cast<GrPerlinNoiseEffect>().numOctaves()) {
}
void GrGLPerlinNoise::emitCode(GrGLProgramBuilder* builder,
void GrGLPerlinNoise::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -674,7 +674,7 @@ void GrGLPerlinNoise::emitCode(GrGLProgramBuilder* builder,
const TextureSamplerArray& samplers) {
sk_ignore_unused_variable(inputColor);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
SkString vCoords = fsBuilder->ensureFSCoords2D(coords, 0);
fBaseFrequencyUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,

View File

@ -316,7 +316,7 @@ class GLColorTableEffect : public GrGLFragmentProcessor {
public:
GLColorTableEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -337,7 +337,7 @@ GLColorTableEffect::GLColorTableEffect(const GrBackendProcessorFactory& factory,
: INHERITED(factory) {
}
void GLColorTableEffect::emitCode(GrGLProgramBuilder* builder,
void GLColorTableEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -347,7 +347,7 @@ void GLColorTableEffect::emitCode(GrGLProgramBuilder* builder,
static const float kColorScaleFactor = 255.0f / 256.0f;
static const float kColorOffsetFactor = 1.0f / 512.0f;
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
if (NULL == inputColor) {
// the input color is solid white (all ones).
static const float kMaxValue = kColorScaleFactor + kColorOffsetFactor;

View File

@ -956,7 +956,7 @@ GrGLGradientEffect::GrGLGradientEffect(const GrBackendProcessorFactory& factory)
GrGLGradientEffect::~GrGLGradientEffect() { }
void GrGLGradientEffect::emitUniforms(GrGLProgramBuilder* builder, uint32_t baseKey) {
void GrGLGradientEffect::emitUniforms(GrGLFPBuilder* builder, uint32_t baseKey) {
if (SkGradientShaderBase::kTwo_GpuColorType == ColorTypeFromKey(baseKey)) { // 2 Color case
fColorStartUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
@ -1056,13 +1056,13 @@ uint32_t GrGLGradientEffect::GenBaseGradientKey(const GrProcessor& processor) {
return key;
}
void GrGLGradientEffect::emitColor(GrGLProgramBuilder* builder,
void GrGLGradientEffect::emitColor(GrGLFPBuilder* builder,
const char* gradientTValue,
uint32_t baseKey,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray& samplers) {
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
if (SkGradientShaderBase::kTwo_GpuColorType == ColorTypeFromKey(baseKey)){
fsBuilder->codeAppendf("\tvec4 colorTemp = mix(%s, %s, clamp(%s, 0.0, 1.0));\n",
builder->getUniformVariable(fColorStartUni).c_str(),

View File

@ -415,13 +415,13 @@ protected:
// Emits the uniform used as the y-coord to texture samples in derived classes. Subclasses
// should call this method from their emitCode().
void emitUniforms(GrGLProgramBuilder* builder, uint32_t baseKey);
void emitUniforms(GrGLFPBuilder* builder, uint32_t baseKey);
// emit code that gets a fragment's color from an expression for t; Has branches for 3 separate
// control flows inside -- 2 color gradients, 3 color symmetric gradients (both using
// native GLSL mix), and 4+ color gradients that use the traditional texture lookup.
void emitColor(GrGLProgramBuilder* builder,
void emitColor(GrGLFPBuilder* builder,
const char* gradientTValue,
uint32_t baseKey,
const char* outputColor,

View File

@ -473,7 +473,7 @@ public:
virtual ~GrGLLinearGradient() { }
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -550,7 +550,7 @@ GrFragmentProcessor* GrLinearGradient::TestCreate(SkRandom* random,
/////////////////////////////////////////////////////////////////////
void GrGLLinearGradient::emitCode(GrGLProgramBuilder* builder,
void GrGLLinearGradient::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,

View File

@ -480,7 +480,7 @@ public:
const GrProcessor&) : INHERITED (factory) { }
virtual ~GrGLRadialGradient() { }
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -559,7 +559,7 @@ GrFragmentProcessor* GrRadialGradient::TestCreate(SkRandom* random,
/////////////////////////////////////////////////////////////////////
void GrGLRadialGradient::emitCode(GrGLProgramBuilder* builder,
void GrGLRadialGradient::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,

View File

@ -195,7 +195,7 @@ public:
const GrProcessor&) : INHERITED (factory) { }
virtual ~GrGLSweepGradient() { }
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -266,7 +266,7 @@ GrFragmentProcessor* GrSweepGradient::TestCreate(SkRandom* random,
/////////////////////////////////////////////////////////////////////
void GrGLSweepGradient::emitCode(GrGLProgramBuilder* builder,
void GrGLSweepGradient::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,

View File

@ -140,7 +140,7 @@ public:
GLEdge2PtConicalEffect(const GrBackendProcessorFactory& factory, const GrProcessor&);
virtual ~GLEdge2PtConicalEffect() { }
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -223,7 +223,7 @@ GLEdge2PtConicalEffect::GLEdge2PtConicalEffect(const GrBackendProcessorFactory&
, fCachedRadius(-SK_ScalarMax)
, fCachedDiffRadius(-SK_ScalarMax) {}
void GLEdge2PtConicalEffect::emitCode(GrGLProgramBuilder* builder,
void GLEdge2PtConicalEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -249,7 +249,7 @@ void GLEdge2PtConicalEffect::emitCode(GrGLProgramBuilder* builder,
SkASSERT(coords[0].getType() == coords[1].getType());
const char* coords2D;
SkString bVar;
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
if (kVec3f_GrSLType == coords[0].getType()) {
fsBuilder->codeAppendf("\tvec3 interpolants = vec3(%s.xy / %s.z, %s.x / %s.z);\n",
coords[0].c_str(), coords[0].c_str(), coords[1].c_str(),
@ -421,7 +421,7 @@ public:
GLFocalOutside2PtConicalEffect(const GrBackendProcessorFactory& factory, const GrProcessor&);
virtual ~GLFocalOutside2PtConicalEffect() { }
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -504,7 +504,7 @@ GLFocalOutside2PtConicalEffect::GLFocalOutside2PtConicalEffect(const GrBackendPr
fIsFlipped = data.isFlipped();
}
void GLFocalOutside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder,
void GLFocalOutside2PtConicalEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -523,7 +523,7 @@ void GLFocalOutside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder,
builder->getUniformVariable(fParamUni).appendArrayAccess(1, &p1);
// if we have a vec3 from being in perspective, convert it to a vec2 first
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
SkString coords2DString = fsBuilder->ensureFSCoords2D(coords, 0);
const char* coords2D = coords2DString.c_str();
@ -630,7 +630,7 @@ public:
GLFocalInside2PtConicalEffect(const GrBackendProcessorFactory& factory, const GrProcessor&);
virtual ~GLFocalInside2PtConicalEffect() {}
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -710,7 +710,7 @@ GLFocalInside2PtConicalEffect::GLFocalInside2PtConicalEffect(const GrBackendProc
, fFSVaryingName(NULL)
, fCachedFocal(SK_ScalarMax) {}
void GLFocalInside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder,
void GLFocalInside2PtConicalEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -728,7 +728,7 @@ void GLFocalInside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder,
GrGLShaderVar focal = builder->getUniformVariable(fFocalUni);
// if we have a vec3 from being in perspective, convert it to a vec2 first
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
SkString coords2DString = fsBuilder->ensureFSCoords2D(coords, 0);
const char* coords2D = coords2DString.c_str();
@ -875,7 +875,7 @@ public:
GLCircleInside2PtConicalEffect(const GrBackendProcessorFactory& factory, const GrProcessor&);
virtual ~GLCircleInside2PtConicalEffect() {}
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -963,7 +963,7 @@ GLCircleInside2PtConicalEffect::GLCircleInside2PtConicalEffect(const GrBackendPr
, fCachedB(SK_ScalarMax)
, fCachedC(SK_ScalarMax) {}
void GLCircleInside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder,
void GLCircleInside2PtConicalEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -985,7 +985,7 @@ void GLCircleInside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder,
GrGLShaderVar params = builder->getUniformVariable(fParamUni);
// if we have a vec3 from being in perspective, convert it to a vec2 first
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
SkString coords2DString = fsBuilder->ensureFSCoords2D(coords, 0);
const char* coords2D = coords2DString.c_str();
@ -1107,7 +1107,7 @@ public:
GLCircleOutside2PtConicalEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual ~GLCircleOutside2PtConicalEffect() {}
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -1203,7 +1203,7 @@ GLCircleOutside2PtConicalEffect::GLCircleOutside2PtConicalEffect(const GrBackend
fIsFlipped = data.isFlipped();
}
void GLCircleOutside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder,
void GLCircleOutside2PtConicalEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -1225,7 +1225,7 @@ void GLCircleOutside2PtConicalEffect::emitCode(GrGLProgramBuilder* builder,
GrGLShaderVar params = builder->getUniformVariable(fParamUni);
// if we have a vec3 from being in perspective, convert it to a vec2 first
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
SkString coords2DString = fsBuilder->ensureFSCoords2D(coords, 0);
const char* coords2D = coords2DString.c_str();

View File

@ -411,7 +411,7 @@ public:
GrGLRadial2Gradient(const GrBackendProcessorFactory& factory, const GrProcessor&);
virtual ~GrGLRadial2Gradient() { }
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -567,7 +567,7 @@ GrGLRadial2Gradient::GrGLRadial2Gradient(const GrBackendProcessorFactory& factor
fIsDegenerate = data.isDegenerate();
}
void GrGLRadial2Gradient::emitCode(GrGLProgramBuilder* builder,
void GrGLRadial2Gradient::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -596,7 +596,7 @@ void GrGLRadial2Gradient::emitCode(GrGLProgramBuilder* builder,
builder->getUniformVariable(fParamUni).appendArrayAccess(4, &p4);
builder->getUniformVariable(fParamUni).appendArrayAccess(5, &p5);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
// We interpolate the linear component in coords[1].
SkASSERT(coords[0].getType() == coords[1].getType());
const char* coords2D;

View File

@ -24,7 +24,7 @@ public:
GrGLBicubicEffect(const GrBackendProcessorFactory& factory,
const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -54,7 +54,7 @@ GrGLBicubicEffect::GrGLBicubicEffect(const GrBackendProcessorFactory& factory, c
: INHERITED(factory) {
}
void GrGLBicubicEffect::emitCode(GrGLProgramBuilder* builder,
void GrGLBicubicEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& effect,
const GrProcessorKey& key,
const char* outputColor,
@ -81,7 +81,7 @@ void GrGLBicubicEffect::emitCode(GrGLProgramBuilder* builder,
GrGLShaderVar("c2", kVec4f_GrSLType),
GrGLShaderVar("c3", kVec4f_GrSLType),
};
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0);
fsBuilder->emitFunction(kVec4f_GrSLType,
"cubicBlend",

View File

@ -24,7 +24,7 @@ public:
fPMConversion = configConversionEffect.pmConversion();
}
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -36,7 +36,7 @@ public:
SkString tmpDecl;
tmpVar.appendDecl(builder->ctxInfo(), &tmpDecl);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
fsBuilder->codeAppendf("%s;", tmpDecl.c_str());

View File

@ -89,7 +89,7 @@ class GLAARectEffect : public GrGLFragmentProcessor {
public:
GLAARectEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -113,7 +113,7 @@ GLAARectEffect::GLAARectEffect(const GrBackendProcessorFactory& factory,
fPrevRect.fLeft = SK_ScalarNaN;
}
void GLAARectEffect::emitCode(GrGLProgramBuilder* builder,
void GLAARectEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -129,7 +129,7 @@ void GLAARectEffect::emitCode(GrGLProgramBuilder* builder,
"rect",
&rectName);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->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
@ -183,7 +183,7 @@ class GrGLConvexPolyEffect : public GrGLFragmentProcessor {
public:
GrGLConvexPolyEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -207,7 +207,7 @@ GrGLConvexPolyEffect::GrGLConvexPolyEffect(const GrBackendProcessorFactory& fact
fPrevEdges[0] = SK_ScalarNaN;
}
void GrGLConvexPolyEffect::emitCode(GrGLProgramBuilder* builder,
void GrGLConvexPolyEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -222,7 +222,7 @@ void GrGLConvexPolyEffect::emitCode(GrGLProgramBuilder* builder,
"edges",
cpe.getEdgeCount(),
&edgeArrayName);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
fsBuilder->codeAppend("\t\tfloat alpha = 1.0;\n");
fsBuilder->codeAppend("\t\tfloat edge;\n");
const char* fragmentPos = fsBuilder->fragmentPosition();

View File

@ -19,7 +19,7 @@ class GrGLConvolutionEffect : public GrGLFragmentProcessor {
public:
GrGLConvolutionEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -55,7 +55,7 @@ GrGLConvolutionEffect::GrGLConvolutionEffect(const GrBackendProcessorFactory& fa
fDirection = c.direction();
}
void GrGLConvolutionEffect::emitCode(GrGLProgramBuilder* builder,
void GrGLConvolutionEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey& key,
const char* outputColor,
@ -71,7 +71,7 @@ void GrGLConvolutionEffect::emitCode(GrGLProgramBuilder* builder,
fKernelUni = builder->addUniformArray(GrGLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, "Kernel", this->width());
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0);
fsBuilder->codeAppendf("\t\t%s = vec4(0, 0, 0, 0);\n", outputColor);

View File

@ -71,7 +71,7 @@ class GLDitherEffect : public GrGLFragmentProcessor {
public:
GLDitherEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -88,14 +88,14 @@ GLDitherEffect::GLDitherEffect(const GrBackendProcessorFactory& factory,
: INHERITED (factory) {
}
void GLDitherEffect::emitCode(GrGLProgramBuilder* builder,
void GLDitherEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray&,
const TextureSamplerArray& samplers) {
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->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

View File

@ -15,7 +15,7 @@ class GrGLMatrixConvolutionEffect : public GrGLFragmentProcessor {
public:
GrGLMatrixConvolutionEffect(const GrBackendProcessorFactory& factory,
const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -51,7 +51,7 @@ GrGLMatrixConvolutionEffect::GrGLMatrixConvolutionEffect(const GrBackendProcesso
fConvolveAlpha = m.convolveAlpha();
}
void GrGLMatrixConvolutionEffect::emitCode(GrGLProgramBuilder* builder,
void GrGLMatrixConvolutionEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -84,7 +84,7 @@ void GrGLMatrixConvolutionEffect::emitCode(GrGLProgramBuilder* builder,
int kWidth = fKernelSize.width();
int kHeight = fKernelSize.height();
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0);
fsBuilder->codeAppend("vec4 sum = vec4(0, 0, 0, 0);");
fsBuilder->codeAppendf("vec2 coord = %s - %s * %s;", coords2D.c_str(), kernelOffset,

View File

@ -102,7 +102,7 @@ class GLCircleEffect : public GrGLFragmentProcessor {
public:
GLCircleEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -128,7 +128,7 @@ GLCircleEffect::GLCircleEffect(const GrBackendProcessorFactory& factory,
fPrevRadius = -1.f;
}
void GLCircleEffect::emitCode(GrGLProgramBuilder* builder,
void GLCircleEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -144,7 +144,7 @@ void GLCircleEffect::emitCode(GrGLProgramBuilder* builder,
"circle",
&circleName);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
const char* fragmentPos = fsBuilder->fragmentPosition();
SkASSERT(kHairlineAA_GrProcessorEdgeType != ce.getEdgeType());
@ -278,7 +278,7 @@ class GLEllipseEffect : public GrGLFragmentProcessor {
public:
GLEllipseEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -304,7 +304,7 @@ GLEllipseEffect::GLEllipseEffect(const GrBackendProcessorFactory& factory,
fPrevRadii.fX = -1.f;
}
void GLEllipseEffect::emitCode(GrGLProgramBuilder* builder,
void GLEllipseEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -319,7 +319,7 @@ void GLEllipseEffect::emitCode(GrGLProgramBuilder* builder,
"ellipse",
&ellipseName);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
const char* fragmentPos = fsBuilder->fragmentPosition();
// d is the offset to the ellipse center

View File

@ -137,7 +137,7 @@ class GLCircularRRectEffect : public GrGLFragmentProcessor {
public:
GLCircularRRectEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -162,7 +162,7 @@ GLCircularRRectEffect::GLCircularRRectEffect(const GrBackendProcessorFactory& fa
fPrevRRect.setEmpty();
}
void GLCircularRRectEffect::emitCode(GrGLProgramBuilder* builder,
void GLCircularRRectEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -185,7 +185,7 @@ void GLCircularRRectEffect::emitCode(GrGLProgramBuilder* builder,
"radiusPlusHalf",
&radiusPlusHalfName);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->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
@ -493,7 +493,7 @@ class GLEllipticalRRectEffect : public GrGLFragmentProcessor {
public:
GLEllipticalRRectEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& effect,
const GrProcessorKey& key,
const char* outputColor,
@ -518,7 +518,7 @@ GLEllipticalRRectEffect::GLEllipticalRRectEffect(const GrBackendProcessorFactory
fPrevRRect.setEmpty();
}
void GLEllipticalRRectEffect::emitCode(GrGLProgramBuilder* builder,
void GLEllipticalRRectEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& effect,
const GrProcessorKey& key,
const char* outputColor,
@ -533,7 +533,7 @@ void GLEllipticalRRectEffect::emitCode(GrGLProgramBuilder* builder,
"innerRect",
&rectName);
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->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

View File

@ -19,14 +19,14 @@ public:
: INHERITED (factory) {
}
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
const TextureSamplerArray& samplers) SK_OVERRIDE {
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
fsBuilder->codeAppendf("\t%s = ", outputColor);
fsBuilder->appendTextureLookupAndModulate(inputColor,
samplers[0],

View File

@ -169,7 +169,7 @@ class GrGLTextureDomainEffect : public GrGLFragmentProcessor {
public:
GrGLTextureDomainEffect(const GrBackendProcessorFactory&, const GrProcessor&);
virtual void emitCode(GrGLProgramBuilder*,
virtual void emitCode(GrGLFPBuilder*,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
@ -191,7 +191,7 @@ GrGLTextureDomainEffect::GrGLTextureDomainEffect(const GrBackendProcessorFactory
: INHERITED(factory) {
}
void GrGLTextureDomainEffect::emitCode(GrGLProgramBuilder* builder,
void GrGLTextureDomainEffect::emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,
@ -201,7 +201,7 @@ void GrGLTextureDomainEffect::emitCode(GrGLProgramBuilder* builder,
const GrTextureDomainEffect& textureDomainEffect = fp.cast<GrTextureDomainEffect>();
const GrTextureDomain& domain = textureDomainEffect.textureDomain();
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
SkString coords2D = fsBuilder->ensureFSCoords2D(coords, 0);
fGLDomain.sampleTexture(fsBuilder, domain, outputColor, coords2D, samplers[0], inputColor);
}

View File

@ -45,14 +45,14 @@ public:
: INHERITED(factory) {
}
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor&,
const GrProcessorKey&,
const char* outputColor,
const char* inputColor,
const TransformedCoordsArray& coords,
const TextureSamplerArray& samplers) SK_OVERRIDE {
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
const char* yuvMatrix = NULL;
fMatrixUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,

View File

@ -87,6 +87,8 @@ protected:
const GrBackendProcessorFactory& fFactory;
};
class GrGLFPBuilder;
class GrGLFragmentProcessor : public GrGLProcessor {
public:
GrGLFragmentProcessor(const GrBackendProcessorFactory& factory)
@ -113,7 +115,7 @@ public:
can be passed to the builder to emit texture reads in the generated
code.
*/
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& effect,
const GrProcessorKey& key,
const char* outputColor,

View File

@ -147,7 +147,7 @@ public:
virtual GrGpuGL* gpu() const SK_OVERRIDE { return fGpu; }
virtual GrGLFragmentShaderBuilder* getFragmentShaderBuilder() SK_OVERRIDE { return &fFS; }
virtual GrGLFPFragmentBuilder* getFragmentShaderBuilder() SK_OVERRIDE { return &fFS; }
virtual GrGLVertexBuilder* getVertexShaderBuilder() SK_OVERRIDE { return &fVS; }
virtual void addVarying(GrSLType type,

View File

@ -70,7 +70,7 @@ public:
GLBigKeyProcessor(const GrBackendProcessorFactory& factory, const GrProcessor&)
: INHERITED(factory) {}
virtual void emitCode(GrGLProgramBuilder* builder,
virtual void emitCode(GrGLFPBuilder* builder,
const GrFragmentProcessor& fp,
const GrProcessorKey& key,
const char* outputColor,