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

Side by Side Diff: src/gpu/gl/GrGLGeometryProcessor.h

Issue 1151693005: Remove uniform view matrix from GrGLPrimitiveProcessor base class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more Created 5 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
« no previous file with comments | « src/gpu/effects/GrDistanceFieldGeoProc.cpp ('k') | src/gpu/gl/GrGLGeometryProcessor.cpp » ('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 GrGLGeometryProcessor_DEFINED 8 #ifndef GrGLGeometryProcessor_DEFINED
9 #define GrGLGeometryProcessor_DEFINED 9 #define GrGLGeometryProcessor_DEFINED
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 const TransformsIn&, 57 const TransformsIn&,
58 TransformsOut*); 58 TransformsOut*);
59 59
60 struct GrGPArgs { 60 struct GrGPArgs {
61 // The variable used by a GP to store its position. It can be 61 // The variable used by a GP to store its position. It can be
62 // either a vec2 or a vec3 depending on the presence of perspective. 62 // either a vec2 or a vec3 depending on the presence of perspective.
63 GrShaderVar fPositionVar; 63 GrShaderVar fPositionVar;
64 }; 64 };
65 65
66 // Create the correct type of position variable given the CTM 66 // Create the correct type of position variable given the CTM
67 void setupPosition(GrGLGPBuilder* pb, 67 void setupPosition(GrGLGPBuilder*, GrGPArgs*, const char* posName);
68 GrGPArgs* gpArgs, 68 void setupPosition(GrGLGPBuilder*, GrGPArgs*, const char* posName, const SkM atrix& mat,
69 const char* posName, 69 UniformHandle* viewMatrixUniform);
70 const SkMatrix& mat = SkMatrix::I());
71 70
72 static uint32_t ComputePosKey(const SkMatrix& mat) { 71 static uint32_t ComputePosKey(const SkMatrix& mat) {
73 if (mat.isIdentity()) { 72 if (mat.isIdentity()) {
74 return 0x0; 73 return 0x0;
75 } else if (!mat.hasPerspective()) { 74 } else if (!mat.hasPerspective()) {
76 return 0x01; 75 return 0x01;
77 } else { 76 } else {
78 return 0x02; 77 return 0x02;
79 } 78 }
80 } 79 }
(...skipping 14 matching lines...) Expand all
95 } 94 }
96 } 95 }
97 } 96 }
98 97
99 virtual void onEmitCode(EmitArgs&, GrGPArgs*) = 0; 98 virtual void onEmitCode(EmitArgs&, GrGPArgs*) = 0;
100 99
101 typedef GrGLPrimitiveProcessor INHERITED; 100 typedef GrGLPrimitiveProcessor INHERITED;
102 }; 101 };
103 102
104 #endif 103 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrDistanceFieldGeoProc.cpp ('k') | src/gpu/gl/GrGLGeometryProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698