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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 std::set<std::string> requestable_extensions_set_; | 478 std::set<std::string> requestable_extensions_set_; |
467 | 479 |
468 typedef std::map<const void*, MappedBuffer> MappedBufferMap; | 480 typedef std::map<const void*, MappedBuffer> MappedBufferMap; |
469 MappedBufferMap mapped_buffers_; | 481 MappedBufferMap mapped_buffers_; |
470 | 482 |
471 typedef std::map<const void*, MappedTexture> MappedTextureMap; | 483 typedef std::map<const void*, MappedTexture> MappedTextureMap; |
472 MappedTextureMap mapped_textures_; | 484 MappedTextureMap mapped_textures_; |
473 | 485 |
474 scoped_ptr<MappedMemoryManager> mapped_memory_; | 486 scoped_ptr<MappedMemoryManager> mapped_memory_; |
475 | 487 |
| 488 scoped_ptr<ProgramInfoManager> program_info_manager_; |
| 489 |
476 DISALLOW_COPY_AND_ASSIGN(GLES2Implementation); | 490 DISALLOW_COPY_AND_ASSIGN(GLES2Implementation); |
477 }; | 491 }; |
478 | 492 |
479 inline bool GLES2Implementation::GetBufferParameterivHelper( | 493 inline bool GLES2Implementation::GetBufferParameterivHelper( |
480 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 494 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
481 return false; | 495 return false; |
482 } | 496 } |
483 | 497 |
484 inline bool GLES2Implementation::GetFramebufferAttachmentParameterivHelper( | 498 inline bool GLES2Implementation::GetFramebufferAttachmentParameterivHelper( |
485 GLenum /* target */, | 499 GLenum /* target */, |
486 GLenum /* attachment */, | 500 GLenum /* attachment */, |
487 GLenum /* pname */, | 501 GLenum /* pname */, |
488 GLint* /* params */) { | 502 GLint* /* params */) { |
489 return false; | 503 return false; |
490 } | 504 } |
491 | 505 |
492 inline bool GLES2Implementation::GetProgramivHelper( | |
493 GLuint /* program */, GLenum /* pname */, GLint* /* params */) { | |
494 return false; | |
495 } | |
496 | |
497 inline bool GLES2Implementation::GetRenderbufferParameterivHelper( | 506 inline bool GLES2Implementation::GetRenderbufferParameterivHelper( |
498 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 507 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
499 return false; | 508 return false; |
500 } | 509 } |
501 | 510 |
502 inline bool GLES2Implementation::GetShaderivHelper( | 511 inline bool GLES2Implementation::GetShaderivHelper( |
503 GLuint /* shader */, GLenum /* pname */, GLint* /* params */) { | 512 GLuint /* shader */, GLenum /* pname */, GLint* /* params */) { |
504 return false; | 513 return false; |
505 } | 514 } |
506 | 515 |
507 inline bool GLES2Implementation::GetTexParameterfvHelper( | 516 inline bool GLES2Implementation::GetTexParameterfvHelper( |
508 GLenum /* target */, GLenum /* pname */, GLfloat* /* params */) { | 517 GLenum /* target */, GLenum /* pname */, GLfloat* /* params */) { |
509 return false; | 518 return false; |
510 } | 519 } |
511 | 520 |
512 inline bool GLES2Implementation::GetTexParameterivHelper( | 521 inline bool GLES2Implementation::GetTexParameterivHelper( |
513 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 522 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
514 return false; | 523 return false; |
515 } | 524 } |
516 | 525 |
517 } // namespace gles2 | 526 } // namespace gles2 |
518 } // namespace gpu | 527 } // namespace gpu |
519 | 528 |
520 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 529 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
OLD | NEW |