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 15 matching lines...) Expand all Loading... |
26 #include "cc/resources/return_callback.h" | 26 #include "cc/resources/return_callback.h" |
27 #include "cc/resources/shared_bitmap.h" | 27 #include "cc/resources/shared_bitmap.h" |
28 #include "cc/resources/single_release_callback_impl.h" | 28 #include "cc/resources/single_release_callback_impl.h" |
29 #include "cc/resources/texture_mailbox.h" | 29 #include "cc/resources/texture_mailbox.h" |
30 #include "cc/resources/transferable_resource.h" | 30 #include "cc/resources/transferable_resource.h" |
31 #include "third_party/khronos/GLES2/gl2.h" | 31 #include "third_party/khronos/GLES2/gl2.h" |
32 #include "third_party/khronos/GLES2/gl2ext.h" | 32 #include "third_party/khronos/GLES2/gl2ext.h" |
33 #include "third_party/skia/include/core/SkBitmap.h" | 33 #include "third_party/skia/include/core/SkBitmap.h" |
34 #include "third_party/skia/include/core/SkCanvas.h" | 34 #include "third_party/skia/include/core/SkCanvas.h" |
35 #include "ui/gfx/geometry/size.h" | 35 #include "ui/gfx/geometry/size.h" |
| 36 #include "ui/gfx/gpu_memory_buffer.h" |
36 | 37 |
37 class GrContext; | 38 class GrContext; |
38 | 39 |
39 namespace gpu { | 40 namespace gpu { |
40 class GpuMemoryBufferManager; | 41 class GpuMemoryBufferManager; |
41 namespace gles { | 42 namespace gles { |
42 class GLES2Interface; | 43 class GLES2Interface; |
43 } | 44 } |
44 } | 45 } |
45 | 46 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 OutputSurface* output_surface, | 82 OutputSurface* output_surface, |
82 SharedBitmapManager* shared_bitmap_manager, | 83 SharedBitmapManager* shared_bitmap_manager, |
83 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 84 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
84 BlockingTaskRunner* blocking_main_thread_task_runner, | 85 BlockingTaskRunner* blocking_main_thread_task_runner, |
85 int highp_threshold_min, | 86 int highp_threshold_min, |
86 bool use_rgba_4444_texture_format, | 87 bool use_rgba_4444_texture_format, |
87 size_t id_allocation_chunk_size, | 88 size_t id_allocation_chunk_size, |
88 bool use_persistent_map_for_gpu_memory_buffers); | 89 bool use_persistent_map_for_gpu_memory_buffers); |
89 virtual ~ResourceProvider(); | 90 virtual ~ResourceProvider(); |
90 | 91 |
| 92 static gfx::GpuMemoryBuffer::Format ToGpuMemoryBufferFormat( |
| 93 ResourceFormat format); |
| 94 |
91 void DidLoseOutputSurface() { lost_output_surface_ = true; } | 95 void DidLoseOutputSurface() { lost_output_surface_ = true; } |
92 | 96 |
93 int max_texture_size() const { return max_texture_size_; } | 97 int max_texture_size() const { return max_texture_size_; } |
94 ResourceFormat memory_efficient_texture_format() const { | 98 ResourceFormat memory_efficient_texture_format() const { |
95 return use_rgba_4444_texture_format_ ? RGBA_4444 : best_texture_format_; | 99 return use_rgba_4444_texture_format_ ? RGBA_4444 : best_texture_format_; |
96 } | 100 } |
97 ResourceFormat best_texture_format() const { return best_texture_format_; } | 101 ResourceFormat best_texture_format() const { return best_texture_format_; } |
98 ResourceFormat best_render_buffer_format() const { | 102 ResourceFormat best_render_buffer_format() const { |
99 return best_render_buffer_format_; | 103 return best_render_buffer_format_; |
100 } | 104 } |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 return format_gl_data_format[format]; | 662 return format_gl_data_format[format]; |
659 } | 663 } |
660 | 664 |
661 inline GLenum GLInternalFormat(ResourceFormat format) { | 665 inline GLenum GLInternalFormat(ResourceFormat format) { |
662 return GLDataFormat(format); | 666 return GLDataFormat(format); |
663 } | 667 } |
664 | 668 |
665 } // namespace cc | 669 } // namespace cc |
666 | 670 |
667 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 671 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |