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

Unified Diff: src/gpu/effects/GrDistanceFieldGeoProc.cpp

Issue 1438003003: Move all ShaderBuilder files to GLSL (Closed) Base URL: https://skia.googlesource.com/skia.git@glslProgBuild
Patch Set: nits Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/effects/GrDisableColorXP.cpp ('k') | src/gpu/effects/GrDitherEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDistanceFieldGeoProc.cpp
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index 41e1aea7ef4957cbc4644476b0ceb9d9808e811f..90a08986866662dbbdd5ebbd6b1d0e4fbc17d124 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -14,8 +14,10 @@
#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLTexture.h"
#include "gl/GrGLGeometryProcessor.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLVertexShaderBuilder.h"
// Assuming a radius of a little less than the diagonal of the fragment
#define SK_DistanceFieldAAFactor "0.65"
@@ -34,11 +36,11 @@ public:
const GrDistanceFieldA8TextGeoProc& dfTexEffect =
args.fGP.cast<GrDistanceFieldA8TextGeoProc>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
- GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(dfTexEffect);
@@ -47,7 +49,7 @@ public:
// adjust based on gamma
const char* distanceAdjustUniName = nullptr;
// width, height, 1/(3*width)
- fDistanceAdjustUni = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fDistanceAdjustUni = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"DistanceAdjust", &distanceAdjustUniName);
#endif
@@ -285,11 +287,11 @@ public:
const GrDistanceFieldPathGeoProc& dfTexEffect = args.fGP.cast<GrDistanceFieldPathGeoProc>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
- GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(dfTexEffect);
@@ -316,7 +318,7 @@ public:
args.fTransformsIn, args.fTransformsOut);
const char* textureSizeUniName = nullptr;
- fTextureSizeUni = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fTextureSizeUni = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec2f_GrSLType, kDefault_GrSLPrecision,
"TextureSize", &textureSizeUniName);
@@ -501,7 +503,7 @@ public:
args.fGP.cast<GrDistanceFieldLCDTextGeoProc>();
GrGLSLGPBuilder* pb = args.fPB;
- GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
+ GrGLSLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
// emit attributes
vsBuilder->emitAttributes(dfTexEffect);
@@ -541,10 +543,10 @@ public:
dfTexEffect.inTextureCoords()->fName);
// add frag shader code
- GrGLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = pb->getFragmentShaderBuilder();
SkAssertResult(fsBuilder->enableFeature(
- GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
+ GrGLSLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature));
// create LCD offset adjusted by inverse of transform
// Use highp to work around aliasing issues
@@ -595,7 +597,7 @@ public:
// adjust width based on gamma
const char* distanceAdjustUniName = nullptr;
- fDistanceAdjustUni = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fDistanceAdjustUni = pb->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec3f_GrSLType, kDefault_GrSLPrecision,
"DistanceAdjust", &distanceAdjustUniName);
fsBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName);
« no previous file with comments | « src/gpu/effects/GrDisableColorXP.cpp ('k') | src/gpu/effects/GrDitherEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698