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

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

Issue 1462123003: Create GrGLSLVaryingHandler class for program building (Closed) Base URL: https://skia.googlesource.com/skia.git@putCapsOnArgs
Patch Set: fix release builder 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/GrBezierEffect.cpp ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrBitmapTextGeoProc.cpp
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index 28c6f0ffc482a5b3e84e9331bd059c699b528d87..594646256e58ff30db01d6e3e14fd4000965f161 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -12,6 +12,7 @@
#include "glsl/GrGLSLGeometryProcessor.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLVarying.h"
#include "glsl/GrGLSLVertexShaderBuilder.h"
class GrGLBitmapTextGeoProc : public GrGLSLGeometryProcessor {
@@ -23,9 +24,10 @@ public:
GrGLSLGPBuilder* pb = args.fPB;
GrGLSLVertexBuilder* vertBuilder = args.fVertBuilder;
+ GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler;
// emit attributes
- vertBuilder->emitAttributes(cte);
+ varyingHandler->emitAttributes(cte);
// compute numbers to be hardcoded to convert texture coordinates from int to float
SkASSERT(cte.numTextures() == 1);
@@ -35,7 +37,7 @@ public:
SkScalar recipHeight = 1.0f / atlas->height();
GrGLSLVertToFrag v(kVec2f_GrSLType);
- pb->addVarying("TextureCoords", &v);
+ varyingHandler->addVarying("TextureCoords", &v);
vertBuilder->codeAppendf("%s = vec2(%.*f, %.*f) * %s;", v.vsOut(),
GR_SIGNIFICANT_POW2_DECIMAL_DIG, recipWidth,
GR_SIGNIFICANT_POW2_DECIMAL_DIG, recipHeight,
@@ -45,7 +47,7 @@ public:
// Setup pass through color
if (!cte.colorIgnored()) {
if (cte.hasVertexColor()) {
- pb->addPassThroughAttribute(cte.inColor(), args.fOutputColor);
+ varyingHandler->addPassThroughAttribute(cte.inColor(), args.fOutputColor);
} else {
this->setupUniformColor(pb, fragBuilder, args.fOutputColor, &fColorUniform);
}
@@ -57,6 +59,7 @@ public:
// emit transforms
this->emitTransforms(args.fPB,
vertBuilder,
+ varyingHandler,
gpArgs->fPositionVar,
cte.inPosition()->fName,
cte.localMatrix(),
« no previous file with comments | « src/gpu/effects/GrBezierEffect.cpp ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698