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 |
11 #include <list> | 11 #include <list> |
12 #include <map> | 12 #include <map> |
| 13 #include <memory> |
13 #include <queue> | 14 #include <queue> |
14 #include <set> | 15 #include <set> |
15 #include <string> | 16 #include <string> |
16 #include <utility> | 17 #include <utility> |
17 #include <vector> | 18 #include <vector> |
18 | 19 |
19 #include "base/compiler_specific.h" | 20 #include "base/compiler_specific.h" |
20 #include "base/macros.h" | 21 #include "base/macros.h" |
21 #include "base/memory/scoped_ptr.h" | |
22 #include "base/memory/weak_ptr.h" | 22 #include "base/memory/weak_ptr.h" |
23 #include "base/trace_event/memory_dump_provider.h" | 23 #include "base/trace_event/memory_dump_provider.h" |
24 #include "gpu/command_buffer/client/buffer_tracker.h" | 24 #include "gpu/command_buffer/client/buffer_tracker.h" |
25 #include "gpu/command_buffer/client/client_context_state.h" | 25 #include "gpu/command_buffer/client/client_context_state.h" |
26 #include "gpu/command_buffer/client/context_support.h" | 26 #include "gpu/command_buffer/client/context_support.h" |
27 #include "gpu/command_buffer/client/gles2_impl_export.h" | 27 #include "gpu/command_buffer/client/gles2_impl_export.h" |
28 #include "gpu/command_buffer/client/gles2_interface.h" | 28 #include "gpu/command_buffer/client/gles2_interface.h" |
29 #include "gpu/command_buffer/client/mapped_memory.h" | 29 #include "gpu/command_buffer/client/mapped_memory.h" |
30 #include "gpu/command_buffer/client/ref_counted.h" | 30 #include "gpu/command_buffer/client/ref_counted.h" |
31 #include "gpu/command_buffer/client/share_group.h" | 31 #include "gpu/command_buffer/client/share_group.h" |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 | 739 |
740 // unpack skip rows as last set by glPixelStorei | 740 // unpack skip rows as last set by glPixelStorei |
741 GLint unpack_skip_rows_; | 741 GLint unpack_skip_rows_; |
742 | 742 |
743 // unpack skip pixels as last set by glPixelStorei | 743 // unpack skip pixels as last set by glPixelStorei |
744 GLint unpack_skip_pixels_; | 744 GLint unpack_skip_pixels_; |
745 | 745 |
746 // unpack skip images as last set by glPixelStorei | 746 // unpack skip images as last set by glPixelStorei |
747 GLint unpack_skip_images_; | 747 GLint unpack_skip_images_; |
748 | 748 |
749 scoped_ptr<TextureUnit[]> texture_units_; | 749 std::unique_ptr<TextureUnit[]> texture_units_; |
750 | 750 |
751 // 0 to gl_state_.max_combined_texture_image_units. | 751 // 0 to gl_state_.max_combined_texture_image_units. |
752 GLuint active_texture_unit_; | 752 GLuint active_texture_unit_; |
753 | 753 |
754 GLuint bound_framebuffer_; | 754 GLuint bound_framebuffer_; |
755 GLuint bound_read_framebuffer_; | 755 GLuint bound_read_framebuffer_; |
756 GLuint bound_renderbuffer_; | 756 GLuint bound_renderbuffer_; |
757 GLuint bound_valuebuffer_; | 757 GLuint bound_valuebuffer_; |
758 | 758 |
759 // The program in use by glUseProgram | 759 // The program in use by glUseProgram |
760 GLuint current_program_; | 760 GLuint current_program_; |
761 | 761 |
762 GLuint bound_array_buffer_; | 762 GLuint bound_array_buffer_; |
763 GLuint bound_copy_read_buffer_; | 763 GLuint bound_copy_read_buffer_; |
764 GLuint bound_copy_write_buffer_; | 764 GLuint bound_copy_write_buffer_; |
765 GLuint bound_pixel_pack_buffer_; | 765 GLuint bound_pixel_pack_buffer_; |
766 GLuint bound_pixel_unpack_buffer_; | 766 GLuint bound_pixel_unpack_buffer_; |
767 GLuint bound_transform_feedback_buffer_; | 767 GLuint bound_transform_feedback_buffer_; |
768 GLuint bound_uniform_buffer_; | 768 GLuint bound_uniform_buffer_; |
769 | 769 |
770 // The currently bound pixel transfer buffers. | 770 // The currently bound pixel transfer buffers. |
771 GLuint bound_pixel_pack_transfer_buffer_id_; | 771 GLuint bound_pixel_pack_transfer_buffer_id_; |
772 GLuint bound_pixel_unpack_transfer_buffer_id_; | 772 GLuint bound_pixel_unpack_transfer_buffer_id_; |
773 | 773 |
774 // Client side management for vertex array objects. Needed to correctly | 774 // Client side management for vertex array objects. Needed to correctly |
775 // track client side arrays. | 775 // track client side arrays. |
776 scoped_ptr<VertexArrayObjectManager> vertex_array_object_manager_; | 776 std::unique_ptr<VertexArrayObjectManager> vertex_array_object_manager_; |
777 | 777 |
778 GLuint reserved_ids_[2]; | 778 GLuint reserved_ids_[2]; |
779 | 779 |
780 // Current GL error bits. | 780 // Current GL error bits. |
781 uint32_t error_bits_; | 781 uint32_t error_bits_; |
782 | 782 |
783 // Whether or not to print debugging info. | 783 // Whether or not to print debugging info. |
784 bool debug_; | 784 bool debug_; |
785 | 785 |
786 // When true, the context is lost when a GL_OUT_OF_MEMORY error occurs. | 786 // When true, the context is lost when a GL_OUT_OF_MEMORY error occurs. |
(...skipping 21 matching lines...) Expand all Loading... |
808 typedef std::map<const void*, MappedBuffer> MappedBufferMap; | 808 typedef std::map<const void*, MappedBuffer> MappedBufferMap; |
809 MappedBufferMap mapped_buffers_; | 809 MappedBufferMap mapped_buffers_; |
810 | 810 |
811 // TODO(zmo): Consolidate |mapped_buffers_| and |mapped_buffer_range_map_|. | 811 // TODO(zmo): Consolidate |mapped_buffers_| and |mapped_buffer_range_map_|. |
812 typedef base::hash_map<GLuint, MappedBuffer> MappedBufferRangeMap; | 812 typedef base::hash_map<GLuint, MappedBuffer> MappedBufferRangeMap; |
813 MappedBufferRangeMap mapped_buffer_range_map_; | 813 MappedBufferRangeMap mapped_buffer_range_map_; |
814 | 814 |
815 typedef std::map<const void*, MappedTexture> MappedTextureMap; | 815 typedef std::map<const void*, MappedTexture> MappedTextureMap; |
816 MappedTextureMap mapped_textures_; | 816 MappedTextureMap mapped_textures_; |
817 | 817 |
818 scoped_ptr<MappedMemoryManager> mapped_memory_; | 818 std::unique_ptr<MappedMemoryManager> mapped_memory_; |
819 | 819 |
820 scoped_refptr<ShareGroup> share_group_; | 820 scoped_refptr<ShareGroup> share_group_; |
821 ShareGroupContextData share_group_context_data_; | 821 ShareGroupContextData share_group_context_data_; |
822 | 822 |
823 scoped_ptr<QueryTracker> query_tracker_; | 823 std::unique_ptr<QueryTracker> query_tracker_; |
824 scoped_ptr<IdAllocator> query_id_allocator_; | 824 std::unique_ptr<IdAllocator> query_id_allocator_; |
825 | 825 |
826 scoped_ptr<BufferTracker> buffer_tracker_; | 826 std::unique_ptr<BufferTracker> buffer_tracker_; |
827 | 827 |
828 GLES2ImplementationErrorMessageCallback* error_message_callback_; | 828 GLES2ImplementationErrorMessageCallback* error_message_callback_; |
829 | 829 |
830 int current_trace_stack_; | 830 int current_trace_stack_; |
831 | 831 |
832 GpuControl* gpu_control_; | 832 GpuControl* gpu_control_; |
833 | 833 |
834 Capabilities capabilities_; | 834 Capabilities capabilities_; |
835 | 835 |
836 // Flag to indicate whether the implementation can retain resources, or | 836 // Flag to indicate whether the implementation can retain resources, or |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 | 887 |
888 inline bool GLES2Implementation::GetTexParameterivHelper( | 888 inline bool GLES2Implementation::GetTexParameterivHelper( |
889 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 889 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
890 return false; | 890 return false; |
891 } | 891 } |
892 | 892 |
893 } // namespace gles2 | 893 } // namespace gles2 |
894 } // namespace gpu | 894 } // namespace gpu |
895 | 895 |
896 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 896 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
OLD | NEW |