OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "InstanceProcessor.h" | 8 #include "InstanceProcessor.h" |
9 | 9 |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 this->setWillUseSampleLocations(); | 73 this->setWillUseSampleLocations(); |
74 } | 74 } |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 class GLSLInstanceProcessor : public GrGLSLGeometryProcessor { | 78 class GLSLInstanceProcessor : public GrGLSLGeometryProcessor { |
79 public: | 79 public: |
80 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override; | 80 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override; |
81 | 81 |
82 private: | 82 private: |
83 void setData(const GrGLSLProgramDataManager&, const GrPrimitiveProcessor&) o
verride {} | 83 void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcess
or&, |
| 84 FPCoordTransformIter&& transformIter) override { |
| 85 this->setTransformDataHelper(SkMatrix::I(), pdman, &transformIter); |
| 86 } |
84 | 87 |
85 class VertexInputs; | 88 class VertexInputs; |
86 class Backend; | 89 class Backend; |
87 class BackendNonAA; | 90 class BackendNonAA; |
88 class BackendCoverage; | 91 class BackendCoverage; |
89 class BackendMultisample; | 92 class BackendMultisample; |
90 | 93 |
91 typedef GrGLSLGeometryProcessor INHERITED; | 94 typedef GrGLSLGeometryProcessor INHERITED; |
92 }; | 95 }; |
93 | 96 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 } | 384 } |
382 v->codeAppend("}"); | 385 v->codeAppend("}"); |
383 } | 386 } |
384 | 387 |
385 GrSLType positionType = ip.batchInfo().fHasPerspective ? kVec3f_GrSLType : k
Vec2f_GrSLType; | 388 GrSLType positionType = ip.batchInfo().fHasPerspective ? kVec3f_GrSLType : k
Vec2f_GrSLType; |
386 v->codeAppendf("%s deviceCoords = vec3(%s, 1) * shapeMatrix;", | 389 v->codeAppendf("%s deviceCoords = vec3(%s, 1) * shapeMatrix;", |
387 GrGLSLTypeString(positionType), backend->outShapeCoords()); | 390 GrGLSLTypeString(positionType), backend->outShapeCoords()); |
388 gpArgs->fPositionVar.set(positionType, "deviceCoords"); | 391 gpArgs->fPositionVar.set(positionType, "deviceCoords"); |
389 | 392 |
390 this->emitTransforms(v, varyingHandler, uniHandler, gpArgs->fPositionVar, lo
calCoords, | 393 this->emitTransforms(v, varyingHandler, uniHandler, gpArgs->fPositionVar, lo
calCoords, |
391 args.fTransformsIn, args.fTransformsOut); | 394 args.fFPCoordTransformHandler); |
392 } | 395 } |
393 | 396 |
394 ////////////////////////////////////////////////////////////////////////////////
//////////////////// | 397 ////////////////////////////////////////////////////////////////////////////////
//////////////////// |
395 | 398 |
396 void GLSLInstanceProcessor::Backend::init(GrGLSLVaryingHandler* varyingHandler, | 399 void GLSLInstanceProcessor::Backend::init(GrGLSLVaryingHandler* varyingHandler, |
397 GrGLSLVertexBuilder* v) { | 400 GrGLSLVertexBuilder* v) { |
398 if (fModifiedShapeCoords) { | 401 if (fModifiedShapeCoords) { |
399 v->codeAppendf("vec2 %s = %s;", fModifiedShapeCoords, fInputs.attr(Attri
b::kShapeCoords)); | 402 v->codeAppendf("vec2 %s = %s;", fModifiedShapeCoords, fInputs.attr(Attri
b::kShapeCoords)); |
400 } | 403 } |
401 | 404 |
(...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2111 | 2114 |
2112 case kCorneredRect_FirstIndex: return "basic_round_rect"; | 2115 case kCorneredRect_FirstIndex: return "basic_round_rect"; |
2113 case kCorneredFramedRect_FirstIndex: return "coverage_round_rect"; | 2116 case kCorneredFramedRect_FirstIndex: return "coverage_round_rect"; |
2114 case kCorneredRectFanned_FirstIndex: return "mixed_samples_round_rect"; | 2117 case kCorneredRectFanned_FirstIndex: return "mixed_samples_round_rect"; |
2115 | 2118 |
2116 default: return "unknown"; | 2119 default: return "unknown"; |
2117 } | 2120 } |
2118 } | 2121 } |
2119 | 2122 |
2120 } | 2123 } |
OLD | NEW |