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 <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 ScopedTransferBufferPtr* buffer, uint32 buffer_padded_row_size); | 553 ScopedTransferBufferPtr* buffer, uint32 buffer_padded_row_size); |
554 void TexSubImage3DImpl( | 554 void TexSubImage3DImpl( |
555 GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, | 555 GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, |
556 GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, | 556 GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, |
557 uint32 unpadded_row_size, const void* pixels, | 557 uint32 unpadded_row_size, const void* pixels, |
558 uint32 pixels_padded_row_size, GLboolean internal, | 558 uint32 pixels_padded_row_size, GLboolean internal, |
559 ScopedTransferBufferPtr* buffer, uint32 buffer_padded_row_size); | 559 ScopedTransferBufferPtr* buffer, uint32 buffer_padded_row_size); |
560 | 560 |
561 // Helpers for query functions. | 561 // Helpers for query functions. |
562 bool GetHelper(GLenum pname, GLint* params); | 562 bool GetHelper(GLenum pname, GLint* params); |
| 563 GLuint GetBoundBufferHelper(GLenum target); |
563 bool GetBooleanvHelper(GLenum pname, GLboolean* params); | 564 bool GetBooleanvHelper(GLenum pname, GLboolean* params); |
564 bool GetBufferParameterivHelper(GLenum target, GLenum pname, GLint* params); | 565 bool GetBufferParameterivHelper(GLenum target, GLenum pname, GLint* params); |
565 bool GetFloatvHelper(GLenum pname, GLfloat* params); | 566 bool GetFloatvHelper(GLenum pname, GLfloat* params); |
566 bool GetFramebufferAttachmentParameterivHelper( | 567 bool GetFramebufferAttachmentParameterivHelper( |
567 GLenum target, GLenum attachment, GLenum pname, GLint* params); | 568 GLenum target, GLenum attachment, GLenum pname, GLint* params); |
568 bool GetIntegervHelper(GLenum pname, GLint* params); | 569 bool GetIntegervHelper(GLenum pname, GLint* params); |
569 bool GetInternalformativHelper( | 570 bool GetInternalformativHelper( |
570 GLenum target, GLenum format, GLenum pname, GLsizei bufSize, | 571 GLenum target, GLenum format, GLenum pname, GLsizei bufSize, |
571 GLint* params); | 572 GLint* params); |
572 bool GetProgramivHelper(GLuint program, GLenum pname, GLint* params); | 573 bool GetProgramivHelper(GLuint program, GLenum pname, GLint* params); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 const std::string& GetLogPrefix() const; | 653 const std::string& GetLogPrefix() const; |
653 | 654 |
654 #if defined(GL_CLIENT_FAIL_GL_ERRORS) | 655 #if defined(GL_CLIENT_FAIL_GL_ERRORS) |
655 void CheckGLError(); | 656 void CheckGLError(); |
656 void FailGLError(GLenum error); | 657 void FailGLError(GLenum error); |
657 #else | 658 #else |
658 void CheckGLError() { } | 659 void CheckGLError() { } |
659 void FailGLError(GLenum /* error */) { } | 660 void FailGLError(GLenum /* error */) { } |
660 #endif | 661 #endif |
661 | 662 |
| 663 void RemoveMappedBufferRangeByTarget(GLenum target); |
| 664 void RemoveMappedBufferRangeById(GLuint buffer); |
| 665 void ClearMappedBufferRangeMap(); |
| 666 |
| 667 void DrawElementsImpl(GLenum mode, GLsizei count, GLenum type, |
| 668 const void* indices, const char* func_name); |
| 669 |
662 GLES2Util util_; | 670 GLES2Util util_; |
663 GLES2CmdHelper* helper_; | 671 GLES2CmdHelper* helper_; |
664 TransferBufferInterface* transfer_buffer_; | 672 TransferBufferInterface* transfer_buffer_; |
665 std::string last_error_; | 673 std::string last_error_; |
666 DebugMarkerManager debug_marker_manager_; | 674 DebugMarkerManager debug_marker_manager_; |
667 std::string this_in_hex_; | 675 std::string this_in_hex_; |
668 | 676 |
669 std::queue<int32> swap_buffers_tokens_; | 677 std::queue<int32> swap_buffers_tokens_; |
670 std::queue<int32> rate_limit_tokens_; | 678 std::queue<int32> rate_limit_tokens_; |
671 | 679 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 typedef std::map<uint32, std::set<std::string> > GLStringMap; | 768 typedef std::map<uint32, std::set<std::string> > GLStringMap; |
761 GLStringMap gl_strings_; | 769 GLStringMap gl_strings_; |
762 | 770 |
763 // Similar cache for glGetRequestableExtensionsCHROMIUM. We don't | 771 // Similar cache for glGetRequestableExtensionsCHROMIUM. We don't |
764 // have an enum for this so handle it separately. | 772 // have an enum for this so handle it separately. |
765 std::set<std::string> requestable_extensions_set_; | 773 std::set<std::string> requestable_extensions_set_; |
766 | 774 |
767 typedef std::map<const void*, MappedBuffer> MappedBufferMap; | 775 typedef std::map<const void*, MappedBuffer> MappedBufferMap; |
768 MappedBufferMap mapped_buffers_; | 776 MappedBufferMap mapped_buffers_; |
769 | 777 |
| 778 // TODO(zmo): Consolidate |mapped_buffers_| and |mapped_buffer_range_map_|. |
| 779 typedef base::hash_map<GLuint, MappedBuffer> MappedBufferRangeMap; |
| 780 MappedBufferRangeMap mapped_buffer_range_map_; |
| 781 |
770 typedef std::map<const void*, MappedTexture> MappedTextureMap; | 782 typedef std::map<const void*, MappedTexture> MappedTextureMap; |
771 MappedTextureMap mapped_textures_; | 783 MappedTextureMap mapped_textures_; |
772 | 784 |
773 scoped_ptr<MappedMemoryManager> mapped_memory_; | 785 scoped_ptr<MappedMemoryManager> mapped_memory_; |
774 | 786 |
775 scoped_refptr<ShareGroup> share_group_; | 787 scoped_refptr<ShareGroup> share_group_; |
776 ShareGroupContextData share_group_context_data_; | 788 ShareGroupContextData share_group_context_data_; |
777 | 789 |
778 scoped_ptr<QueryTracker> query_tracker_; | 790 scoped_ptr<QueryTracker> query_tracker_; |
779 typedef std::map<GLuint, QueryTracker::Query*> QueryMap; | 791 typedef std::map<GLuint, QueryTracker::Query*> QueryMap; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 | 837 |
826 inline bool GLES2Implementation::GetTexParameterivHelper( | 838 inline bool GLES2Implementation::GetTexParameterivHelper( |
827 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 839 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
828 return false; | 840 return false; |
829 } | 841 } |
830 | 842 |
831 } // namespace gles2 | 843 } // namespace gles2 |
832 } // namespace gpu | 844 } // namespace gpu |
833 | 845 |
834 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 846 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
OLD | NEW |