OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_TEST_FAKE_RESOURCE_PROVIDER_H_ | 5 #ifndef CC_TEST_FAKE_RESOURCE_PROVIDER_H_ |
6 #define CC_TEST_FAKE_RESOURCE_PROVIDER_H_ | 6 #define CC_TEST_FAKE_RESOURCE_PROVIDER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "cc/output/buffer_to_texture_target_map.h" | 11 #include "cc/output/buffer_to_texture_target_map.h" |
12 #include "cc/output/renderer_settings.h" | 12 #include "cc/output/renderer_settings.h" |
13 #include "cc/resources/resource_provider.h" | 13 #include "cc/resources/resource_provider.h" |
14 #include "ui/gfx/buffer_types.h" | 14 #include "ui/gfx/buffer_types.h" |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 | 17 |
18 class FakeResourceProvider : public ResourceProvider { | 18 class FakeResourceProvider : public ResourceProvider { |
19 public: | 19 public: |
20 static std::unique_ptr<FakeResourceProvider> Create( | 20 static std::unique_ptr<FakeResourceProvider> Create( |
21 OutputSurface* output_surface, | 21 ContextProvider* context_provider, |
22 SharedBitmapManager* shared_bitmap_manager) { | 22 SharedBitmapManager* shared_bitmap_manager) { |
23 return base::WrapUnique(new FakeResourceProvider( | 23 return base::WrapUnique(new FakeResourceProvider( |
24 output_surface, shared_bitmap_manager, nullptr, nullptr, 0, 1, true, | 24 context_provider, shared_bitmap_manager, nullptr, nullptr, 0, 1, true, |
25 false, false, DefaultBufferToTextureTargetMapForTesting())); | 25 false, false, DefaultBufferToTextureTargetMapForTesting())); |
26 } | 26 } |
27 | 27 |
28 static std::unique_ptr<FakeResourceProvider> Create( | 28 static std::unique_ptr<FakeResourceProvider> Create( |
29 OutputSurface* output_surface, | 29 ContextProvider* context_provider, |
30 SharedBitmapManager* shared_bitmap_manager, | 30 SharedBitmapManager* shared_bitmap_manager, |
31 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { | 31 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { |
32 return base::WrapUnique(new FakeResourceProvider( | 32 return base::WrapUnique(new FakeResourceProvider( |
33 output_surface, shared_bitmap_manager, gpu_memory_buffer_manager, | 33 context_provider, shared_bitmap_manager, gpu_memory_buffer_manager, |
34 nullptr, 0, 1, true, false, false, | 34 nullptr, 0, 1, true, false, false, |
35 DefaultBufferToTextureTargetMapForTesting())); | 35 DefaultBufferToTextureTargetMapForTesting())); |
36 } | 36 } |
37 | 37 |
38 private: | 38 private: |
39 FakeResourceProvider( | 39 FakeResourceProvider( |
40 OutputSurface* output_surface, | 40 ContextProvider* context_provider, |
41 SharedBitmapManager* shared_bitmap_manager, | 41 SharedBitmapManager* shared_bitmap_manager, |
42 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 42 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
43 BlockingTaskRunner* blocking_main_thread_task_runner, | 43 BlockingTaskRunner* blocking_main_thread_task_runner, |
44 int highp_threshold_min, | 44 int highp_threshold_min, |
45 size_t id_allocation_chunk_size, | 45 size_t id_allocation_chunk_size, |
46 bool delegated_sync_points_required, | 46 bool delegated_sync_points_required, |
47 bool use_gpu_memory_buffer_resources, | 47 bool use_gpu_memory_buffer_resources, |
48 bool enable_color_correct_rendering, | 48 bool enable_color_correct_rendering, |
49 const BufferToTextureTargetMap& buffer_to_texture_target_map) | 49 const BufferToTextureTargetMap& buffer_to_texture_target_map) |
50 : ResourceProvider(output_surface->context_provider(), // TODO(danakj): | 50 : ResourceProvider(context_provider, |
51 // Remove output | |
52 // surface dep | |
53 shared_bitmap_manager, | 51 shared_bitmap_manager, |
54 gpu_memory_buffer_manager, | 52 gpu_memory_buffer_manager, |
55 blocking_main_thread_task_runner, | 53 blocking_main_thread_task_runner, |
56 highp_threshold_min, | 54 highp_threshold_min, |
57 id_allocation_chunk_size, | 55 id_allocation_chunk_size, |
58 delegated_sync_points_required, | 56 delegated_sync_points_required, |
59 use_gpu_memory_buffer_resources, | 57 use_gpu_memory_buffer_resources, |
60 enable_color_correct_rendering, | 58 enable_color_correct_rendering, |
61 buffer_to_texture_target_map) {} | 59 buffer_to_texture_target_map) {} |
62 }; | 60 }; |
63 | 61 |
64 } // namespace cc | 62 } // namespace cc |
65 | 63 |
66 #endif // CC_TEST_FAKE_RESOURCE_PROVIDER_H_ | 64 #endif // CC_TEST_FAKE_RESOURCE_PROVIDER_H_ |
OLD | NEW |