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

Side by Side Diff: src/gpu/glsl/GrGLSLGeometryProcessor.h

Issue 2336723002: Remove base class for installed transforms in GrPrimitiveProcessor (Closed)
Patch Set: rm unused type field for glsl geo proc 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/GrPathProcessor.cpp ('k') | src/gpu/glsl/GrGLSLPrimitiveProcessor.h » ('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 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 #ifndef GrGLSLGeometryProcessor_DEFINED 8 #ifndef GrGLSLGeometryProcessor_DEFINED
9 #define GrGLSLGeometryProcessor_DEFINED 9 #define GrGLSLGeometryProcessor_DEFINED
10 10
(...skipping 18 matching lines...) Expand all
29 const SkTArray<const GrCoordTransform*, true>& transfo rms) override { 29 const SkTArray<const GrCoordTransform*, true>& transfo rms) override {
30 this->setTransformDataHelper(SkMatrix::I(), pdman, index, transforms); 30 this->setTransformDataHelper(SkMatrix::I(), pdman, index, transforms);
31 } 31 }
32 32
33 protected: 33 protected:
34 // A helper which subclasses can use if needed and used above in the default setTransformData(). 34 // A helper which subclasses can use if needed and used above in the default setTransformData().
35 void setTransformDataHelper(const SkMatrix& localMatrix, 35 void setTransformDataHelper(const SkMatrix& localMatrix,
36 const GrGLSLProgramDataManager& pdman, 36 const GrGLSLProgramDataManager& pdman,
37 int index, 37 int index,
38 const SkTArray<const GrCoordTransform*, true>& t ransforms) { 38 const SkTArray<const GrCoordTransform*, true>& t ransforms) {
39 SkSTArray<2, UniformTransform, true>& procTransforms = fInstalledTransfo rms[index]; 39 SkTArray<TransformUniform, true>& procTransforms = fInstalledTransforms[ index];
40 int numTransforms = transforms.count(); 40 int numTransforms = transforms.count();
41 for (int t = 0; t < numTransforms; ++t) { 41 for (int t = 0; t < numTransforms; ++t) {
42 SkASSERT(procTransforms[t].fHandle.isValid()); 42 SkASSERT(procTransforms[t].fHandle.isValid());
43 const SkMatrix& transform = GetTransformMatrix(localMatrix, *transfo rms[t]); 43 const SkMatrix& transform = GetTransformMatrix(localMatrix, *transfo rms[t]);
44 if (!procTransforms[t].fCurrentValue.cheapEqualTo(transform)) { 44 if (!procTransforms[t].fCurrentValue.cheapEqualTo(transform)) {
45 pdman.setSkMatrix(procTransforms[t].fHandle.toIndex(), transform ); 45 pdman.setSkMatrix(procTransforms[t].fHandle.toIndex(), transform );
46 procTransforms[t].fCurrentValue = transform; 46 procTransforms[t].fCurrentValue = transform;
47 } 47 }
48 } 48 }
49 } 49 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } else if (!mat.hasPerspective()) { 98 } else if (!mat.hasPerspective()) {
99 return 0x01; 99 return 0x01;
100 } else { 100 } else {
101 return 0x02; 101 return 0x02;
102 } 102 }
103 } 103 }
104 104
105 private: 105 private:
106 virtual void onEmitCode(EmitArgs&, GrGPArgs*) = 0; 106 virtual void onEmitCode(EmitArgs&, GrGPArgs*) = 0;
107 107
108 struct UniformTransform : public Transform { 108 struct TransformUniform {
109 UniformTransform() : Transform() {}
110 UniformHandle fHandle; 109 UniformHandle fHandle;
110 SkMatrix fCurrentValue = SkMatrix::InvalidMatrix();
111 }; 111 };
112 112
113 SkSTArray<8, SkSTArray<2, UniformTransform, true> > fInstalledTransforms; 113 SkSTArray<8, SkSTArray<2, TransformUniform, true> > fInstalledTransforms;
114 114
115 typedef GrGLSLPrimitiveProcessor INHERITED; 115 typedef GrGLSLPrimitiveProcessor INHERITED;
116 }; 116 };
117 117
118 #endif 118 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrPathProcessor.cpp ('k') | src/gpu/glsl/GrGLSLPrimitiveProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698