OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
7 | 7 |
8 #include <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION_ASSERT(ptr && \ | 68 GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION_ASSERT(ptr && \ |
69 (ptr[0] == static_cast<type>(0) || ptr[0] == static_cast<type>(-1))); | 69 (ptr[0] == static_cast<type>(0) || ptr[0] == static_cast<type>(-1))); |
70 | 70 |
71 namespace gpu { | 71 namespace gpu { |
72 | 72 |
73 class MappedMemoryManager; | 73 class MappedMemoryManager; |
74 | 74 |
75 namespace gles2 { | 75 namespace gles2 { |
76 | 76 |
77 class ClientSideBufferHelper; | 77 class ClientSideBufferHelper; |
| 78 class ProgramInfoManager; |
78 | 79 |
79 // Base class for IdHandlers | 80 // Base class for IdHandlers |
80 class IdHandlerInterface { | 81 class IdHandlerInterface { |
81 public: | 82 public: |
82 IdHandlerInterface() { } | 83 IdHandlerInterface() { } |
83 virtual ~IdHandlerInterface() { } | 84 virtual ~IdHandlerInterface() { } |
84 | 85 |
85 // Makes some ids at or above id_offset. | 86 // Makes some ids at or above id_offset. |
86 virtual void MakeIds(GLuint id_offset, GLsizei n, GLuint* ids) = 0; | 87 virtual void MakeIds(GLuint id_offset, GLsizei n, GLuint* ids) = 0; |
87 | 88 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // Include the auto-generated part of this class. We split this because | 169 // Include the auto-generated part of this class. We split this because |
169 // it means we can easily edit the non-auto generated parts right here in | 170 // it means we can easily edit the non-auto generated parts right here in |
170 // this file instead of having to edit some template or the code generator. | 171 // this file instead of having to edit some template or the code generator. |
171 #include "../client/gles2_implementation_autogen.h" | 172 #include "../client/gles2_implementation_autogen.h" |
172 | 173 |
173 void DisableVertexAttribArray(GLuint index); | 174 void DisableVertexAttribArray(GLuint index); |
174 void EnableVertexAttribArray(GLuint index); | 175 void EnableVertexAttribArray(GLuint index); |
175 void GetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params); | 176 void GetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params); |
176 void GetVertexAttribiv(GLuint index, GLenum pname, GLint* params); | 177 void GetVertexAttribiv(GLuint index, GLenum pname, GLint* params); |
177 | 178 |
| 179 void GetProgramInfoCHROMIUMHelper(GLuint program, std::vector<int8>* result); |
| 180 void DeleteProgramOrShaderHelper(GLuint program_or_shader); |
| 181 GLint GetAttribLocationHelper(GLuint program, const char* name); |
| 182 GLint GetUniformLocationHelper(GLuint program, const char* name); |
| 183 bool GetActiveAttribHelper( |
| 184 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, |
| 185 GLint* size, GLenum* type, char* name); |
| 186 bool GetActiveUniformHelper( |
| 187 GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, |
| 188 GLint* size, GLenum* type, char* name); |
| 189 |
178 GLuint MakeTextureId() { | 190 GLuint MakeTextureId() { |
179 GLuint id; | 191 GLuint id; |
180 texture_id_handler_->MakeIds(0, 1, &id); | 192 texture_id_handler_->MakeIds(0, 1, &id); |
181 return id; | 193 return id; |
182 } | 194 } |
183 | 195 |
184 void FreeTextureId(GLuint id) { | 196 void FreeTextureId(GLuint id) { |
185 texture_id_handler_->FreeIds(1, &id); | 197 texture_id_handler_->FreeIds(1, &id); |
186 } | 198 } |
187 | 199 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 std::set<std::string> requestable_extensions_set_; | 484 std::set<std::string> requestable_extensions_set_; |
473 | 485 |
474 typedef std::map<const void*, MappedBuffer> MappedBufferMap; | 486 typedef std::map<const void*, MappedBuffer> MappedBufferMap; |
475 MappedBufferMap mapped_buffers_; | 487 MappedBufferMap mapped_buffers_; |
476 | 488 |
477 typedef std::map<const void*, MappedTexture> MappedTextureMap; | 489 typedef std::map<const void*, MappedTexture> MappedTextureMap; |
478 MappedTextureMap mapped_textures_; | 490 MappedTextureMap mapped_textures_; |
479 | 491 |
480 scoped_ptr<MappedMemoryManager> mapped_memory_; | 492 scoped_ptr<MappedMemoryManager> mapped_memory_; |
481 | 493 |
| 494 scoped_ptr<ProgramInfoManager> program_info_manager_; |
| 495 |
482 DISALLOW_COPY_AND_ASSIGN(GLES2Implementation); | 496 DISALLOW_COPY_AND_ASSIGN(GLES2Implementation); |
483 }; | 497 }; |
484 | 498 |
485 inline bool GLES2Implementation::GetBufferParameterivHelper( | 499 inline bool GLES2Implementation::GetBufferParameterivHelper( |
486 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 500 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
487 return false; | 501 return false; |
488 } | 502 } |
489 | 503 |
490 inline bool GLES2Implementation::GetFramebufferAttachmentParameterivHelper( | 504 inline bool GLES2Implementation::GetFramebufferAttachmentParameterivHelper( |
491 GLenum /* target */, | 505 GLenum /* target */, |
492 GLenum /* attachment */, | 506 GLenum /* attachment */, |
493 GLenum /* pname */, | 507 GLenum /* pname */, |
494 GLint* /* params */) { | 508 GLint* /* params */) { |
495 return false; | 509 return false; |
496 } | 510 } |
497 | 511 |
498 inline bool GLES2Implementation::GetProgramivHelper( | |
499 GLuint /* program */, GLenum /* pname */, GLint* /* params */) { | |
500 return false; | |
501 } | |
502 | |
503 inline bool GLES2Implementation::GetRenderbufferParameterivHelper( | 512 inline bool GLES2Implementation::GetRenderbufferParameterivHelper( |
504 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 513 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
505 return false; | 514 return false; |
506 } | 515 } |
507 | 516 |
508 inline bool GLES2Implementation::GetShaderivHelper( | 517 inline bool GLES2Implementation::GetShaderivHelper( |
509 GLuint /* shader */, GLenum /* pname */, GLint* /* params */) { | 518 GLuint /* shader */, GLenum /* pname */, GLint* /* params */) { |
510 return false; | 519 return false; |
511 } | 520 } |
512 | 521 |
513 inline bool GLES2Implementation::GetTexParameterfvHelper( | 522 inline bool GLES2Implementation::GetTexParameterfvHelper( |
514 GLenum /* target */, GLenum /* pname */, GLfloat* /* params */) { | 523 GLenum /* target */, GLenum /* pname */, GLfloat* /* params */) { |
515 return false; | 524 return false; |
516 } | 525 } |
517 | 526 |
518 inline bool GLES2Implementation::GetTexParameterivHelper( | 527 inline bool GLES2Implementation::GetTexParameterivHelper( |
519 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 528 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
520 return false; | 529 return false; |
521 } | 530 } |
522 | 531 |
523 } // namespace gles2 | 532 } // namespace gles2 |
524 } // namespace gpu | 533 } // namespace gpu |
525 | 534 |
526 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 535 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
OLD | NEW |