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

Side by Side Diff: src/gpu/effects/GrDashingEffect.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 2014 Google Inc. 2 * Copyright 2014 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 "GrDashingEffect.h" 8 #include "GrDashingEffect.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 static inline void GenKey(const GrGeometryProcessor&, 816 static inline void GenKey(const GrGeometryProcessor&,
817 const GrGLSLCaps&, 817 const GrGLSLCaps&,
818 GrProcessorKeyBuilder*); 818 GrProcessorKeyBuilder*);
819 819
820 void setData(const GrGLSLProgramDataManager&, const GrPrimitiveProcessor&) o verride; 820 void setData(const GrGLSLProgramDataManager&, const GrPrimitiveProcessor&) o verride;
821 821
822 void setTransformData(const GrPrimitiveProcessor& primProc, 822 void setTransformData(const GrPrimitiveProcessor& primProc,
823 const GrGLSLProgramDataManager& pdman, 823 const GrGLSLProgramDataManager& pdman,
824 int index, 824 int index,
825 const SkTArray<const GrCoordTransform*, true>& transfo rms) override { 825 const SkTArray<const GrCoordTransform*, true>& transfo rms) override {
826 this->setTransformDataHelper<DashingCircleEffect>(primProc, pdman, index , transforms); 826 this->setTransformDataHelper(primProc.cast<DashingCircleEffect>().localM atrix(), pdman,
827 index, transforms);
827 } 828 }
828 829
829 private: 830 private:
830 UniformHandle fParamUniform; 831 UniformHandle fParamUniform;
831 UniformHandle fColorUniform; 832 UniformHandle fColorUniform;
832 GrColor fColor; 833 GrColor fColor;
833 SkScalar fPrevRadius; 834 SkScalar fPrevRadius;
834 SkScalar fPrevCenterX; 835 SkScalar fPrevCenterX;
835 SkScalar fPrevIntervalLength; 836 SkScalar fPrevIntervalLength;
836 typedef GrGLSLGeometryProcessor INHERITED; 837 typedef GrGLSLGeometryProcessor INHERITED;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 static inline void GenKey(const GrGeometryProcessor&, 1037 static inline void GenKey(const GrGeometryProcessor&,
1037 const GrGLSLCaps&, 1038 const GrGLSLCaps&,
1038 GrProcessorKeyBuilder*); 1039 GrProcessorKeyBuilder*);
1039 1040
1040 void setData(const GrGLSLProgramDataManager&, const GrPrimitiveProcessor&) o verride; 1041 void setData(const GrGLSLProgramDataManager&, const GrPrimitiveProcessor&) o verride;
1041 1042
1042 void setTransformData(const GrPrimitiveProcessor& primProc, 1043 void setTransformData(const GrPrimitiveProcessor& primProc,
1043 const GrGLSLProgramDataManager& pdman, 1044 const GrGLSLProgramDataManager& pdman,
1044 int index, 1045 int index,
1045 const SkTArray<const GrCoordTransform*, true>& transfo rms) override { 1046 const SkTArray<const GrCoordTransform*, true>& transfo rms) override {
1046 this->setTransformDataHelper<DashingLineEffect>(primProc, pdman, index, transforms); 1047 this->setTransformDataHelper(primProc.cast<DashingLineEffect>().localMat rix(), pdman, index,
1048 transforms);
1047 } 1049 }
1048 1050
1049 private: 1051 private:
1050 GrColor fColor; 1052 GrColor fColor;
1051 UniformHandle fColorUniform; 1053 UniformHandle fColorUniform;
1052 typedef GrGLSLGeometryProcessor INHERITED; 1054 typedef GrGLSLGeometryProcessor INHERITED;
1053 }; 1055 };
1054 1056
1055 GLDashingLineEffect::GLDashingLineEffect() { 1057 GLDashingLineEffect::GLDashingLineEffect() {
1056 fColor = GrColor_ILLEGAL; 1058 fColor = GrColor_ILLEGAL;
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 p.setStrokeWidth(SkIntToScalar(1)); 1286 p.setStrokeWidth(SkIntToScalar(1));
1285 p.setStrokeCap(cap); 1287 p.setStrokeCap(cap);
1286 p.setPathEffect(GrTest::TestDashPathEffect::Make(intervals, 2, phase)); 1288 p.setPathEffect(GrTest::TestDashPathEffect::Make(intervals, 2, phase));
1287 1289
1288 GrStyle style(p); 1290 GrStyle style(p);
1289 1291
1290 return GrDashingEffect::CreateDashLineBatch(color, viewMatrix, pts, aaMode, style); 1292 return GrDashingEffect::CreateDashLineBatch(color, viewMatrix, pts, aaMode, style);
1291 } 1293 }
1292 1294
1293 #endif 1295 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698