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

Side by Side Diff: src/gpu/batches/GrMSAAPathRenderer.cpp

Issue 2250563004: Detemplatize GrGLSLGeometryProcessor::setTransformDataHelper() (Closed) Base URL: https://chromium.googlesource.com/skia.git@clean
Patch Set: simplify Created 4 years, 4 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
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 "GrMSAAPathRenderer.h" 8 #include "GrMSAAPathRenderer.h"
9 9
10 #include "GrAuditTrail.h" 10 #include "GrAuditTrail.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 116
117 virtual ~MSAAQuadProcessor() {} 117 virtual ~MSAAQuadProcessor() {}
118 118
119 const char* name() const override { return "MSAAQuadProcessor"; } 119 const char* name() const override { return "MSAAQuadProcessor"; }
120 120
121 const Attribute* inPosition() const { return fInPosition; } 121 const Attribute* inPosition() const { return fInPosition; }
122 const Attribute* inUV() const { return fInUV; } 122 const Attribute* inUV() const { return fInUV; }
123 const Attribute* inColor() const { return fInColor; } 123 const Attribute* inColor() const { return fInColor; }
124 const SkMatrix& viewMatrix() const { return fViewMatrix; } 124 const SkMatrix& viewMatrix() const { return fViewMatrix; }
125 const SkMatrix& localMatrix() const { return SkMatrix::I(); }
126 125
127 class GLSLProcessor : public GrGLSLGeometryProcessor { 126 class GLSLProcessor : public GrGLSLGeometryProcessor {
128 public: 127 public:
129 GLSLProcessor(const GrGeometryProcessor& qpr) {} 128 GLSLProcessor(const GrGeometryProcessor& qpr) {}
130 129
131 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { 130 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override {
132 const MSAAQuadProcessor& qp = args.fGP.cast<MSAAQuadProcessor>(); 131 const MSAAQuadProcessor& qp = args.fGP.cast<MSAAQuadProcessor>();
133 GrGLSLVertexBuilder* vsBuilder = args.fVertBuilder; 132 GrGLSLVertexBuilder* vsBuilder = args.fVertBuilder;
134 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler; 133 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler;
135 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; 134 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 virtual void setData(const GrGLSLProgramDataManager& pdman, 169 virtual void setData(const GrGLSLProgramDataManager& pdman,
171 const GrPrimitiveProcessor& gp) override { 170 const GrPrimitiveProcessor& gp) override {
172 const MSAAQuadProcessor& qp = gp.cast<MSAAQuadProcessor>(); 171 const MSAAQuadProcessor& qp = gp.cast<MSAAQuadProcessor>();
173 if (!qp.viewMatrix().isIdentity()) { 172 if (!qp.viewMatrix().isIdentity()) {
174 float viewMatrix[3 * 3]; 173 float viewMatrix[3 * 3];
175 GrGLSLGetMatrix<3>(viewMatrix, qp.viewMatrix()); 174 GrGLSLGetMatrix<3>(viewMatrix, qp.viewMatrix());
176 pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); 175 pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
177 } 176 }
178 } 177 }
179 178
180 void setTransformData(const GrPrimitiveProcessor& primProc,
181 const GrGLSLProgramDataManager& pdman,
182 int index,
183 const SkTArray<const GrCoordTransform*, true>& tra nsforms) override {
184 this->setTransformDataHelper<MSAAQuadProcessor>(primProc, pdman, ind ex, transforms);
185 }
186
187 private: 179 private:
188 typedef GrGLSLGeometryProcessor INHERITED; 180 typedef GrGLSLGeometryProcessor INHERITED;
189 181
190 UniformHandle fViewMatrixUniform; 182 UniformHandle fViewMatrixUniform;
191 }; 183 };
192 184
193 virtual void getGLSLProcessorKey(const GrGLSLCaps& caps, 185 virtual void getGLSLProcessorKey(const GrGLSLCaps& caps,
194 GrProcessorKeyBuilder* b) const override { 186 GrProcessorKeyBuilder* b) const override {
195 GLSLProcessor::GenKey(*this, caps, b); 187 GLSLProcessor::GenKey(*this, caps, b);
196 } 188 }
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 706
715 GrPaint paint; 707 GrPaint paint;
716 paint.setXPFactory(GrDisableColorXPFactory::Make()); 708 paint.setXPFactory(GrDisableColorXPFactory::Make());
717 paint.setAntiAlias(args.fIsAA); 709 paint.setAntiAlias(args.fIsAA);
718 710
719 this->internalDrawPath(args.fDrawContext, paint, GrUserStencilSettings::kUnu sed, *args.fClip, 711 this->internalDrawPath(args.fDrawContext, paint, GrUserStencilSettings::kUnu sed, *args.fClip,
720 *args.fViewMatrix, *args.fShape, true); 712 *args.fViewMatrix, *args.fShape, true);
721 } 713 }
722 714
723 //////////////////////////////////////////////////////////////////////////////// /////////////////// 715 //////////////////////////////////////////////////////////////////////////////// ///////////////////
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698