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

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

Issue 1961093002: Break apart shared use of varying and uniform transforms (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 #ifndef GrGLSLGeometryProcessor_DEFINED 8 #ifndef GrGLSLGeometryProcessor_DEFINED
9 #define GrGLSLGeometryProcessor_DEFINED 9 #define GrGLSLGeometryProcessor_DEFINED
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } else { 93 } else {
94 return 0x02; 94 return 0x02;
95 } 95 }
96 } 96 }
97 97
98 private: 98 private:
99 void setTransformDataMatrix(const SkMatrix& localMatrix, 99 void setTransformDataMatrix(const SkMatrix& localMatrix,
100 const GrGLSLProgramDataManager& pdman, 100 const GrGLSLProgramDataManager& pdman,
101 int index, 101 int index,
102 const SkTArray<const GrCoordTransform*, true>& t ransforms) { 102 const SkTArray<const GrCoordTransform*, true>& t ransforms) {
103 SkSTArray<2, Transform, true>& procTransforms = fInstalledTransforms[ind ex]; 103 SkSTArray<2, UniformTransform, true>& procTransforms = fInstalledTransfo rms[index];
104 int numTransforms = transforms.count(); 104 int numTransforms = transforms.count();
105 for (int t = 0; t < numTransforms; ++t) { 105 for (int t = 0; t < numTransforms; ++t) {
106 SkASSERT(procTransforms[t].fHandle.isValid()); 106 SkASSERT(procTransforms[t].fHandle.isValid());
107 const SkMatrix& transform = GetTransformMatrix(localMatrix, *transfo rms[t]); 107 const SkMatrix& transform = GetTransformMatrix(localMatrix, *transfo rms[t]);
108 if (!procTransforms[t].fCurrentValue.cheapEqualTo(transform)) { 108 if (!procTransforms[t].fCurrentValue.cheapEqualTo(transform)) {
109 pdman.setSkMatrix(procTransforms[t].fHandle.toIndex(), transform ); 109 pdman.setSkMatrix(procTransforms[t].fHandle.toIndex(), transform );
110 procTransforms[t].fCurrentValue = transform; 110 procTransforms[t].fCurrentValue = transform;
111 } 111 }
112 } 112 }
113 } 113 }
114 114
115 virtual void onEmitCode(EmitArgs&, GrGPArgs*) = 0; 115 virtual void onEmitCode(EmitArgs&, GrGPArgs*) = 0;
116 116
robertphillips 2016/05/09 16:51:28 init fHandle here?
117 struct UniformTransform : public Transform {
118 UniformTransform() : Transform() {}
119 UniformHandle fHandle;
120 };
121
122 SkSTArray<8, SkSTArray<2, UniformTransform, true> > fInstalledTransforms;
123
117 typedef GrGLSLPrimitiveProcessor INHERITED; 124 typedef GrGLSLPrimitiveProcessor INHERITED;
118 }; 125 };
119 126
120 #endif 127 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698