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 <deque> | 8 #include <deque> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 ResourceType default_resource_type() const { return default_resource_type_; } | 117 ResourceType default_resource_type() const { return default_resource_type_; } |
118 ResourceType GetResourceType(ResourceId id); | 118 ResourceType GetResourceType(ResourceId id); |
119 | 119 |
120 // Creates a resource of the default resource type. | 120 // Creates a resource of the default resource type. |
121 ResourceId CreateResource(const gfx::Size& size, | 121 ResourceId CreateResource(const gfx::Size& size, |
122 TextureHint hint, | 122 TextureHint hint, |
123 ResourceFormat format); | 123 ResourceFormat format); |
124 | 124 |
125 // Creates a resource for a particular texture target (the distinction between | 125 // Creates a resource for a particular texture target (the distinction between |
126 // texture targets has no effect in software mode). | 126 // texture targets has no effect in software mode). |
127 ResourceId CreateManagedResource(const gfx::Size& size, | 127 ResourceId CreateResourceWithTextureTarget(const gfx::Size& size, |
128 GLenum target, | 128 GLenum target, |
129 TextureHint hint, | 129 TextureHint hint, |
130 ResourceFormat format); | 130 ResourceFormat format); |
131 | 131 |
132 // You can also explicitly create a specific resource type. | |
133 ResourceId CreateGLTexture(const gfx::Size& size, | |
134 GLenum target, | |
135 TextureHint hint, | |
136 ResourceFormat format); | |
137 | |
138 ResourceId CreateBitmap(const gfx::Size& size); | |
139 // Wraps an IOSurface into a GL resource. | 132 // Wraps an IOSurface into a GL resource. |
140 ResourceId CreateResourceFromIOSurface(const gfx::Size& size, | 133 ResourceId CreateResourceFromIOSurface(const gfx::Size& size, |
141 unsigned io_surface_id); | 134 unsigned io_surface_id); |
142 | 135 |
143 // Wraps an external texture mailbox into a GL resource. | 136 // Wraps an external texture mailbox into a GL resource. |
144 ResourceId CreateResourceFromTextureMailbox( | 137 ResourceId CreateResourceFromTextureMailbox( |
145 const TextureMailbox& mailbox, | 138 const TextureMailbox& mailbox, |
146 scoped_ptr<SingleReleaseCallbackImpl> release_callback_impl); | 139 scoped_ptr<SingleReleaseCallbackImpl> release_callback_impl); |
147 | 140 |
148 ResourceId CreateResourceFromTextureMailbox( | 141 ResourceId CreateResourceFromTextureMailbox( |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
439 protected: | 432 protected: |
440 ResourceProvider(OutputSurface* output_surface, | 433 ResourceProvider(OutputSurface* output_surface, |
441 SharedBitmapManager* shared_bitmap_manager, | 434 SharedBitmapManager* shared_bitmap_manager, |
442 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 435 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
443 BlockingTaskRunner* blocking_main_thread_task_runner, | 436 BlockingTaskRunner* blocking_main_thread_task_runner, |
444 int highp_threshold_min, | 437 int highp_threshold_min, |
445 size_t id_allocation_chunk_size, | 438 size_t id_allocation_chunk_size, |
446 const std::vector<unsigned>& use_image_texture_targets); | 439 const std::vector<unsigned>& use_image_texture_targets); |
447 void Initialize(); | 440 void Initialize(); |
448 | 441 |
442 ResourceId CreateGLTexture(const gfx::Size& size, | |
danakj
2015/10/28 20:07:08
You said private but these are protected, how come
ccameron
2015/10/28 20:12:43
Oop. Fxied.
| |
443 GLenum target, | |
444 TextureHint hint, | |
445 ResourceFormat format); | |
446 | |
447 ResourceId CreateBitmap(const gfx::Size& size); | |
448 | |
449 private: | 449 private: |
450 struct Resource { | 450 struct Resource { |
451 enum Origin { INTERNAL, EXTERNAL, DELEGATED }; | 451 enum Origin { INTERNAL, EXTERNAL, DELEGATED }; |
452 | 452 |
453 ~Resource(); | 453 ~Resource(); |
454 Resource(unsigned texture_id, | 454 Resource(unsigned texture_id, |
455 const gfx::Size& size, | 455 const gfx::Size& size, |
456 Origin origin, | 456 Origin origin, |
457 GLenum target, | 457 GLenum target, |
458 GLenum filter, | 458 GLenum filter, |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
595 // A process-unique ID used for disambiguating memory dumps from different | 595 // A process-unique ID used for disambiguating memory dumps from different |
596 // resource providers. | 596 // resource providers. |
597 int tracing_id_; | 597 int tracing_id_; |
598 | 598 |
599 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 599 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
600 }; | 600 }; |
601 | 601 |
602 } // namespace cc | 602 } // namespace cc |
603 | 603 |
604 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 604 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |