| 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 #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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 278 |
| 279 ShareGroupContextData* share_group_context_data() { | 279 ShareGroupContextData* share_group_context_data() { |
| 280 return &share_group_context_data_; | 280 return &share_group_context_data_; |
| 281 } | 281 } |
| 282 | 282 |
| 283 private: | 283 private: |
| 284 friend class GLES2ImplementationTest; | 284 friend class GLES2ImplementationTest; |
| 285 friend class VertexArrayObjectManager; | 285 friend class VertexArrayObjectManager; |
| 286 friend class QueryTracker; | 286 friend class QueryTracker; |
| 287 | 287 |
| 288 using IdNamespaces = id_namespaces::IdNamespaces; |
| 289 |
| 288 // Used to track whether an extension is available | 290 // Used to track whether an extension is available |
| 289 enum ExtensionStatus { | 291 enum ExtensionStatus { |
| 290 kAvailableExtensionStatus, | 292 kAvailableExtensionStatus, |
| 291 kUnavailableExtensionStatus, | 293 kUnavailableExtensionStatus, |
| 292 kUnknownExtensionStatus | 294 kUnknownExtensionStatus |
| 293 }; | 295 }; |
| 294 | 296 |
| 295 enum Dimension { | 297 enum Dimension { |
| 296 k2D, | 298 k2D, |
| 297 k3D, | 299 k3D, |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 void BindSamplerHelper(GLuint unit, GLuint sampler); | 484 void BindSamplerHelper(GLuint unit, GLuint sampler); |
| 483 void BindTextureHelper(GLenum target, GLuint texture); | 485 void BindTextureHelper(GLenum target, GLuint texture); |
| 484 void BindTransformFeedbackHelper(GLenum target, GLuint transformfeedback); | 486 void BindTransformFeedbackHelper(GLenum target, GLuint transformfeedback); |
| 485 void BindVertexArrayOESHelper(GLuint array); | 487 void BindVertexArrayOESHelper(GLuint array); |
| 486 void UseProgramHelper(GLuint program); | 488 void UseProgramHelper(GLuint program); |
| 487 | 489 |
| 488 void BindBufferStub(GLenum target, GLuint buffer); | 490 void BindBufferStub(GLenum target, GLuint buffer); |
| 489 void BindBufferBaseStub(GLenum target, GLuint index, GLuint buffer); | 491 void BindBufferBaseStub(GLenum target, GLuint index, GLuint buffer); |
| 490 void BindBufferRangeStub(GLenum target, GLuint index, GLuint buffer, | 492 void BindBufferRangeStub(GLenum target, GLuint index, GLuint buffer, |
| 491 GLintptr offset, GLsizeiptr size); | 493 GLintptr offset, GLsizeiptr size); |
| 492 void BindFramebufferStub(GLenum target, GLuint framebuffer); | |
| 493 void BindRenderbufferStub(GLenum target, GLuint renderbuffer); | 494 void BindRenderbufferStub(GLenum target, GLuint renderbuffer); |
| 494 void BindTextureStub(GLenum target, GLuint texture); | 495 void BindTextureStub(GLenum target, GLuint texture); |
| 495 | 496 |
| 496 void GenBuffersHelper(GLsizei n, const GLuint* buffers); | 497 void GenBuffersHelper(GLsizei n, const GLuint* buffers); |
| 497 void GenFramebuffersHelper(GLsizei n, const GLuint* framebuffers); | 498 void GenFramebuffersHelper(GLsizei n, const GLuint* framebuffers); |
| 498 void GenRenderbuffersHelper(GLsizei n, const GLuint* renderbuffers); | 499 void GenRenderbuffersHelper(GLsizei n, const GLuint* renderbuffers); |
| 499 void GenTexturesHelper(GLsizei n, const GLuint* textures); | 500 void GenTexturesHelper(GLsizei n, const GLuint* textures); |
| 500 void GenVertexArraysOESHelper(GLsizei n, const GLuint* arrays); | 501 void GenVertexArraysOESHelper(GLsizei n, const GLuint* arrays); |
| 501 void GenQueriesEXTHelper(GLsizei n, const GLuint* queries); | 502 void GenQueriesEXTHelper(GLsizei n, const GLuint* queries); |
| 502 void GenSamplersHelper(GLsizei n, const GLuint* samplers); | 503 void GenSamplersHelper(GLsizei n, const GLuint* samplers); |
| 503 void GenTransformFeedbacksHelper(GLsizei n, const GLuint* transformfeedbacks); | 504 void GenTransformFeedbacksHelper(GLsizei n, const GLuint* transformfeedbacks); |
| 504 | 505 |
| 505 void DeleteBuffersHelper(GLsizei n, const GLuint* buffers); | 506 void DeleteBuffersHelper(GLsizei n, const GLuint* buffers); |
| 506 void DeleteFramebuffersHelper(GLsizei n, const GLuint* framebuffers); | 507 void DeleteFramebuffersHelper(GLsizei n, const GLuint* framebuffers); |
| 507 void DeleteRenderbuffersHelper(GLsizei n, const GLuint* renderbuffers); | 508 void DeleteRenderbuffersHelper(GLsizei n, const GLuint* renderbuffers); |
| 508 void DeleteTexturesHelper(GLsizei n, const GLuint* textures); | 509 void DeleteTexturesHelper(GLsizei n, const GLuint* textures); |
| 509 bool DeleteProgramHelper(GLuint program); | 510 bool DeleteProgramHelper(GLuint program); |
| 510 bool DeleteShaderHelper(GLuint shader); | 511 bool DeleteShaderHelper(GLuint shader); |
| 511 void DeleteQueriesEXTHelper(GLsizei n, const GLuint* queries); | 512 void DeleteQueriesEXTHelper(GLsizei n, const GLuint* queries); |
| 512 void DeleteVertexArraysOESHelper(GLsizei n, const GLuint* arrays); | 513 void DeleteVertexArraysOESHelper(GLsizei n, const GLuint* arrays); |
| 513 void DeleteSamplersHelper(GLsizei n, const GLuint* samplers); | 514 void DeleteSamplersHelper(GLsizei n, const GLuint* samplers); |
| 514 void DeleteTransformFeedbacksHelper( | 515 void DeleteTransformFeedbacksHelper( |
| 515 GLsizei n, const GLuint* transformfeedbacks); | 516 GLsizei n, const GLuint* transformfeedbacks); |
| 516 void DeleteSyncHelper(GLsync sync); | 517 void DeleteSyncHelper(GLsync sync); |
| 517 | 518 |
| 518 void DeleteBuffersStub(GLsizei n, const GLuint* buffers); | 519 void DeleteBuffersStub(GLsizei n, const GLuint* buffers); |
| 519 void DeleteFramebuffersStub(GLsizei n, const GLuint* framebuffers); | |
| 520 void DeleteRenderbuffersStub(GLsizei n, const GLuint* renderbuffers); | 520 void DeleteRenderbuffersStub(GLsizei n, const GLuint* renderbuffers); |
| 521 void DeleteTexturesStub(GLsizei n, const GLuint* textures); | 521 void DeleteTexturesStub(GLsizei n, const GLuint* textures); |
| 522 void DeletePathsCHROMIUMStub(GLuint first_client_id, GLsizei range); | 522 void DeletePathsCHROMIUMStub(GLuint first_client_id, GLsizei range); |
| 523 void DeleteProgramStub(GLsizei n, const GLuint* programs); | 523 void DeleteProgramStub(GLsizei n, const GLuint* programs); |
| 524 void DeleteShaderStub(GLsizei n, const GLuint* shaders); | 524 void DeleteShaderStub(GLsizei n, const GLuint* shaders); |
| 525 void DeleteVertexArraysOESStub(GLsizei n, const GLuint* arrays); | |
| 526 void DeleteSamplersStub(GLsizei n, const GLuint* samplers); | 525 void DeleteSamplersStub(GLsizei n, const GLuint* samplers); |
| 527 void DeleteTransformFeedbacksStub( | |
| 528 GLsizei n, const GLuint* transformfeedbacks); | |
| 529 void DeleteSyncStub(GLsizei n, const GLuint* syncs); | 526 void DeleteSyncStub(GLsizei n, const GLuint* syncs); |
| 530 | 527 |
| 531 void BufferDataHelper( | 528 void BufferDataHelper( |
| 532 GLenum target, GLsizeiptr size, const void* data, GLenum usage); | 529 GLenum target, GLsizeiptr size, const void* data, GLenum usage); |
| 533 void BufferSubDataHelper( | 530 void BufferSubDataHelper( |
| 534 GLenum target, GLintptr offset, GLsizeiptr size, const void* data); | 531 GLenum target, GLintptr offset, GLsizeiptr size, const void* data); |
| 535 void BufferSubDataHelperImpl( | 532 void BufferSubDataHelperImpl( |
| 536 GLenum target, GLintptr offset, GLsizeiptr size, const void* data, | 533 GLenum target, GLintptr offset, GLsizeiptr size, const void* data, |
| 537 ScopedTransferBufferPtr* buffer); | 534 ScopedTransferBufferPtr* buffer); |
| 538 | 535 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 bool GetShaderivHelper(GLuint shader, GLenum pname, GLint* params); | 610 bool GetShaderivHelper(GLuint shader, GLenum pname, GLint* params); |
| 614 bool GetTexParameterfvHelper(GLenum target, GLenum pname, GLfloat* params); | 611 bool GetTexParameterfvHelper(GLenum target, GLenum pname, GLfloat* params); |
| 615 bool GetTexParameterivHelper(GLenum target, GLenum pname, GLint* params); | 612 bool GetTexParameterivHelper(GLenum target, GLenum pname, GLint* params); |
| 616 const GLubyte* GetStringHelper(GLenum name); | 613 const GLubyte* GetStringHelper(GLenum name); |
| 617 | 614 |
| 618 bool IsExtensionAvailable(const char* ext); | 615 bool IsExtensionAvailable(const char* ext); |
| 619 | 616 |
| 620 // Caches certain capabilties state. Return true if cached. | 617 // Caches certain capabilties state. Return true if cached. |
| 621 bool SetCapabilityState(GLenum cap, bool enabled); | 618 bool SetCapabilityState(GLenum cap, bool enabled); |
| 622 | 619 |
| 623 IdHandlerInterface* GetIdHandler(int id_namespace) const; | 620 IdHandlerInterface* GetIdHandler(SharedIdNamespaces id_namespace) const; |
| 624 RangeIdHandlerInterface* GetRangeIdHandler(int id_namespace) const; | 621 RangeIdHandlerInterface* GetRangeIdHandler(int id_namespace) const; |
| 625 // IdAllocators for objects that can't be shared among contexts. | 622 // IdAllocators for objects that can't be shared among contexts. |
| 626 // For now, used only for Queries. TODO(hj.r.chung) Should be added for | 623 IdAllocator* GetIdAllocator(IdNamespaces id_namespace) const; |
| 627 // Framebuffer and Vertex array objects. | |
| 628 IdAllocator* GetIdAllocator(int id_namespace) const; | |
| 629 | 624 |
| 630 void FinishHelper(); | 625 void FinishHelper(); |
| 631 void FlushHelper(); | 626 void FlushHelper(); |
| 632 | 627 |
| 633 void RunIfContextNotLost(const base::Closure& callback); | 628 void RunIfContextNotLost(const base::Closure& callback); |
| 634 | 629 |
| 635 // Validate if an offset is valid, i.e., non-negative and fit into 32-bit. | 630 // Validate if an offset is valid, i.e., non-negative and fit into 32-bit. |
| 636 // If not, generate an approriate error, and return false. | 631 // If not, generate an approriate error, and return false. |
| 637 bool ValidateOffset(const char* func, GLintptr offset); | 632 bool ValidateOffset(const char* func, GLintptr offset); |
| 638 | 633 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 | 798 |
| 804 typedef std::map<const void*, MappedTexture> MappedTextureMap; | 799 typedef std::map<const void*, MappedTexture> MappedTextureMap; |
| 805 MappedTextureMap mapped_textures_; | 800 MappedTextureMap mapped_textures_; |
| 806 | 801 |
| 807 std::unique_ptr<MappedMemoryManager> mapped_memory_; | 802 std::unique_ptr<MappedMemoryManager> mapped_memory_; |
| 808 | 803 |
| 809 scoped_refptr<ShareGroup> share_group_; | 804 scoped_refptr<ShareGroup> share_group_; |
| 810 ShareGroupContextData share_group_context_data_; | 805 ShareGroupContextData share_group_context_data_; |
| 811 | 806 |
| 812 std::unique_ptr<QueryTracker> query_tracker_; | 807 std::unique_ptr<QueryTracker> query_tracker_; |
| 813 std::unique_ptr<IdAllocator> query_id_allocator_; | 808 std::unique_ptr<IdAllocator> |
| 809 id_allocators_[static_cast<int>(IdNamespaces::kNumIdNamespaces)]; |
| 814 | 810 |
| 815 std::unique_ptr<BufferTracker> buffer_tracker_; | 811 std::unique_ptr<BufferTracker> buffer_tracker_; |
| 816 | 812 |
| 817 base::Callback<void(const char*, int32_t)> error_message_callback_; | 813 base::Callback<void(const char*, int32_t)> error_message_callback_; |
| 818 base::Closure lost_context_callback_; | 814 base::Closure lost_context_callback_; |
| 819 bool lost_context_callback_run_ = false; | 815 bool lost_context_callback_run_ = false; |
| 820 | 816 |
| 821 int current_trace_stack_; | 817 int current_trace_stack_; |
| 822 | 818 |
| 823 GpuControl* const gpu_control_; | 819 GpuControl* const gpu_control_; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 | 874 |
| 879 inline bool GLES2Implementation::GetTexParameterivHelper( | 875 inline bool GLES2Implementation::GetTexParameterivHelper( |
| 880 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 876 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
| 881 return false; | 877 return false; |
| 882 } | 878 } |
| 883 | 879 |
| 884 } // namespace gles2 | 880 } // namespace gles2 |
| 885 } // namespace gpu | 881 } // namespace gpu |
| 886 | 882 |
| 887 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 883 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
| OLD | NEW |