Make all GrFragmentProcessors GL independent.
TBR=bsalomon@google.com
BUG=skia:
Review URL: https://codereview.chromium.org/1434313002
diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp
index 6c73c36..4ce5b0d 100644
--- a/src/gpu/GrDefaultGeoProcFactory.cpp
+++ b/src/gpu/GrDefaultGeoProcFactory.cpp
@@ -9,10 +9,10 @@
#include "GrInvariantOutput.h"
#include "gl/GrGLGeometryProcessor.h"
-#include "gl/GrGLUtil.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLVertexShaderBuilder.h"
+#include "glsl/GrGLSLUtil.h"
/*
* The default Geometry Processor simply takes position and multiplies it by the uniform view
@@ -140,7 +140,7 @@
if (!dgp.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dgp.viewMatrix())) {
fViewMatrix = dgp.viewMatrix();
float viewMatrix[3 * 3];
- GrGLGetMatrix<3>(viewMatrix, fViewMatrix);
+ GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix);
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp
index 9b5677a..3741639 100644
--- a/src/gpu/GrFragmentProcessor.cpp
+++ b/src/gpu/GrFragmentProcessor.cpp
@@ -8,7 +8,7 @@
#include "GrFragmentProcessor.h"
#include "GrCoordTransform.h"
-#include "gl/GrGLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
@@ -50,8 +50,8 @@
return true;
}
-GrGLFragmentProcessor* GrFragmentProcessor::createGLInstance() const {
- GrGLFragmentProcessor* glFragProc = this->onCreateGLInstance();
+GrGLSLFragmentProcessor* GrFragmentProcessor::createGLInstance() const {
+ GrGLSLFragmentProcessor* glFragProc = this->onCreateGLInstance();
glFragProc->fChildProcessors.push_back_n(fChildProcessors.count());
for (int i = 0; i < fChildProcessors.count(); ++i) {
glFragProc->fChildProcessors[i] = fChildProcessors[i]->createGLInstance();
@@ -147,8 +147,8 @@
const char* name() const override { return "Premultiply"; }
private:
- GrGLFragmentProcessor* onCreateGLInstance() const override {
- class GLFP : public GrGLFragmentProcessor {
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override {
+ class GLFP : public GrGLSLFragmentProcessor {
public:
GLFP() {}
@@ -220,8 +220,8 @@
const char* name() const override { return "Replace Color"; }
- GrGLFragmentProcessor* onCreateGLInstance() const override {
- class GLFP : public GrGLFragmentProcessor {
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override {
+ class GLFP : public GrGLSLFragmentProcessor {
public:
GLFP() : fHaveSetColor(false) {}
void emitCode(EmitArgs& args) override {
@@ -297,8 +297,8 @@
const char* name() const override { return "Series"; }
- GrGLFragmentProcessor* onCreateGLInstance() const override {
- class GLFP : public GrGLFragmentProcessor {
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override {
+ class GLFP : public GrGLSLFragmentProcessor {
public:
GLFP() {}
void emitCode(EmitArgs& args) override {
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index c5d807c..ec79a95 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -21,12 +21,12 @@
#include "SkTLazy.h"
#include "batches/GrVertexBatch.h"
#include "effects/GrRRectEffect.h"
-#include "gl/GrGLUtil.h"
#include "gl/GrGLGeometryProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "glsl/GrGLSLVertexShaderBuilder.h"
+#include "glsl/GrGLSLUtil.h"
// TODO(joshualitt) - Break this file up during GrBatch post implementation cleanup
@@ -507,7 +507,7 @@
if (!dee.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dee.viewMatrix())) {
fViewMatrix = dee.viewMatrix();
float viewMatrix[3 * 3];
- GrGLGetMatrix<3>(viewMatrix, fViewMatrix);
+ GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix);
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index febf18f..d57861d 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -7,11 +7,11 @@
#include "GrBezierEffect.h"
-#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLGeometryProcessor.h"
-#include "gl/GrGLUtil.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLUtil.h"
class GrGLConicEffect : public GrGLGeometryProcessor {
public:
@@ -30,7 +30,7 @@
if (!ce.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(ce.viewMatrix())) {
fViewMatrix = ce.viewMatrix();
float viewMatrix[3 * 3];
- GrGLGetMatrix<3>(viewMatrix, fViewMatrix);
+ GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix);
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
@@ -246,7 +246,7 @@
if (!qe.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(qe.viewMatrix())) {
fViewMatrix = qe.viewMatrix();
float viewMatrix[3 * 3];
- GrGLGetMatrix<3>(viewMatrix, fViewMatrix);
+ GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix);
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
@@ -448,7 +448,7 @@
if (!ce.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(ce.viewMatrix())) {
fViewMatrix = ce.viewMatrix();
float viewMatrix[3 * 3];
- GrGLGetMatrix<3>(viewMatrix, fViewMatrix);
+ GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix);
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp
index 2857641..dedb927 100644
--- a/src/gpu/effects/GrBicubicEffect.cpp
+++ b/src/gpu/effects/GrBicubicEffect.cpp
@@ -21,7 +21,7 @@
};
-class GrGLBicubicEffect : public GrGLFragmentProcessor {
+class GrGLBicubicEffect : public GrGLSLFragmentProcessor {
public:
GrGLBicubicEffect(const GrProcessor&);
@@ -43,7 +43,7 @@
UniformHandle fImageIncrementUni;
GrTextureDomain::GLDomain fDomain;
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
GrGLBicubicEffect::GrGLBicubicEffect(const GrProcessor&) {
@@ -157,7 +157,7 @@
GrGLBicubicEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* GrBicubicEffect::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* GrBicubicEffect::onCreateGLInstance() const {
return new GrGLBicubicEffect(*this);
}
diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h
index 5a54cc1..67569d8 100644
--- a/src/gpu/effects/GrBicubicEffect.h
+++ b/src/gpu/effects/GrBicubicEffect.h
@@ -10,7 +10,7 @@
#include "GrSingleTextureEffect.h"
#include "GrTextureDomain.h"
-#include "gl/GrGLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
class GrGLBicubicEffect;
class GrInvariantOutput;
@@ -87,7 +87,7 @@
GrBicubicEffect(GrTexture*, const SkScalar coefficients[16], const SkMatrix &matrix,
const SkRect& domain);
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index 21dd5e7..7b17924 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -8,9 +8,8 @@
#include "GrBitmapTextGeoProc.h"
#include "GrInvariantOutput.h"
#include "GrTexture.h"
-#include "gl/GrGLFragmentProcessor.h"
-#include "gl/GrGLTexture.h"
#include "gl/GrGLGeometryProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 160773d..0273858 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -11,11 +11,11 @@
#include "GrInvariantOutput.h"
#include "GrSimpleTextureEffect.h"
#include "SkMatrix.h"
-#include "gl/GrGLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
-class GrGLConfigConversionEffect : public GrGLFragmentProcessor {
+class GrGLConfigConversionEffect : public GrGLSLFragmentProcessor {
public:
GrGLConfigConversionEffect(const GrProcessor& processor) {
const GrConfigConversionEffect& configConversionEffect =
@@ -91,7 +91,7 @@
bool fSwapRedAndBlue;
GrConfigConversionEffect::PMConversion fPMConversion;
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
@@ -147,7 +147,7 @@
GrGLConfigConversionEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* GrConfigConversionEffect::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* GrConfigConversionEffect::onCreateGLInstance() const {
return new GrGLConfigConversionEffect(*this);
}
diff --git a/src/gpu/effects/GrConfigConversionEffect.h b/src/gpu/effects/GrConfigConversionEffect.h
index cf2fea3..bf13afb 100644
--- a/src/gpu/effects/GrConfigConversionEffect.h
+++ b/src/gpu/effects/GrConfigConversionEffect.h
@@ -56,7 +56,7 @@
PMConversion pmConversion,
const SkMatrix& matrix);
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrConstColorProcessor.cpp b/src/gpu/effects/GrConstColorProcessor.cpp
index 5440dd3..09aa75d 100644
--- a/src/gpu/effects/GrConstColorProcessor.cpp
+++ b/src/gpu/effects/GrConstColorProcessor.cpp
@@ -6,12 +6,12 @@
*/
#include "effects/GrConstColorProcessor.h"
-#include "gl/GrGLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
-class GLConstColorProcessor : public GrGLFragmentProcessor {
+class GLConstColorProcessor : public GrGLSLFragmentProcessor {
public:
GLConstColorProcessor() : fPrevColor(GrColor_ILLEGAL) {}
@@ -63,7 +63,7 @@
GrGLSLProgramDataManager::UniformHandle fColorUniform;
GrColor fPrevColor;
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
///////////////////////////////////////////////////////////////////////////////
@@ -96,7 +96,7 @@
b->add32(fMode);
}
-GrGLFragmentProcessor* GrConstColorProcessor::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* GrConstColorProcessor::onCreateGLInstance() const {
return new GLConstColorProcessor;
}
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index c373b04..3beecb4 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -8,8 +8,7 @@
#include "GrConvexPolyEffect.h"
#include "GrInvariantOutput.h"
#include "SkPathPriv.h"
-#include "gl/GrGLContext.h"
-#include "gl/GrGLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
@@ -36,7 +35,7 @@
this->setWillReadFragmentPosition();
}
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
bool onIsEqual(const GrFragmentProcessor& other) const override {
const AARectEffect& aare = other.cast<AARectEffect>();
@@ -80,7 +79,7 @@
//////////////////////////////////////////////////////////////////////////////
-class GLAARectEffect : public GrGLFragmentProcessor {
+class GLAARectEffect : public GrGLSLFragmentProcessor {
public:
GLAARectEffect(const GrProcessor&);
@@ -94,7 +93,7 @@
private:
GrGLSLProgramDataManager::UniformHandle fRectUniform;
SkRect fPrevRect;
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
GLAARectEffect::GLAARectEffect(const GrProcessor& effect) {
@@ -161,13 +160,13 @@
GLAARectEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* AARectEffect::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* AARectEffect::onCreateGLInstance() const {
return new GLAARectEffect(*this);
}
//////////////////////////////////////////////////////////////////////////////
-class GrGLConvexPolyEffect : public GrGLFragmentProcessor {
+class GrGLConvexPolyEffect : public GrGLSLFragmentProcessor {
public:
GrGLConvexPolyEffect(const GrProcessor&);
@@ -181,7 +180,7 @@
private:
GrGLSLProgramDataManager::UniformHandle fEdgeUniform;
SkScalar fPrevEdges[3 * GrConvexPolyEffect::kMaxEdges];
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
GrGLConvexPolyEffect::GrGLConvexPolyEffect(const GrProcessor&) {
@@ -309,7 +308,7 @@
GrGLConvexPolyEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* GrConvexPolyEffect::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* GrConvexPolyEffect::onCreateGLInstance() const {
return new GrGLConvexPolyEffect(*this);
}
diff --git a/src/gpu/effects/GrConvexPolyEffect.h b/src/gpu/effects/GrConvexPolyEffect.h
index 9e7f154..6622ca3 100644
--- a/src/gpu/effects/GrConvexPolyEffect.h
+++ b/src/gpu/effects/GrConvexPolyEffect.h
@@ -72,7 +72,7 @@
private:
GrConvexPolyEffect(GrPrimitiveEdgeType edgeType, int n, const SkScalar edges[]);
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index 5367b27..55b44b7 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -6,8 +6,7 @@
*/
#include "GrConvolutionEffect.h"
-#include "gl/GrGLFragmentProcessor.h"
-#include "gl/GrGLTexture.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
@@ -15,7 +14,7 @@
// For brevity
typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
-class GrGLConvolutionEffect : public GrGLFragmentProcessor {
+class GrGLConvolutionEffect : public GrGLSLFragmentProcessor {
public:
GrGLConvolutionEffect(const GrProcessor&);
@@ -38,7 +37,7 @@
UniformHandle fImageIncrementUni;
UniformHandle fBoundsUni;
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
GrGLConvolutionEffect::GrGLConvolutionEffect(const GrProcessor& processor) {
@@ -200,7 +199,7 @@
GrGLConvolutionEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* GrConvolutionEffect::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* GrConvolutionEffect::onCreateGLInstance() const {
return new GrGLConvolutionEffect(*this);
}
diff --git a/src/gpu/effects/GrConvolutionEffect.h b/src/gpu/effects/GrConvolutionEffect.h
index 9db173a..0396415 100644
--- a/src/gpu/effects/GrConvolutionEffect.h
+++ b/src/gpu/effects/GrConvolutionEffect.h
@@ -80,7 +80,7 @@
bool useBounds,
float bounds[2]);
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index 574310c..e54627c 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -15,12 +15,10 @@
#include "GrTexture.h"
#include "GrTextureAccess.h"
#include "SkXfermode.h"
-#include "gl/GrGLCaps.h"
-#include "gl/GrGLGpu.h"
-#include "gl/GrGLSLBlend.h"
-#include "gl/GrGLFragmentProcessor.h"
-#include "gl/GrGLProgramDataManager.h"
+#include "gl/GrGLXferProcessor.h"
+#include "glsl/GrGLSLBlend.h"
#include "glsl/GrGLSLCaps.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index 3fa3014..612e976 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -22,7 +22,7 @@
#include "SkGr.h"
#include "batches/GrVertexBatch.h"
#include "gl/GrGLGeometryProcessor.h"
-#include "gl/GrGLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index 90a0898..a43171a 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -11,13 +11,13 @@
#include "SkDistanceFieldGen.h"
-#include "gl/GrGLFragmentProcessor.h"
-#include "gl/GrGLTexture.h"
#include "gl/GrGLGeometryProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "glsl/GrGLSLVertexShaderBuilder.h"
+#include "glsl/GrGLSLUtil.h"
// Assuming a radius of a little less than the diagonal of the fragment
#define SK_DistanceFieldAAFactor "0.65"
@@ -160,7 +160,7 @@
if (!dfa8gp.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dfa8gp.viewMatrix())) {
fViewMatrix = dfa8gp.viewMatrix();
float viewMatrix[3 * 3];
- GrGLGetMatrix<3>(viewMatrix, fViewMatrix);
+ GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix);
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
@@ -390,7 +390,7 @@
if (!dfpgp.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dfpgp.viewMatrix())) {
fViewMatrix = dfpgp.viewMatrix();
float viewMatrix[3 * 3];
- GrGLGetMatrix<3>(viewMatrix, fViewMatrix);
+ GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix);
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
@@ -659,7 +659,7 @@
if (!dflcd.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(dflcd.viewMatrix())) {
fViewMatrix = dflcd.viewMatrix();
float viewMatrix[3 * 3];
- GrGLGetMatrix<3>(viewMatrix, fViewMatrix);
+ GrGLSLGetMatrix<3>(viewMatrix, fViewMatrix);
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp
index fb02da5..692d873 100644
--- a/src/gpu/effects/GrDitherEffect.cpp
+++ b/src/gpu/effects/GrDitherEffect.cpp
@@ -9,7 +9,7 @@
#include "GrFragmentProcessor.h"
#include "GrInvariantOutput.h"
#include "SkRect.h"
-#include "gl/GrGLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
@@ -31,7 +31,7 @@
this->setWillReadFragmentPosition();
}
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
@@ -59,14 +59,14 @@
//////////////////////////////////////////////////////////////////////////////
-class GLDitherEffect : public GrGLFragmentProcessor {
+class GLDitherEffect : public GrGLSLFragmentProcessor {
public:
GLDitherEffect(const GrProcessor&);
virtual void emitCode(EmitArgs& args) override;
private:
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
GLDitherEffect::GLDitherEffect(const GrProcessor&) {
@@ -97,7 +97,7 @@
GLDitherEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* DitherEffect::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* DitherEffect::onCreateGLInstance() const {
return new GLDitherEffect(*this);
}
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
index 358f808..98611f9 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
@@ -5,12 +5,11 @@
* found in the LICENSE file.
*/
#include "GrMatrixConvolutionEffect.h"
-#include "gl/GrGLFragmentProcessor.h"
-#include "gl/GrGLTexture.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
-class GrGLMatrixConvolutionEffect : public GrGLFragmentProcessor {
+class GrGLMatrixConvolutionEffect : public GrGLSLFragmentProcessor {
public:
GrGLMatrixConvolutionEffect(const GrProcessor&);
virtual void emitCode(EmitArgs&) override;
@@ -32,7 +31,7 @@
UniformHandle fBiasUni;
GrTextureDomain::GLDomain fDomain;
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
GrGLMatrixConvolutionEffect::GrGLMatrixConvolutionEffect(const GrProcessor& processor) {
@@ -43,18 +42,18 @@
void GrGLMatrixConvolutionEffect::emitCode(EmitArgs& args) {
const GrTextureDomain& domain = args.fFp.cast<GrMatrixConvolutionEffect>().domain();
- fImageIncrementUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fImageIncrementUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"ImageIncrement");
- fKernelUni = args.fBuilder->addUniformArray(GrGLProgramBuilder::kFragment_Visibility,
+ fKernelUni = args.fBuilder->addUniformArray(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"Kernel",
fKernelSize.width() * fKernelSize.height());
- fKernelOffsetUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fKernelOffsetUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision, "KernelOffset");
- fGainUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fGainUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision, "Gain");
- fBiasUni = args.fBuilder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fBiasUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision, "Bias");
const char* kernelOffset = args.fBuilder->getUniformCStr(fKernelOffsetUni);
@@ -161,7 +160,7 @@
GrGLMatrixConvolutionEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* GrMatrixConvolutionEffect::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* GrMatrixConvolutionEffect::onCreateGLInstance() const {
return new GrGLMatrixConvolutionEffect(*this);
}
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.h b/src/gpu/effects/GrMatrixConvolutionEffect.h
index 3f16edb..6f6ca9d 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.h
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.h
@@ -66,7 +66,7 @@
GrTextureDomain::Mode tileMode,
bool convolveAlpha);
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp
index d34edbb..16e1c09 100644
--- a/src/gpu/effects/GrOvalEffect.cpp
+++ b/src/gpu/effects/GrOvalEffect.cpp
@@ -10,7 +10,7 @@
#include "GrFragmentProcessor.h"
#include "GrInvariantOutput.h"
#include "SkRect.h"
-#include "gl/GrGLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
@@ -33,7 +33,7 @@
private:
CircleEffect(GrPrimitiveEdgeType, const SkPoint& center, SkScalar radius);
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
@@ -91,7 +91,7 @@
//////////////////////////////////////////////////////////////////////////////
-class GLCircleEffect : public GrGLFragmentProcessor {
+class GLCircleEffect : public GrGLSLFragmentProcessor {
public:
GLCircleEffect(const GrProcessor&);
@@ -107,7 +107,7 @@
SkPoint fPrevCenter;
SkScalar fPrevRadius;
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
GLCircleEffect::GLCircleEffect(const GrProcessor&) {
@@ -179,7 +179,7 @@
GLCircleEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* CircleEffect::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* CircleEffect::onCreateGLInstance() const {
return new GLCircleEffect(*this);
}
@@ -202,7 +202,7 @@
private:
EllipseEffect(GrPrimitiveEdgeType, const SkPoint& center, SkScalar rx, SkScalar ry);
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
@@ -263,7 +263,7 @@
//////////////////////////////////////////////////////////////////////////////
-class GLEllipseEffect : public GrGLFragmentProcessor {
+class GLEllipseEffect : public GrGLSLFragmentProcessor {
public:
GLEllipseEffect(const GrProcessor&);
@@ -279,7 +279,7 @@
SkPoint fPrevCenter;
SkVector fPrevRadii;
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
GLEllipseEffect::GLEllipseEffect(const GrProcessor& effect) {
@@ -356,7 +356,7 @@
GLEllipseEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* EllipseEffect::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* EllipseEffect::onCreateGLInstance() const {
return new GLEllipseEffect(*this);
}
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
index 650a1e7..78d0f14 100644
--- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
@@ -13,8 +13,8 @@
#include "GrProcOptInfo.h"
#include "GrTypes.h"
#include "GrXferProcessor.h"
-#include "gl/GrGLSLBlend.h"
#include "gl/GrGLXferProcessor.h"
+#include "glsl/GrGLSLBlend.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index 398edcc..8b3b83d 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -12,7 +12,7 @@
#include "GrInvariantOutput.h"
#include "GrOvalEffect.h"
#include "SkRRect.h"
-#include "gl/GrGLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
@@ -60,7 +60,7 @@
private:
CircularRRectEffect(GrPrimitiveEdgeType, uint32_t circularCornerFlags, const SkRRect&);
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
@@ -126,7 +126,7 @@
//////////////////////////////////////////////////////////////////////////////
-class GLCircularRRectEffect : public GrGLFragmentProcessor {
+class GLCircularRRectEffect : public GrGLSLFragmentProcessor {
public:
GLCircularRRectEffect(const GrProcessor&);
@@ -141,7 +141,7 @@
GrGLSLProgramDataManager::UniformHandle fInnerRectUniform;
GrGLSLProgramDataManager::UniformHandle fRadiusPlusHalfUniform;
SkRRect fPrevRRect;
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
GLCircularRRectEffect::GLCircularRRectEffect(const GrProcessor& ) {
@@ -369,7 +369,7 @@
GLCircularRRectEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* CircularRRectEffect::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* CircularRRectEffect::onCreateGLInstance() const {
return new GLCircularRRectEffect(*this);
}
@@ -390,7 +390,7 @@
private:
EllipticalRRectEffect(GrPrimitiveEdgeType, const SkRRect&);
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
@@ -472,7 +472,7 @@
//////////////////////////////////////////////////////////////////////////////
-class GLEllipticalRRectEffect : public GrGLFragmentProcessor {
+class GLEllipticalRRectEffect : public GrGLSLFragmentProcessor {
public:
GLEllipticalRRectEffect(const GrProcessor&);
@@ -487,7 +487,7 @@
GrGLSLProgramDataManager::UniformHandle fInnerRectUniform;
GrGLSLProgramDataManager::UniformHandle fInvRadiiSqdUniform;
SkRRect fPrevRRect;
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
GLEllipticalRRectEffect::GLEllipticalRRectEffect(const GrProcessor& effect) {
@@ -620,7 +620,7 @@
GLEllipticalRRectEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* EllipticalRRectEffect::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* EllipticalRRectEffect::onCreateGLInstance() const {
return new GLEllipticalRRectEffect(*this);
}
diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp
index c1bc6df..0b03c99 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.cpp
+++ b/src/gpu/effects/GrSimpleTextureEffect.cpp
@@ -8,13 +8,11 @@
#include "GrSimpleTextureEffect.h"
#include "GrInvariantOutput.h"
#include "GrTexture.h"
-#include "gl/GrGLCaps.h"
-#include "gl/GrGLFragmentProcessor.h"
-#include "gl/GrGLTexture.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
-class GrGLSimpleTextureEffect : public GrGLFragmentProcessor {
+class GrGLSimpleTextureEffect : public GrGLSLFragmentProcessor {
public:
GrGLSimpleTextureEffect(const GrProcessor&) {}
@@ -29,7 +27,7 @@
}
private:
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
///////////////////////////////////////////////////////////////////////////////
@@ -43,7 +41,7 @@
GrGLSimpleTextureEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* GrSimpleTextureEffect::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* GrSimpleTextureEffect::onCreateGLInstance() const {
return new GrGLSimpleTextureEffect(*this);
}
diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h
index 4e5b421..e421162 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.h
+++ b/src/gpu/effects/GrSimpleTextureEffect.h
@@ -63,7 +63,7 @@
this->initClassID<GrSimpleTextureEffect>();
}
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index cd89a59..42d6d708 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -9,8 +9,7 @@
#include "GrInvariantOutput.h"
#include "GrSimpleTextureEffect.h"
#include "SkFloatingPoint.h"
-#include "gl/GrGLContext.h"
-#include "gl/GrGLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "glsl/GrGLSLTextureSampler.h"
@@ -173,7 +172,7 @@
//////////////////////////////////////////////////////////////////////////////
-class GrGLTextureDomainEffect : public GrGLFragmentProcessor {
+class GrGLTextureDomainEffect : public GrGLSLFragmentProcessor {
public:
GrGLTextureDomainEffect(const GrProcessor&);
@@ -186,7 +185,7 @@
private:
GrTextureDomain::GLDomain fGLDomain;
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
GrGLTextureDomainEffect::GrGLTextureDomainEffect(const GrProcessor&) {
@@ -253,7 +252,7 @@
GrGLTextureDomainEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* GrTextureDomainEffect::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* GrTextureDomainEffect::onCreateGLInstance() const {
return new GrGLTextureDomainEffect(*this);
}
diff --git a/src/gpu/effects/GrTextureDomain.h b/src/gpu/effects/GrTextureDomain.h
index 874cdbc..a215def 100644
--- a/src/gpu/effects/GrTextureDomain.h
+++ b/src/gpu/effects/GrTextureDomain.h
@@ -9,7 +9,7 @@
#define GrTextureDomainEffect_DEFINED
#include "GrSingleTextureEffect.h"
-#include "gl/GrGLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLProgramDataManager.h"
class GrGLProgramBuilder;
@@ -89,7 +89,7 @@
}
/**
- * A GrGLFragmentProcessor subclass that corresponds to a GrProcessor subclass that uses
+ * A GrGLSLFragmentProcessor subclass that corresponds to a GrProcessor subclass that uses
* GrTextureDomain should include this helper. It generates the texture domain GLSL, produces
* the part of the effect key that reflects the texture domain code, and performs the uniform
* uploads necessary for texture domains.
@@ -104,8 +104,8 @@
}
/**
- * Call this from GrGLFragmentProcessor::emitCode() to sample the texture W.R.T. the domain
- * and mode.
+ * Call this from GrGLSLFragmentProcessor::emitCode() to sample the texture W.R.T. the
+ * domain and mode.
*
* @param outcolor name of vec4 variable to hold the sampled color.
* @param inCoords name of vec2 variable containing the coords to be used with the domain.
@@ -121,7 +121,7 @@
const char* inModulateColor = nullptr);
/**
- * Call this from GrGLFragmentProcessor::setData() to upload uniforms necessary for the
+ * Call this from GrGLSLFragmentProcessor::setData() to upload uniforms necessary for the
* texture domain. The rectangle is automatically adjusted to account for the texture's
* origin.
*/
@@ -133,7 +133,7 @@
};
/**
- * GrGLFragmentProcessor::GenKey() must call this and include the returned value in it's
+ * GrGLSLFragmentProcessor::GenKey() must call this and include the returned value in it's
* computed key. The returned will be limited to the lower kDomainKeyBits bits.
*/
static uint32_t DomainKey(const GrTextureDomain& domain) {
@@ -187,7 +187,7 @@
GrTextureParams::FilterMode,
GrCoordSet);
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
index 0dbb6eb..a705df5 100644
--- a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
+++ b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
@@ -9,8 +9,8 @@
#include "GrFragmentProcessor.h"
#include "effects/GrConstColorProcessor.h"
-#include "gl/GrGLFragmentProcessor.h"
-#include "gl/GrGLSLBlend.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
+#include "glsl/GrGLSLBlend.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "SkGrPriv.h"
@@ -46,7 +46,7 @@
}
private:
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
SkXfermode::Mode fMode;
@@ -57,14 +57,14 @@
/////////////////////////////////////////////////////////////////////
-class GLComposeTwoFragmentProcessor : public GrGLFragmentProcessor {
+class GLComposeTwoFragmentProcessor : public GrGLSLFragmentProcessor {
public:
GLComposeTwoFragmentProcessor(const GrProcessor& processor) {}
void emitCode(EmitArgs&) override;
private:
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
/////////////////////////////////////////////////////////////////////
@@ -81,7 +81,7 @@
return new ComposeTwoFragmentProcessor(fpA, fpB, mode);
}
-GrGLFragmentProcessor* ComposeTwoFragmentProcessor::onCreateGLInstance() const{
+GrGLSLFragmentProcessor* ComposeTwoFragmentProcessor::onCreateGLInstance() const{
return new GLComposeTwoFragmentProcessor(*this);
}
@@ -202,7 +202,7 @@
}
private:
- GrGLFragmentProcessor* onCreateGLInstance() const override;
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override;
SkXfermode::Mode fMode;
Child fChild;
@@ -214,7 +214,7 @@
//////////////////////////////////////////////////////////////////////////////
-class GLComposeOneFragmentProcessor : public GrGLFragmentProcessor {
+class GLComposeOneFragmentProcessor : public GrGLSLFragmentProcessor {
public:
GLComposeOneFragmentProcessor(const GrProcessor& processor) {}
@@ -244,7 +244,7 @@
}
private:
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
/////////////////////////////////////////////////////////////////////
@@ -264,7 +264,7 @@
return new ComposeOneFragmentProcessor(dst, mode, child);
}
-GrGLFragmentProcessor* ComposeOneFragmentProcessor::onCreateGLInstance() const {
+GrGLSLFragmentProcessor* ComposeOneFragmentProcessor::onCreateGLInstance() const {
return new GLComposeOneFragmentProcessor(*this);
}
diff --git a/src/gpu/effects/GrYUVtoRGBEffect.cpp b/src/gpu/effects/GrYUVtoRGBEffect.cpp
index daf1ca3..e282512 100644
--- a/src/gpu/effects/GrYUVtoRGBEffect.cpp
+++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp
@@ -10,7 +10,7 @@
#include "GrCoordTransform.h"
#include "GrInvariantOutput.h"
#include "GrProcessor.h"
-#include "gl/GrGLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
@@ -52,7 +52,7 @@
return fColorSpace;
}
- class GLProcessor : public GrGLFragmentProcessor {
+ class GLProcessor : public GrGLSLFragmentProcessor {
public:
static const float kJPEGConversionMatrix[16];
static const float kRec601ConversionMatrix[16];
@@ -102,7 +102,7 @@
private:
GrGLSLProgramDataManager::UniformHandle fMatrixUni;
- typedef GrGLFragmentProcessor INHERITED;
+ typedef GrGLSLFragmentProcessor INHERITED;
};
private:
@@ -125,7 +125,7 @@
this->addTextureAccess(&fVAccess);
}
- GrGLFragmentProcessor* onCreateGLInstance() const override { return new GLProcessor(*this); }
+ GrGLSLFragmentProcessor* onCreateGLInstance() const override { return new GLProcessor(*this); }
virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
diff --git a/src/gpu/gl/GrGLGpuProgramCache.cpp b/src/gpu/gl/GrGLGpuProgramCache.cpp
index 84794ac..d5f2b9d 100644
--- a/src/gpu/gl/GrGLGpuProgramCache.cpp
+++ b/src/gpu/gl/GrGLGpuProgramCache.cpp
@@ -9,8 +9,8 @@
#include "builders/GrGLProgramBuilder.h"
#include "GrProcessor.h"
-#include "GrGLFragmentProcessor.h"
#include "GrGLPathRendering.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "SkRTConf.h"
#include "SkTSearch.h"
diff --git a/src/gpu/gl/GrGLPathRendering.h b/src/gpu/gl/GrGLPathRendering.h
index d61df2f..57209fd 100644
--- a/src/gpu/gl/GrGLPathRendering.h
+++ b/src/gpu/gl/GrGLPathRendering.h
@@ -11,8 +11,8 @@
#include "SkRefCnt.h"
#include "GrPathRendering.h"
#include "GrStencil.h"
-#include "gl/GrGLProgram.h"
#include "gl/GrGLTypes.h"
+#include "glsl/GrGLSLUtil.h"
class GrGLNameAllocator;
class GrGLGpu;
@@ -106,7 +106,7 @@
0, 0, 1);
}
combined.preConcat(fViewMatrix);
- GrGLGetMatrix<Size>(destMatrix, combined);
+ GrGLSLGetMatrix<Size>(destMatrix, combined);
}
};
GrGLGpu* gpu();
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 23e0df7..d6e7fac 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -17,7 +17,7 @@
#include "GrPathProcessor.h"
#include "GrPipeline.h"
#include "GrXferProcessor.h"
-#include "gl/GrGLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "SkXfermode.h"
#define GL_CALL(X) GR_GL_CALL(fGpu->glInterface(), X)
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index 2255dbd..7c482d5 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -6,11 +6,11 @@
*/
#include "GrGLProgramDesc.h"
-#include "GrGLFragmentProcessor.h"
#include "GrProcessor.h"
#include "GrGLGpu.h"
#include "GrPipeline.h"
#include "SkChecksum.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
/**
diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp
index 7f0713e..71d54c3 100644
--- a/src/gpu/gl/GrGLUtil.cpp
+++ b/src/gpu/gl/GrGLUtil.cpp
@@ -306,51 +306,6 @@
return GrGLGetRendererFromString((const char*) v);
}
-template<> void GrGLGetMatrix<3>(float* dest, const SkMatrix& src) {
- GR_STATIC_ASSERT(sizeof(float) == sizeof (GrGLfloat));
- // Col 0
- dest[0] = SkScalarToFloat(src[SkMatrix::kMScaleX]);
- dest[1] = SkScalarToFloat(src[SkMatrix::kMSkewY]);
- dest[2] = SkScalarToFloat(src[SkMatrix::kMPersp0]);
-
- // Col 1
- dest[3] = SkScalarToFloat(src[SkMatrix::kMSkewX]);
- dest[4] = SkScalarToFloat(src[SkMatrix::kMScaleY]);
- dest[5] = SkScalarToFloat(src[SkMatrix::kMPersp1]);
-
- // Col 2
- dest[6] = SkScalarToFloat(src[SkMatrix::kMTransX]);
- dest[7] = SkScalarToFloat(src[SkMatrix::kMTransY]);
- dest[8] = SkScalarToFloat(src[SkMatrix::kMPersp2]);
-}
-
-template<> void GrGLGetMatrix<4>(float* dest, const SkMatrix& src) {
- GR_STATIC_ASSERT(sizeof(float) == sizeof (GrGLfloat));
- // Col 0
- dest[0] = SkScalarToFloat(src[SkMatrix::kMScaleX]);
- dest[1] = SkScalarToFloat(src[SkMatrix::kMSkewY]);
- dest[2] = 0;
- dest[3] = SkScalarToFloat(src[SkMatrix::kMPersp0]);
-
- // Col 1
- dest[4] = SkScalarToFloat(src[SkMatrix::kMSkewX]);
- dest[5] = SkScalarToFloat(src[SkMatrix::kMScaleY]);
- dest[6] = 0;
- dest[7] = SkScalarToFloat(src[SkMatrix::kMPersp1]);
-
- // Col 2
- dest[8] = 0;
- dest[9] = 0;
- dest[10] = 1;
- dest[11] = 0;
-
- // Col 3
- dest[12] = SkScalarToFloat(src[SkMatrix::kMTransX]);
- dest[13] = SkScalarToFloat(src[SkMatrix::kMTransY]);
- dest[14] = 0;
- dest[15] = SkScalarToFloat(src[SkMatrix::kMPersp2]);
-}
-
GrGLenum GrToGLStencilFunc(GrStencilFunc basicFunc) {
static const GrGLenum gTable[] = {
GR_GL_ALWAYS, // kAlways_StencilFunc
diff --git a/src/gpu/gl/GrGLUtil.h b/src/gpu/gl/GrGLUtil.h
index dec784c..70af3a3 100644
--- a/src/gpu/gl/GrGLUtil.h
+++ b/src/gpu/gl/GrGLUtil.h
@@ -138,11 +138,6 @@
void GrGLClearErr(const GrGLInterface* gl);
-/**
- * Helper for converting SkMatrix to a column-major GL float array
- */
-template<int MatrixSize> void GrGLGetMatrix(float* dest, const SkMatrix& src);
-
////////////////////////////////////////////////////////////////////////////////
/**
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index 67ba083..51f9523 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -13,7 +13,6 @@
#include "GrTexture.h"
#include "SkRTConf.h"
#include "SkTraceEvent.h"
-#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLGeometryProcessor.h"
#include "gl/GrGLGpu.h"
#include "gl/GrGLProgram.h"
@@ -21,6 +20,7 @@
#include "gl/GrGLXferProcessor.h"
#include "gl/builders/GrGLShaderStringBuilder.h"
#include "glsl/GrGLSLCaps.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "glsl/GrGLSLTextureSampler.h"
@@ -259,7 +259,12 @@
SkSTArray<4, GrGLSLTextureSampler> samplers(fp.numTextures());
this->emitSamplers(fp, &samplers, ifp);
- GrGLFragmentProcessor::EmitArgs args(this, fp, outColor, inColor, fOutCoords[index], samplers);
+ GrGLSLFragmentProcessor::EmitArgs args(this,
+ fp,
+ outColor,
+ inColor,
+ fOutCoords[index],
+ samplers);
ifp->fGLProc->emitCode(args);
// We have to check that effects and the code they emit are consistent, ie if an effect
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.h b/src/gpu/gl/builders/GrGLProgramBuilder.h
index 21724c1..cb49c34 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.h
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.h
@@ -32,7 +32,7 @@
typedef GrGLInstalledProc<GrGLPrimitiveProcessor> GrGLInstalledGeoProc;
typedef GrGLInstalledProc<GrGLXferProcessor> GrGLInstalledXferProc;
-typedef GrGLInstalledProc<GrGLFragmentProcessor> GrGLInstalledFragProc;
+typedef GrGLInstalledProc<GrGLSLFragmentProcessor> GrGLInstalledFragProc;
struct GrGLInstalledFragProcs : public SkRefCnt {
virtual ~GrGLInstalledFragProcs();
diff --git a/src/gpu/gl/GrGLSLBlend.cpp b/src/gpu/glsl/GrGLSLBlend.cpp
similarity index 100%
rename from src/gpu/gl/GrGLSLBlend.cpp
rename to src/gpu/glsl/GrGLSLBlend.cpp
diff --git a/src/gpu/gl/GrGLSLBlend.h b/src/gpu/glsl/GrGLSLBlend.h
similarity index 100%
rename from src/gpu/gl/GrGLSLBlend.h
rename to src/gpu/glsl/GrGLSLBlend.h
diff --git a/src/gpu/gl/GrGLFragmentProcessor.cpp b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
similarity index 88%
rename from src/gpu/gl/GrGLFragmentProcessor.cpp
rename to src/gpu/glsl/GrGLSLFragmentProcessor.cpp
index 1d6f599..5868043 100644
--- a/src/gpu/gl/GrGLFragmentProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
@@ -5,14 +5,14 @@
* found in the LICENSE file.
*/
-#include "GrGLFragmentProcessor.h"
+#include "GrGLSLFragmentProcessor.h"
#include "GrFragmentProcessor.h"
#include "GrProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramBuilder.h"
-void GrGLFragmentProcessor::setData(const GrGLSLProgramDataManager& pdman,
- const GrFragmentProcessor& processor) {
+void GrGLSLFragmentProcessor::setData(const GrGLSLProgramDataManager& pdman,
+ const GrFragmentProcessor& processor) {
this->onSetData(pdman, processor);
SkASSERT(fChildProcessors.count() == processor.numChildProcessors());
for (int i = 0; i < fChildProcessors.count(); ++i) {
@@ -20,11 +20,11 @@
}
}
-void GrGLFragmentProcessor::emitChild(int childIndex, const char* inputColor, EmitArgs& args) {
+void GrGLSLFragmentProcessor::emitChild(int childIndex, const char* inputColor, EmitArgs& args) {
this->internalEmitChild(childIndex, inputColor, args.fOutputColor, args);
}
-void GrGLFragmentProcessor::emitChild(int childIndex, const char* inputColor,
+void GrGLSLFragmentProcessor::emitChild(int childIndex, const char* inputColor,
SkString* outputColor, EmitArgs& args) {
SkASSERT(outputColor);
@@ -34,8 +34,8 @@
this->internalEmitChild(childIndex, inputColor, outputColor->c_str(), args);
}
-void GrGLFragmentProcessor::internalEmitChild(int childIndex, const char* inputColor,
- const char* outputColor, EmitArgs& args) {
+void GrGLSLFragmentProcessor::internalEmitChild(int childIndex, const char* inputColor,
+ const char* outputColor, EmitArgs& args) {
GrGLSLFragmentBuilder* fb = args.fBuilder->getFragmentShaderBuilder();
fb->onBeforeChildProcEmitCode(); // call first so mangleString is updated
diff --git a/src/gpu/gl/GrGLFragmentProcessor.h b/src/gpu/glsl/GrGLSLFragmentProcessor.h
similarity index 90%
rename from src/gpu/gl/GrGLFragmentProcessor.h
rename to src/gpu/glsl/GrGLSLFragmentProcessor.h
index 311612d..fa4f043 100644
--- a/src/gpu/gl/GrGLFragmentProcessor.h
+++ b/src/gpu/glsl/GrGLSLFragmentProcessor.h
@@ -5,8 +5,8 @@
* found in the LICENSE file.
*/
-#ifndef GrGLFragmentProcessor_DEFINED
-#define GrGLFragmentProcessor_DEFINED
+#ifndef GrGLSLFragmentProcessor_DEFINED
+#define GrGLSLFragmentProcessor_DEFINED
#include "glsl/GrGLSLProcessorTypes.h"
#include "glsl/GrGLSLProgramDataManager.h"
@@ -17,11 +17,11 @@
class GrGLSLFPBuilder;
class GrGLSLCaps;
-class GrGLFragmentProcessor {
+class GrGLSLFragmentProcessor {
public:
- GrGLFragmentProcessor() {}
+ GrGLSLFragmentProcessor() {}
- virtual ~GrGLFragmentProcessor() {
+ virtual ~GrGLSLFragmentProcessor() {
for (int i = 0; i < fChildProcessors.count(); ++i) {
delete fChildProcessors[i];
}
@@ -78,7 +78,7 @@
int numChildProcessors() const { return fChildProcessors.count(); }
- GrGLFragmentProcessor* childProcessor(int index) const {
+ GrGLSLFragmentProcessor* childProcessor(int index) const {
return fChildProcessors[index];
}
@@ -97,18 +97,18 @@
void emitChild(int childIndex, const char* inputColor, EmitArgs& parentArgs);
protected:
- /** A GrGLFragmentProcessor instance can be reused with any GrFragmentProcessor that produces
+ /** A GrGLSLFragmentProcessor instance can be reused with any GrFragmentProcessor that produces
the same stage key; this function reads data from a GrFragmentProcessor and uploads any
uniform variables required by the shaders created in emitCode(). The GrFragmentProcessor
- parameter is guaranteed to be of the same type that created this GrGLFragmentProcessor and
- to have an identical processor key as the one that created this GrGLFragmentProcessor. */
+ parameter is guaranteed to be of the same type that created this GrGLSLFragmentProcessor and
+ to have an identical processor key as the one that created this GrGLSLFragmentProcessor. */
// TODO update this to pass in GrFragmentProcessor
virtual void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) {}
private:
void internalEmitChild(int, const char*, const char*, EmitArgs&);
- SkTArray<GrGLFragmentProcessor*, true> fChildProcessors;
+ SkTArray<GrGLSLFragmentProcessor*, true> fChildProcessors;
friend class GrFragmentProcessor;
};
diff --git a/src/gpu/glsl/GrGLSLUtil.cpp b/src/gpu/glsl/GrGLSLUtil.cpp
new file mode 100644
index 0000000..5a33324
--- /dev/null
+++ b/src/gpu/glsl/GrGLSLUtil.cpp
@@ -0,0 +1,52 @@
+/*
+* Copyright 2015 Google Inc.
+*
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE file.
+*/
+
+#include "GrGLSLUtil.h"
+#include "SkMatrix.h"
+
+template<> void GrGLSLGetMatrix<3>(float* dest, const SkMatrix& src) {
+ // Col 0
+ dest[0] = SkScalarToFloat(src[SkMatrix::kMScaleX]);
+ dest[1] = SkScalarToFloat(src[SkMatrix::kMSkewY]);
+ dest[2] = SkScalarToFloat(src[SkMatrix::kMPersp0]);
+
+ // Col 1
+ dest[3] = SkScalarToFloat(src[SkMatrix::kMSkewX]);
+ dest[4] = SkScalarToFloat(src[SkMatrix::kMScaleY]);
+ dest[5] = SkScalarToFloat(src[SkMatrix::kMPersp1]);
+
+ // Col 2
+ dest[6] = SkScalarToFloat(src[SkMatrix::kMTransX]);
+ dest[7] = SkScalarToFloat(src[SkMatrix::kMTransY]);
+ dest[8] = SkScalarToFloat(src[SkMatrix::kMPersp2]);
+}
+
+template<> void GrGLSLGetMatrix<4>(float* dest, const SkMatrix& src) {
+ // Col 0
+ dest[0] = SkScalarToFloat(src[SkMatrix::kMScaleX]);
+ dest[1] = SkScalarToFloat(src[SkMatrix::kMSkewY]);
+ dest[2] = 0;
+ dest[3] = SkScalarToFloat(src[SkMatrix::kMPersp0]);
+
+ // Col 1
+ dest[4] = SkScalarToFloat(src[SkMatrix::kMSkewX]);
+ dest[5] = SkScalarToFloat(src[SkMatrix::kMScaleY]);
+ dest[6] = 0;
+ dest[7] = SkScalarToFloat(src[SkMatrix::kMPersp1]);
+
+ // Col 2
+ dest[8] = 0;
+ dest[9] = 0;
+ dest[10] = 1;
+ dest[11] = 0;
+
+ // Col 3
+ dest[12] = SkScalarToFloat(src[SkMatrix::kMTransX]);
+ dest[13] = SkScalarToFloat(src[SkMatrix::kMTransY]);
+ dest[14] = 0;
+ dest[15] = SkScalarToFloat(src[SkMatrix::kMPersp2]);
+}
diff --git a/src/gpu/glsl/GrGLSLUtil.h b/src/gpu/glsl/GrGLSLUtil.h
new file mode 100644
index 0000000..0d2b7e7
--- /dev/null
+++ b/src/gpu/glsl/GrGLSLUtil.h
@@ -0,0 +1,19 @@
+/*
+* Copyright 2015 Google Inc.
+*
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE file.
+*/
+
+#ifndef GrGLSLUtil_DEFINED
+#define GrGLSLUtil_DEFINED
+
+class SkMatrix;
+
+/**
+ * Helper for converting SkMatrix to a column-major float array. We assume that all GLSL backends
+ * use a column major representation for matrices.
+ */
+template<int MatrixSize> void GrGLSLGetMatrix(float* dest, const SkMatrix& src);
+
+#endif