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

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

Issue 1431433003: Move shader compiling to ProgramBuilder and various ShaderBuilder cleanups. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits Created 5 years, 1 month 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 #include "gl/GrGLTypes.h"
12 #include "GrGeometryProcessor.h" 13 #include "GrGeometryProcessor.h"
13 14
14 class GrGLVarying; 15 class GrGLVarying;
15 16
16 class GrGLVertexBuilder : public GrGLShaderBuilder { 17 class GrGLVertexBuilder : public GrGLShaderBuilder {
17 public: 18 public:
18 GrGLVertexBuilder(GrGLProgramBuilder* program); 19 GrGLVertexBuilder(GrGLProgramBuilder* program);
19 20
20 void transformToNormalizedDeviceSpace(const GrShaderVar& posVar); 21 void transformToNormalizedDeviceSpace(const GrShaderVar& posVar);
21 void emitAttributes(const GrGeometryProcessor& gp); 22 void emitAttributes(const GrGeometryProcessor& gp);
22 23
23 void addAttribute(const GrGeometryProcessor::Attribute* attr) { 24 void addAttribute(const GrGeometryProcessor::Attribute* attr) {
24 this->addAttribute(GrShaderVar(attr->fName, 25 this->addAttribute(GrShaderVar(attr->fName,
25 GrVertexAttribTypeToSLType(attr->fType), 26 GrVertexAttribTypeToSLType(attr->fType),
26 GrShaderVar::kAttribute_TypeModifier, 27 GrShaderVar::kAttribute_TypeModifier,
27 GrShaderVar::kNonArray, 28 GrShaderVar::kNonArray,
28 attr->fPrecision)); 29 attr->fPrecision));
29 } 30 }
30 31
31 private: 32 private:
32 /* 33 /*
33 * Internal call for GrGLProgramBuilder.addVarying 34 * Internal call for GrGLProgramBuilder.addVarying
34 */ 35 */
35 void addVarying(const char* name, GrSLPrecision, GrGLVarying*); 36 void addVarying(const char* name, GrSLPrecision, GrGLVarying*);
36 37
37 /* 38 /*
38 * private helpers for compilation by GrGLProgramBuilder 39 * private helpers for compilation by GrGLProgramBuilder
39 */ 40 */
40 void bindVertexAttributes(GrGLuint programID); 41 void bindVertexAttributes(GrGLuint programID);
41 bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>* shader Ids);
42 42
43 // an internal call which checks for uniquness of a var before adding it to the list of inputs 43 // an internal call which checks for uniquness of a var before adding it to the list of inputs
44 bool addAttribute(const GrShaderVar& var); 44 bool addAttribute(const GrShaderVar& var);
45 45
46 void onFinalize() override {}
47
46 const char* fRtAdjustName; 48 const char* fRtAdjustName;
47 49
48 friend class GrGLProgramBuilder; 50 friend class GrGLProgramBuilder;
49 51
50 typedef GrGLShaderBuilder INHERITED; 52 typedef GrGLShaderBuilder INHERITED;
51 }; 53 };
52 54
53 #endif 55 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLShaderBuilder.cpp ('k') | src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698