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/effects/GrBezierEffect.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 2013 Google Inc. 2 * Copyright 2013 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 "GrBezierEffect.h" 8 #include "GrBezierEffect.h"
9 9
10 #include "glsl/GrGLSLFragmentShaderBuilder.h" 10 #include "glsl/GrGLSLFragmentShaderBuilder.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 if (ce.coverageScale() != 0xff && ce.coverageScale() != fCoverageScale) { 46 if (ce.coverageScale() != 0xff && ce.coverageScale() != fCoverageScale) {
47 pdman.set1f(fCoverageScaleUniform, GrNormalizeByteToFloat(ce.coverag eScale())); 47 pdman.set1f(fCoverageScaleUniform, GrNormalizeByteToFloat(ce.coverag eScale()));
48 fCoverageScale = ce.coverageScale(); 48 fCoverageScale = ce.coverageScale();
49 } 49 }
50 } 50 }
51 51
52 void setTransformData(const GrPrimitiveProcessor& primProc, 52 void setTransformData(const GrPrimitiveProcessor& primProc,
53 const GrGLSLProgramDataManager& pdman, 53 const GrGLSLProgramDataManager& pdman,
54 int index, 54 int index,
55 const SkTArray<const GrCoordTransform*, true>& transfo rms) override { 55 const SkTArray<const GrCoordTransform*, true>& transfo rms) override {
56 this->setTransformDataHelper<GrConicEffect>(primProc, pdman, index, tran sforms); 56 this->setTransformDataHelper(primProc.cast<GrConicEffect>().localMatrix( ), pdman, index,
57 transforms);
57 } 58 }
58 59
59 private: 60 private:
60 SkMatrix fViewMatrix; 61 SkMatrix fViewMatrix;
61 GrColor fColor; 62 GrColor fColor;
62 uint8_t fCoverageScale; 63 uint8_t fCoverageScale;
63 GrPrimitiveEdgeType fEdgeType; 64 GrPrimitiveEdgeType fEdgeType;
64 UniformHandle fColorUniform; 65 UniformHandle fColorUniform;
65 UniformHandle fCoverageScaleUniform; 66 UniformHandle fCoverageScaleUniform;
66 UniformHandle fViewMatrixUniform; 67 UniformHandle fViewMatrixUniform;
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 if (qe.coverageScale() != 0xff && qe.coverageScale() != fCoverageScale) { 321 if (qe.coverageScale() != 0xff && qe.coverageScale() != fCoverageScale) {
321 pdman.set1f(fCoverageScaleUniform, GrNormalizeByteToFloat(qe.coverag eScale())); 322 pdman.set1f(fCoverageScaleUniform, GrNormalizeByteToFloat(qe.coverag eScale()));
322 fCoverageScale = qe.coverageScale(); 323 fCoverageScale = qe.coverageScale();
323 } 324 }
324 } 325 }
325 326
326 void setTransformData(const GrPrimitiveProcessor& primProc, 327 void setTransformData(const GrPrimitiveProcessor& primProc,
327 const GrGLSLProgramDataManager& pdman, 328 const GrGLSLProgramDataManager& pdman,
328 int index, 329 int index,
329 const SkTArray<const GrCoordTransform*, true>& transfo rms) override { 330 const SkTArray<const GrCoordTransform*, true>& transfo rms) override {
330 this->setTransformDataHelper<GrQuadEffect>(primProc, pdman, index, trans forms); 331 this->setTransformDataHelper(primProc.cast<GrQuadEffect>().localMatrix() , pdman, index,
332 transforms);
331 } 333 }
332 334
333 private: 335 private:
334 SkMatrix fViewMatrix; 336 SkMatrix fViewMatrix;
335 GrColor fColor; 337 GrColor fColor;
336 uint8_t fCoverageScale; 338 uint8_t fCoverageScale;
337 GrPrimitiveEdgeType fEdgeType; 339 GrPrimitiveEdgeType fEdgeType;
338 UniformHandle fColorUniform; 340 UniformHandle fColorUniform;
339 UniformHandle fCoverageScaleUniform; 341 UniformHandle fCoverageScaleUniform;
340 UniformHandle fViewMatrixUniform; 342 UniformHandle fViewMatrixUniform;
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 sk_sp<GrGeometryProcessor> gp; 722 sk_sp<GrGeometryProcessor> gp;
721 do { 723 do {
722 GrPrimitiveEdgeType edgeType = 724 GrPrimitiveEdgeType edgeType =
723 static_cast<GrPrimitiveEdgeType>( 725 static_cast<GrPrimitiveEdgeType>(
724 d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt)); 726 d->fRandom->nextULessThan(kGrProcessorEdgeTypeCnt));
725 gp = GrCubicEffect::Make(GrRandomColor(d->fRandom), 727 gp = GrCubicEffect::Make(GrRandomColor(d->fRandom),
726 GrTest::TestMatrix(d->fRandom), edgeType, *d->f Caps); 728 GrTest::TestMatrix(d->fRandom), edgeType, *d->f Caps);
727 } while (nullptr == gp); 729 } while (nullptr == gp);
728 return gp; 730 return gp;
729 } 731 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698