| OLD | NEW |
| 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 "GrBatch.h" | 10 #include "GrBatch.h" |
| (...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 const DashingLineEffect& de = args.fGP.cast<DashingLineEffect>(); | 1072 const DashingLineEffect& de = args.fGP.cast<DashingLineEffect>(); |
| 1073 GrGLGPBuilder* pb = args.fPB; | 1073 GrGLGPBuilder* pb = args.fPB; |
| 1074 | 1074 |
| 1075 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); | 1075 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); |
| 1076 | 1076 |
| 1077 // emit attributes | 1077 // emit attributes |
| 1078 vsBuilder->emitAttributes(de); | 1078 vsBuilder->emitAttributes(de); |
| 1079 | 1079 |
| 1080 // XY refers to dashPos, Z is the dash interval length | 1080 // XY refers to dashPos, Z is the dash interval length |
| 1081 GrGLVertToFrag inDashParams(kVec3f_GrSLType); | 1081 GrGLVertToFrag inDashParams(kVec3f_GrSLType); |
| 1082 args.fPB->addVarying("DashParams", &inDashParams); | 1082 args.fPB->addVarying("DashParams", &inDashParams, GrSLPrecision::kHigh_GrSLP
recision); |
| 1083 vsBuilder->codeAppendf("%s = %s;", inDashParams.vsOut(), de.inDashParams()->
fName); | 1083 vsBuilder->codeAppendf("%s = %s;", inDashParams.vsOut(), de.inDashParams()->
fName); |
| 1084 | 1084 |
| 1085 // The rect uniform's xyzw refer to (left + 0.5, top + 0.5, right - 0.5, bot
tom - 0.5), | 1085 // The rect uniform's xyzw refer to (left + 0.5, top + 0.5, right - 0.5, bot
tom - 0.5), |
| 1086 // respectively. | 1086 // respectively. |
| 1087 GrGLVertToFrag inRectParams(kVec4f_GrSLType); | 1087 GrGLVertToFrag inRectParams(kVec4f_GrSLType); |
| 1088 args.fPB->addVarying("RectParams", &inRectParams); | 1088 args.fPB->addVarying("RectParams", &inRectParams, GrSLPrecision::kHigh_GrSLP
recision); |
| 1089 vsBuilder->codeAppendf("%s = %s;", inRectParams.vsOut(), de.inRectParams()->
fName); | 1089 vsBuilder->codeAppendf("%s = %s;", inRectParams.vsOut(), de.inRectParams()->
fName); |
| 1090 | 1090 |
| 1091 // Setup pass through color | 1091 // Setup pass through color |
| 1092 if (!de.colorIgnored()) { | 1092 if (!de.colorIgnored()) { |
| 1093 this->setupUniformColor(pb, args.fOutputColor, &fColorUniform); | 1093 this->setupUniformColor(pb, args.fOutputColor, &fColorUniform); |
| 1094 } | 1094 } |
| 1095 | 1095 |
| 1096 | 1096 |
| 1097 // Setup position | 1097 // Setup position |
| 1098 this->setupPosition(pb, gpArgs, de.inPosition()->fName); | 1098 this->setupPosition(pb, gpArgs, de.inPosition()->fName); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 info.fIntervals = intervals; | 1297 info.fIntervals = intervals; |
| 1298 info.fCount = 2; | 1298 info.fCount = 2; |
| 1299 info.fPhase = phase; | 1299 info.fPhase = phase; |
| 1300 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info); | 1300 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info); |
| 1301 SkASSERT(success); | 1301 SkASSERT(success); |
| 1302 | 1302 |
| 1303 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT); | 1303 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT); |
| 1304 } | 1304 } |
| 1305 | 1305 |
| 1306 #endif | 1306 #endif |
| OLD | NEW |