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

Side by Side Diff: src/gpu/batches/GrAnalyticRectBatch.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 "GrAnalyticRectBatch.h" 8 #include "GrAnalyticRectBatch.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 fInWidthHeight = &this->addVertexAttrib(Attribute("inWidthHeight", 62 fInWidthHeight = &this->addVertexAttrib(Attribute("inWidthHeight",
63 kVec2f_GrVertexAttribT ype)); 63 kVec2f_GrVertexAttribT ype));
64 } 64 }
65 65
66 bool implementsDistanceVector() const override { return true; }; 66 bool implementsDistanceVector() const override { return true; };
67 67
68 const Attribute* inPosition() const { return fInPosition; } 68 const Attribute* inPosition() const { return fInPosition; }
69 const Attribute* inColor() const { return fInColor; } 69 const Attribute* inColor() const { return fInColor; }
70 const Attribute* inRectEdge() const { return fInRectEdge; } 70 const Attribute* inRectEdge() const { return fInRectEdge; }
71 const Attribute* inWidthHeight() const { return fInWidthHeight; } 71 const Attribute* inWidthHeight() const { return fInWidthHeight; }
72 72
robertphillips 2016/08/17 16:27:25 ??
bsalomon 2016/08/17 16:33:00 same
73 const SkMatrix& localMatrix() const { return fLocalMatrix; } 73 const SkMatrix& localMatrix() const { return fLocalMatrix; }
74 74
75 virtual ~RectGeometryProcessor() {} 75 virtual ~RectGeometryProcessor() {}
76 76
77 const char* name() const override { return "RectEdge"; } 77 const char* name() const override { return "RectEdge"; }
78 78
79 class GLSLProcessor : public GrGLSLGeometryProcessor { 79 class GLSLProcessor : public GrGLSLGeometryProcessor {
80 public: 80 public:
81 GLSLProcessor() {} 81 GLSLProcessor() {}
82 82
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 b->add32(0x0); 195 b->add32(0x0);
196 } 196 }
197 197
198 void setData(const GrGLSLProgramDataManager& pdman, 198 void setData(const GrGLSLProgramDataManager& pdman,
199 const GrPrimitiveProcessor& gp) override {} 199 const GrPrimitiveProcessor& gp) override {}
200 200
201 void setTransformData(const GrPrimitiveProcessor& primProc, 201 void setTransformData(const GrPrimitiveProcessor& primProc,
202 const GrGLSLProgramDataManager& pdman, 202 const GrGLSLProgramDataManager& pdman,
203 int index, 203 int index,
204 const SkTArray<const GrCoordTransform*, true>& tra nsforms) override { 204 const SkTArray<const GrCoordTransform*, true>& tra nsforms) override {
205 this->setTransformDataHelper<RectGeometryProcessor>(primProc, pdman, index, transforms); 205 this->setTransformDataHelper(primProc.cast<RectGeometryProcessor>(). fLocalMatrix, pdman,
206 index, transforms);
206 } 207 }
207 208
208 private: 209 private:
209 typedef GrGLSLGeometryProcessor INHERITED; 210 typedef GrGLSLGeometryProcessor INHERITED;
210 }; 211 };
211 212
212 void getGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c onst override { 213 void getGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c onst override {
213 GLSLProcessor::GenKey(*this, caps, b); 214 GLSLProcessor::GenKey(*this, caps, b);
214 } 215 }
215 216
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 DRAW_BATCH_TEST_DEFINE(AnalyticRectBatch) { 406 DRAW_BATCH_TEST_DEFINE(AnalyticRectBatch) {
406 SkMatrix viewMatrix = GrTest::TestMatrix(random); 407 SkMatrix viewMatrix = GrTest::TestMatrix(random);
407 GrColor color = GrRandomColor(random); 408 GrColor color = GrRandomColor(random);
408 SkRect rect = GrTest::TestSquare(random); 409 SkRect rect = GrTest::TestSquare(random);
409 SkRect croppedRect = GrTest::TestSquare(random); 410 SkRect croppedRect = GrTest::TestSquare(random);
410 SkRect bounds = GrTest::TestSquare(random); 411 SkRect bounds = GrTest::TestSquare(random);
411 return new AnalyticRectBatch(color, viewMatrix, rect, croppedRect, bounds); 412 return new AnalyticRectBatch(color, viewMatrix, rect, croppedRect, bounds);
412 } 413 }
413 414
414 #endif 415 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698