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

Unified Diff: src/gpu/effects/GrDashingEffect.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/GrBitmapTextGeoProc.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDashingEffect.cpp
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index 94cfd80b0c3b259c88fe468bb709043e771f6440..c1e2011e08cab1bf5a097cbfae76a39ed04c857e 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -25,6 +25,7 @@
#include "glsl/GrGLSLGeometryProcessor.h"
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLVarying.h"
#include "glsl/GrGLSLVertexShaderBuilder.h"
///////////////////////////////////////////////////////////////////////////////
@@ -853,18 +854,19 @@ void GLDashingCircleEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
const DashingCircleEffect& dce = args.fGP.cast<DashingCircleEffect>();
GrGLSLGPBuilder* pb = args.fPB;
GrGLSLVertexBuilder* vertBuilder = args.fVertBuilder;
+ GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler;
// emit attributes
- vertBuilder->emitAttributes(dce);
+ varyingHandler->emitAttributes(dce);
// XY are dashPos, Z is dashInterval
GrGLSLVertToFrag dashParams(kVec3f_GrSLType);
- args.fPB->addVarying("DashParam", &dashParams);
+ varyingHandler->addVarying("DashParam", &dashParams);
vertBuilder->codeAppendf("%s = %s;", dashParams.vsOut(), dce.inDashParams()->fName);
// x refers to circle radius - 0.5, y refers to cicle's center x coord
GrGLSLVertToFrag circleParams(kVec2f_GrSLType);
- args.fPB->addVarying("CircleParams", &circleParams);
+ varyingHandler->addVarying("CircleParams", &circleParams);
vertBuilder->codeAppendf("%s = %s;", circleParams.vsOut(), dce.inCircleParams()->fName);
GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
@@ -879,6 +881,7 @@ void GLDashingCircleEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
// emit transforms
this->emitTransforms(args.fPB,
vertBuilder,
+ varyingHandler,
gpArgs->fPositionVar,
dce.inPosition()->fName,
dce.localMatrix(),
@@ -1064,19 +1067,20 @@ void GLDashingLineEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
GrGLSLGPBuilder* pb = args.fPB;
GrGLSLVertexBuilder* vertBuilder = args.fVertBuilder;
+ GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler;
// emit attributes
- vertBuilder->emitAttributes(de);
+ varyingHandler->emitAttributes(de);
// XY refers to dashPos, Z is the dash interval length
GrGLSLVertToFrag inDashParams(kVec3f_GrSLType);
- args.fPB->addVarying("DashParams", &inDashParams, GrSLPrecision::kHigh_GrSLPrecision);
+ varyingHandler->addVarying("DashParams", &inDashParams, GrSLPrecision::kHigh_GrSLPrecision);
vertBuilder->codeAppendf("%s = %s;", inDashParams.vsOut(), de.inDashParams()->fName);
// The rect uniform's xyzw refer to (left + 0.5, top + 0.5, right - 0.5, bottom - 0.5),
// respectively.
GrGLSLVertToFrag inRectParams(kVec4f_GrSLType);
- args.fPB->addVarying("RectParams", &inRectParams, GrSLPrecision::kHigh_GrSLPrecision);
+ varyingHandler->addVarying("RectParams", &inRectParams, GrSLPrecision::kHigh_GrSLPrecision);
vertBuilder->codeAppendf("%s = %s;", inRectParams.vsOut(), de.inRectParams()->fName);
GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
@@ -1091,6 +1095,7 @@ void GLDashingLineEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
// emit transforms
this->emitTransforms(args.fPB,
vertBuilder,
+ varyingHandler,
gpArgs->fPositionVar,
de.inPosition()->fName,
de.localMatrix(),
« no previous file with comments | « src/gpu/effects/GrBitmapTextGeoProc.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698