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

Side by Side Diff: src/gpu/instanced/InstanceProcessor.cpp

Issue 2339203002: Stop flattening GrCoordTransforms in parent GrFragmentProcessors. (Closed)
Patch Set: Fix issue of taking ref to a temporary Created 4 years, 3 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/glsl/GrGLSLProgramBuilder.cpp ('k') | src/gpu/vk/GrVkPipelineState.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 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
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.cpp ('k') | src/gpu/vk/GrVkPipelineState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698