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

Side by Side Diff: src/gpu/effects/GrDashingEffect.cpp

Issue 1709153002: Add more specialized fragment builders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make MSVC happy Created 4 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrDashingEffect.h" 8 #include "GrDashingEffect.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 // XY are dashPos, Z is dashInterval 872 // XY are dashPos, Z is dashInterval
873 GrGLSLVertToFrag dashParams(kVec3f_GrSLType); 873 GrGLSLVertToFrag dashParams(kVec3f_GrSLType);
874 varyingHandler->addVarying("DashParam", &dashParams); 874 varyingHandler->addVarying("DashParam", &dashParams);
875 vertBuilder->codeAppendf("%s = %s;", dashParams.vsOut(), dce.inDashParams()- >fName); 875 vertBuilder->codeAppendf("%s = %s;", dashParams.vsOut(), dce.inDashParams()- >fName);
876 876
877 // x refers to circle radius - 0.5, y refers to cicle's center x coord 877 // x refers to circle radius - 0.5, y refers to cicle's center x coord
878 GrGLSLVertToFrag circleParams(kVec2f_GrSLType); 878 GrGLSLVertToFrag circleParams(kVec2f_GrSLType);
879 varyingHandler->addVarying("CircleParams", &circleParams); 879 varyingHandler->addVarying("CircleParams", &circleParams);
880 vertBuilder->codeAppendf("%s = %s;", circleParams.vsOut(), dce.inCircleParam s()->fName); 880 vertBuilder->codeAppendf("%s = %s;", circleParams.vsOut(), dce.inCircleParam s()->fName);
881 881
882 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 882 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder;
883 // Setup pass through color 883 // Setup pass through color
884 if (!dce.colorIgnored()) { 884 if (!dce.colorIgnored()) {
885 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform); 885 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform);
886 } 886 }
887 887
888 // Setup position 888 // Setup position
889 this->setupPosition(vertBuilder, gpArgs, dce.inPosition()->fName); 889 this->setupPosition(vertBuilder, gpArgs, dce.inPosition()->fName);
890 890
891 // emit transforms 891 // emit transforms
892 this->emitTransforms(vertBuilder, 892 this->emitTransforms(vertBuilder,
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 GrGLSLVertToFrag inDashParams(kVec3f_GrSLType); 1086 GrGLSLVertToFrag inDashParams(kVec3f_GrSLType);
1087 varyingHandler->addVarying("DashParams", &inDashParams, GrSLPrecision::kHigh _GrSLPrecision); 1087 varyingHandler->addVarying("DashParams", &inDashParams, GrSLPrecision::kHigh _GrSLPrecision);
1088 vertBuilder->codeAppendf("%s = %s;", inDashParams.vsOut(), de.inDashParams() ->fName); 1088 vertBuilder->codeAppendf("%s = %s;", inDashParams.vsOut(), de.inDashParams() ->fName);
1089 1089
1090 // The rect uniform's xyzw refer to (left + 0.5, top + 0.5, right - 0.5, bot tom - 0.5), 1090 // The rect uniform's xyzw refer to (left + 0.5, top + 0.5, right - 0.5, bot tom - 0.5),
1091 // respectively. 1091 // respectively.
1092 GrGLSLVertToFrag inRectParams(kVec4f_GrSLType); 1092 GrGLSLVertToFrag inRectParams(kVec4f_GrSLType);
1093 varyingHandler->addVarying("RectParams", &inRectParams, GrSLPrecision::kHigh _GrSLPrecision); 1093 varyingHandler->addVarying("RectParams", &inRectParams, GrSLPrecision::kHigh _GrSLPrecision);
1094 vertBuilder->codeAppendf("%s = %s;", inRectParams.vsOut(), de.inRectParams() ->fName); 1094 vertBuilder->codeAppendf("%s = %s;", inRectParams.vsOut(), de.inRectParams() ->fName);
1095 1095
1096 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 1096 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder;
1097 // Setup pass through color 1097 // Setup pass through color
1098 if (!de.colorIgnored()) { 1098 if (!de.colorIgnored()) {
1099 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform); 1099 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform);
1100 } 1100 }
1101 1101
1102 // Setup position 1102 // Setup position
1103 this->setupPosition(vertBuilder, gpArgs, de.inPosition()->fName); 1103 this->setupPosition(vertBuilder, gpArgs, de.inPosition()->fName);
1104 1104
1105 // emit transforms 1105 // emit transforms
1106 this->emitTransforms(vertBuilder, 1106 this->emitTransforms(vertBuilder,
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 info.fIntervals = intervals; 1306 info.fIntervals = intervals;
1307 info.fCount = 2; 1307 info.fCount = 2;
1308 info.fPhase = phase; 1308 info.fPhase = phase;
1309 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info); 1309 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info);
1310 SkASSERT(success); 1310 SkASSERT(success);
1311 1311
1312 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT); 1312 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT);
1313 } 1313 }
1314 1314
1315 #endif 1315 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698