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

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

Issue 827973002: ViewMatrix uniform upload moved to GeometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@vm-on-gp
Patch Set: feedback inc Created 5 years, 11 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/GrDistanceFieldTextureEffect.cpp ('k') | src/gpu/gl/GrGLPathRendering.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 GrGLGeometryProcessor_DEFINED 8 #ifndef GrGLGeometryProcessor_DEFINED
9 #define GrGLGeometryProcessor_DEFINED 9 #define GrGLGeometryProcessor_DEFINED
10 10
11 #include "GrGLProcessor.h" 11 #include "GrGLProcessor.h"
12 12
13 class GrBatchTracker; 13 class GrBatchTracker;
14 class GrGLGPBuilder; 14 class GrGLGPBuilder;
15 15
16 /** 16 /**
17 * If a GL effect needs a GrGLFullShaderBuilder* object to emit vertex code, the n it must inherit 17 * If a GL effect needs a GrGLFullShaderBuilder* object to emit vertex code, the n it must inherit
18 * from this class. Since paths don't have vertices, this class is only meant to be used internally 18 * from this class. Since paths don't have vertices, this class is only meant to be used internally
19 * by skia, for special cases. 19 * by skia, for special cases.
20 */ 20 */
21 class GrGLGeometryProcessor { 21 class GrGLGeometryProcessor {
22 public: 22 public:
23 GrGLGeometryProcessor() {} 23 GrGLGeometryProcessor() : fViewMatrixName(NULL) { fViewMatrix = SkMatrix::In validMatrix(); }
24 virtual ~GrGLGeometryProcessor() {} 24 virtual ~GrGLGeometryProcessor() {}
25 25
26 typedef GrGLProgramDataManager::UniformHandle UniformHandle; 26 typedef GrGLProgramDataManager::UniformHandle UniformHandle;
27 typedef GrGLProcessor::TextureSamplerArray TextureSamplerArray; 27 typedef GrGLProcessor::TextureSamplerArray TextureSamplerArray;
28 28
29 struct EmitArgs { 29 struct EmitArgs {
30 EmitArgs(GrGLGPBuilder* pb, 30 EmitArgs(GrGLGPBuilder* pb,
31 const GrPrimitiveProcessor& gp, 31 const GrPrimitiveProcessor& gp,
32 const GrBatchTracker& bt, 32 const GrBatchTracker& bt,
33 const char* outputColor, 33 const char* outputColor,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 * This function will only do the minimum required to emit the correct shad er code. If 67 * This function will only do the minimum required to emit the correct shad er code. If
68 * inputType == attribute, then colorAttr must not be NULL. Likewise, if i nputType == Uniform 68 * inputType == attribute, then colorAttr must not be NULL. Likewise, if i nputType == Uniform
69 * then colorUniform must not be NULL. 69 * then colorUniform must not be NULL.
70 */ 70 */
71 void setupColorPassThrough(GrGLGPBuilder* pb, 71 void setupColorPassThrough(GrGLGPBuilder* pb,
72 GrGPInput inputType, 72 GrGPInput inputType,
73 const char* inputName, 73 const char* inputName,
74 const GrGeometryProcessor::GrAttribute* colorAttr , 74 const GrGeometryProcessor::GrAttribute* colorAttr ,
75 UniformHandle* colorUniform); 75 UniformHandle* colorUniform);
76 76
77 const char* uViewM() const { return fViewMatrixName; }
78
79 /** a helper function to setup the uniform handle for the uniform view matri x */
80 void addUniformViewMatrix(GrGLGPBuilder*);
81
82
83 /** a helper function to upload a uniform viewmatrix.
84 * TODO we can remove this function when we have deferred geometry in place
85 */
86 void setUniformViewMatrix(const GrGLProgramDataManager&,
87 const SkMatrix& viewMatrix);
88
77 private: 89 private:
90 UniformHandle fViewMatrixUniform;
91 SkMatrix fViewMatrix;
92 const char* fViewMatrixName;
93
78 typedef GrGLProcessor INHERITED; 94 typedef GrGLProcessor INHERITED;
79 }; 95 };
80 96
81 #endif 97 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrDistanceFieldTextureEffect.cpp ('k') | src/gpu/gl/GrGLPathRendering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698