OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/client/program_info_manager.h" | 5 #include "gpu/command_buffer/client/program_info_manager.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
11 #include "gpu/command_buffer/client/gles2_implementation.h" | 11 #include "gpu/command_buffer/client/gles2_implementation.h" |
12 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 12 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
13 | 13 |
14 namespace gpu { | 14 namespace gpu { |
15 namespace gles2 { | 15 namespace gles2 { |
16 | 16 |
17 class NonCachedProgramInfoManager : public ProgramInfoManager { | 17 class NonCachedProgramInfoManager : public ProgramInfoManager { |
18 public: | 18 public: |
19 NonCachedProgramInfoManager(); | 19 NonCachedProgramInfoManager(); |
20 virtual ~NonCachedProgramInfoManager(); | 20 virtual ~NonCachedProgramInfoManager(); |
21 | 21 |
22 virtual void CreateInfo(GLuint program) OVERRIDE; | 22 virtual void CreateInfo(GLuint program) override; |
23 | 23 |
24 virtual void DeleteInfo(GLuint program) OVERRIDE; | 24 virtual void DeleteInfo(GLuint program) override; |
25 | 25 |
26 virtual bool GetProgramiv(GLES2Implementation* gl, | 26 virtual bool GetProgramiv(GLES2Implementation* gl, |
27 GLuint program, | 27 GLuint program, |
28 GLenum pname, | 28 GLenum pname, |
29 GLint* params) OVERRIDE; | 29 GLint* params) override; |
30 | 30 |
31 virtual GLint GetAttribLocation(GLES2Implementation* gl, | 31 virtual GLint GetAttribLocation(GLES2Implementation* gl, |
32 GLuint program, | 32 GLuint program, |
33 const char* name) OVERRIDE; | 33 const char* name) override; |
34 | 34 |
35 virtual GLint GetUniformLocation(GLES2Implementation* gl, | 35 virtual GLint GetUniformLocation(GLES2Implementation* gl, |
36 GLuint program, | 36 GLuint program, |
37 const char* name) OVERRIDE; | 37 const char* name) override; |
38 | 38 |
39 virtual bool GetActiveAttrib(GLES2Implementation* gl, | 39 virtual bool GetActiveAttrib(GLES2Implementation* gl, |
40 GLuint program, | 40 GLuint program, |
41 GLuint index, | 41 GLuint index, |
42 GLsizei bufsize, | 42 GLsizei bufsize, |
43 GLsizei* length, | 43 GLsizei* length, |
44 GLint* size, | 44 GLint* size, |
45 GLenum* type, | 45 GLenum* type, |
46 char* name) OVERRIDE; | 46 char* name) override; |
47 | 47 |
48 virtual bool GetActiveUniform(GLES2Implementation* gl, | 48 virtual bool GetActiveUniform(GLES2Implementation* gl, |
49 GLuint program, | 49 GLuint program, |
50 GLuint index, | 50 GLuint index, |
51 GLsizei bufsize, | 51 GLsizei bufsize, |
52 GLsizei* length, | 52 GLsizei* length, |
53 GLint* size, | 53 GLint* size, |
54 GLenum* type, | 54 GLenum* type, |
55 char* name) OVERRIDE; | 55 char* name) override; |
56 | 56 |
57 }; | 57 }; |
58 | 58 |
59 NonCachedProgramInfoManager::NonCachedProgramInfoManager() { | 59 NonCachedProgramInfoManager::NonCachedProgramInfoManager() { |
60 } | 60 } |
61 | 61 |
62 NonCachedProgramInfoManager::~NonCachedProgramInfoManager() { | 62 NonCachedProgramInfoManager::~NonCachedProgramInfoManager() { |
63 } | 63 } |
64 | 64 |
65 void NonCachedProgramInfoManager::CreateInfo(GLuint /* program */) { | 65 void NonCachedProgramInfoManager::CreateInfo(GLuint /* program */) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 GLint* size, GLenum* type, char* name) { | 100 GLint* size, GLenum* type, char* name) { |
101 return gl->GetActiveUniformHelper( | 101 return gl->GetActiveUniformHelper( |
102 program, index, bufsize, length, size, type, name); | 102 program, index, bufsize, length, size, type, name); |
103 } | 103 } |
104 | 104 |
105 class CachedProgramInfoManager : public ProgramInfoManager { | 105 class CachedProgramInfoManager : public ProgramInfoManager { |
106 public: | 106 public: |
107 CachedProgramInfoManager(); | 107 CachedProgramInfoManager(); |
108 virtual ~CachedProgramInfoManager(); | 108 virtual ~CachedProgramInfoManager(); |
109 | 109 |
110 virtual void CreateInfo(GLuint program) OVERRIDE; | 110 virtual void CreateInfo(GLuint program) override; |
111 | 111 |
112 virtual void DeleteInfo(GLuint program) OVERRIDE; | 112 virtual void DeleteInfo(GLuint program) override; |
113 | 113 |
114 virtual bool GetProgramiv(GLES2Implementation* gl, | 114 virtual bool GetProgramiv(GLES2Implementation* gl, |
115 GLuint program, | 115 GLuint program, |
116 GLenum pname, | 116 GLenum pname, |
117 GLint* params) OVERRIDE; | 117 GLint* params) override; |
118 | 118 |
119 virtual GLint GetAttribLocation(GLES2Implementation* gl, | 119 virtual GLint GetAttribLocation(GLES2Implementation* gl, |
120 GLuint program, | 120 GLuint program, |
121 const char* name) OVERRIDE; | 121 const char* name) override; |
122 | 122 |
123 virtual GLint GetUniformLocation(GLES2Implementation* gl, | 123 virtual GLint GetUniformLocation(GLES2Implementation* gl, |
124 GLuint program, | 124 GLuint program, |
125 const char* name) OVERRIDE; | 125 const char* name) override; |
126 | 126 |
127 virtual bool GetActiveAttrib(GLES2Implementation* gl, | 127 virtual bool GetActiveAttrib(GLES2Implementation* gl, |
128 GLuint program, | 128 GLuint program, |
129 GLuint index, | 129 GLuint index, |
130 GLsizei bufsize, | 130 GLsizei bufsize, |
131 GLsizei* length, | 131 GLsizei* length, |
132 GLint* size, | 132 GLint* size, |
133 GLenum* type, | 133 GLenum* type, |
134 char* name) OVERRIDE; | 134 char* name) override; |
135 | 135 |
136 virtual bool GetActiveUniform(GLES2Implementation* gl, | 136 virtual bool GetActiveUniform(GLES2Implementation* gl, |
137 GLuint program, | 137 GLuint program, |
138 GLuint index, | 138 GLuint index, |
139 GLsizei bufsize, | 139 GLsizei bufsize, |
140 GLsizei* length, | 140 GLsizei* length, |
141 GLint* size, | 141 GLint* size, |
142 GLenum* type, | 142 GLenum* type, |
143 char* name) OVERRIDE; | 143 char* name) override; |
144 | 144 |
145 private: | 145 private: |
146 class Program { | 146 class Program { |
147 public: | 147 public: |
148 struct UniformInfo { | 148 struct UniformInfo { |
149 UniformInfo(GLsizei _size, GLenum _type, const std::string& _name); | 149 UniformInfo(GLsizei _size, GLenum _type, const std::string& _name); |
150 | 150 |
151 GLsizei size; | 151 GLsizei size; |
152 GLenum type; | 152 GLenum type; |
153 bool is_array; | 153 bool is_array; |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 if (shared_resources_across_processes) { | 517 if (shared_resources_across_processes) { |
518 return new NonCachedProgramInfoManager(); | 518 return new NonCachedProgramInfoManager(); |
519 } else { | 519 } else { |
520 return new CachedProgramInfoManager(); | 520 return new CachedProgramInfoManager(); |
521 } | 521 } |
522 } | 522 } |
523 | 523 |
524 } // namespace gles2 | 524 } // namespace gles2 |
525 } // namespace gpu | 525 } // namespace gpu |
526 | 526 |
OLD | NEW |