OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CC_RESOURCES_RESOURCE_PROVIDER_H_ | 5 #ifndef CC_RESOURCES_RESOURCE_PROVIDER_H_ |
6 #define CC_RESOURCES_RESOURCE_PROVIDER_H_ | 6 #define CC_RESOURCES_RESOURCE_PROVIDER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 namespace gpu { | 46 namespace gpu { |
47 class GpuMemoryBufferManager; | 47 class GpuMemoryBufferManager; |
48 namespace gles { | 48 namespace gles { |
49 class GLES2Interface; | 49 class GLES2Interface; |
50 } | 50 } |
51 } | 51 } |
52 | 52 |
53 namespace cc { | 53 namespace cc { |
54 class BlockingTaskRunner; | 54 class BlockingTaskRunner; |
55 class IdAllocator; | |
56 class SharedBitmap; | 55 class SharedBitmap; |
57 class SharedBitmapManager; | 56 class SharedBitmapManager; |
| 57 class TextureIdAllocator; |
58 | 58 |
59 // This class is not thread-safe and can only be called from the thread it was | 59 // This class is not thread-safe and can only be called from the thread it was |
60 // created on (in practice, the impl thread). | 60 // created on (in practice, the impl thread). |
61 class CC_EXPORT ResourceProvider | 61 class CC_EXPORT ResourceProvider |
62 : public base::trace_event::MemoryDumpProvider { | 62 : public base::trace_event::MemoryDumpProvider { |
63 private: | 63 private: |
64 struct Resource; | 64 struct Resource; |
65 | 65 |
66 public: | 66 public: |
67 using ResourceIdArray = std::vector<ResourceId>; | 67 using ResourceIdArray = std::vector<ResourceId>; |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 ContextProvider* compositor_context_provider_; | 750 ContextProvider* compositor_context_provider_; |
751 SharedBitmapManager* shared_bitmap_manager_; | 751 SharedBitmapManager* shared_bitmap_manager_; |
752 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 752 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
753 BlockingTaskRunner* blocking_main_thread_task_runner_; | 753 BlockingTaskRunner* blocking_main_thread_task_runner_; |
754 bool lost_context_provider_; | 754 bool lost_context_provider_; |
755 ResourceId next_id_; | 755 ResourceId next_id_; |
756 ResourceMap resources_; | 756 ResourceMap resources_; |
757 int next_child_; | 757 int next_child_; |
758 ChildMap children_; | 758 ChildMap children_; |
759 scoped_refptr<Fence> current_read_lock_fence_; | 759 scoped_refptr<Fence> current_read_lock_fence_; |
760 std::unique_ptr<IdAllocator> texture_id_allocator_; | 760 std::unique_ptr<TextureIdAllocator> texture_id_allocator_; |
761 std::unique_ptr<IdAllocator> buffer_id_allocator_; | |
762 BufferToTextureTargetMap buffer_to_texture_target_map_; | 761 BufferToTextureTargetMap buffer_to_texture_target_map_; |
763 | 762 |
764 base::ThreadChecker thread_checker_; | 763 base::ThreadChecker thread_checker_; |
765 | 764 |
766 // A process-unique ID used for disambiguating memory dumps from different | 765 // A process-unique ID used for disambiguating memory dumps from different |
767 // resource providers. | 766 // resource providers. |
768 int tracing_id_; | 767 int tracing_id_; |
769 | 768 |
770 #if defined(OS_ANDROID) | 769 #if defined(OS_ANDROID) |
771 // Set of resource Ids that would like to be notified about promotion hints. | 770 // Set of resource Ids that would like to be notified about promotion hints. |
772 ResourceIdSet wants_promotion_hints_set_; | 771 ResourceIdSet wants_promotion_hints_set_; |
773 #endif | 772 #endif |
774 | 773 |
775 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 774 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
776 }; | 775 }; |
777 | 776 |
778 } // namespace cc | 777 } // namespace cc |
779 | 778 |
780 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 779 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |