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

Side by Side Diff: src/gpu/gl/builders/GrGLVertexShaderBuilder.h

Issue 822423004: Move most of the transform logic into the primitive processors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup 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
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 #ifndef GrGLVertexShader_DEFINED 8 #ifndef GrGLVertexShader_DEFINED
9 #define GrGLVertexShader_DEFINED 9 #define GrGLVertexShader_DEFINED
10 10
11 #include "GrGLShaderBuilder.h" 11 #include "GrGLShaderBuilder.h"
12 12
13 class GrGLVarying; 13 class GrGLVarying;
14 14
15 class GrGLVertexBuilder : public GrGLShaderBuilder { 15 class GrGLVertexBuilder : public GrGLShaderBuilder {
16 public: 16 public:
17 GrGLVertexBuilder(GrGLProgramBuilder* program); 17 GrGLVertexBuilder(GrGLProgramBuilder* program);
18 18
19 /** returns the expected position output */ 19 void transformToNormalizedDeviceSpace(const char* pos3);
20 const char* glPosition() const { return "pos3"; } 20 void emitAttributes(const GrGeometryProcessor& gp);
21 const char* positionCoords() const { return "position"; }
22 const char* localCoords() const { return "localCoords"; }
23 21
24 void addAttribute(const GrGeometryProcessor::GrAttribute* attr) { 22 void addAttribute(const GrGeometryProcessor::GrAttribute* attr) {
25 this->addAttribute(GrShaderVar(attr->fName, 23 this->addAttribute(GrShaderVar(attr->fName,
26 GrVertexAttribTypeToSLType(attr->fType), 24 GrVertexAttribTypeToSLType(attr->fType),
27 GrShaderVar::kAttribute_TypeModifier)); 25 GrShaderVar::kAttribute_TypeModifier));
28 } 26 }
29 27
30 private: 28 private:
31 /* 29 /*
32 * Internal call for GrGLProgramBuilder.addVarying 30 * Internal call for GrGLProgramBuilder.addVarying
33 */ 31 */
34 void addVarying(const char* name, GrGLVarying*); 32 void addVarying(const char* name, GrGLVarying*);
35 33
36 /* 34 /*
37 * private helpers for compilation by GrGLProgramBuilder 35 * private helpers for compilation by GrGLProgramBuilder
38 */ 36 */
39 void transformToNormalizedDeviceSpace();
40 void emitAttributes(const GrGeometryProcessor& gp);
41 void bindVertexAttributes(GrGLuint programID); 37 void bindVertexAttributes(GrGLuint programID);
42 bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>* shader Ids) const; 38 bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>* shader Ids) const;
43 39
44 // an internal call which checks for uniquness of a var before adding it to the list of inputs 40 // an internal call which checks for uniquness of a var before adding it to the list of inputs
45 bool addAttribute(const GrShaderVar& var); 41 bool addAttribute(const GrShaderVar& var);
46 42
47 const char* fRtAdjustName; 43 const char* fRtAdjustName;
48 44
49 friend class GrGLProgramBuilder; 45 friend class GrGLProgramBuilder;
50 46
51 typedef GrGLShaderBuilder INHERITED; 47 typedef GrGLShaderBuilder INHERITED;
52 }; 48 };
53 49
54 #endif 50 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.cpp ('k') | src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698