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
3 // found in the LICENSE file.
5 #ifndef CC_TEST_FAKE_RESOURCE_PROVIDER_H_
6 #define CC_TEST_FAKE_RESOURCE_PROVIDER_H_
8 #include "cc/resources/resource_provider.h"
9 #include "ui/gfx/buffer_types.h"
13 class FakeResourceProvider
: public ResourceProvider
{
15 static scoped_ptr
<FakeResourceProvider
> Create(
16 OutputSurface
* output_surface
,
17 SharedBitmapManager
* shared_bitmap_manager
) {
18 scoped_ptr
<FakeResourceProvider
> provider(new FakeResourceProvider(
19 output_surface
, shared_bitmap_manager
, nullptr, nullptr, 0, false, 1,
21 std::vector
<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST
) + 1,
23 provider
->Initialize();
27 static scoped_ptr
<FakeResourceProvider
> Create(
28 OutputSurface
* output_surface
,
29 SharedBitmapManager
* shared_bitmap_manager
,
30 gpu::GpuMemoryBufferManager
* gpu_memory_buffer_manager
) {
31 scoped_ptr
<FakeResourceProvider
> provider(new FakeResourceProvider(
32 output_surface
, shared_bitmap_manager
, gpu_memory_buffer_manager
,
33 nullptr, 0, false, 1, false,
34 std::vector
<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST
) + 1,
36 provider
->Initialize();
41 FakeResourceProvider(OutputSurface
* output_surface
,
42 SharedBitmapManager
* shared_bitmap_manager
,
43 gpu::GpuMemoryBufferManager
* gpu_memory_buffer_manager
,
44 BlockingTaskRunner
* blocking_main_thread_task_runner
,
45 int highp_threshold_min
,
46 bool use_rgba_4444_texture_format
,
47 size_t id_allocation_chunk_size
,
48 bool use_persistent_map_for_gpu_memory_buffers
,
49 const std::vector
<unsigned>& use_image_texture_targets
)
50 : ResourceProvider(output_surface
,
51 shared_bitmap_manager
,
52 gpu_memory_buffer_manager
,
53 blocking_main_thread_task_runner
,
55 use_rgba_4444_texture_format
,
56 id_allocation_chunk_size
,
57 use_persistent_map_for_gpu_memory_buffers
,
58 use_image_texture_targets
) {}
63 #endif // CC_TEST_FAKE_RESOURCE_PROVIDER_H_