cc: Use worker context for one-copy tile initialization.
[chromium-blink-merge.git] / cc / test / fake_resource_provider.h
blob5570703922c0107530bd490bced38190ebc10b2c
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"
10 namespace cc {
12 class FakeResourceProvider : public ResourceProvider {
13 public:
14 static scoped_ptr<FakeResourceProvider> Create(
15 OutputSurface* output_surface,
16 SharedBitmapManager* shared_bitmap_manager) {
17 scoped_ptr<FakeResourceProvider> provider(new FakeResourceProvider(
18 output_surface, shared_bitmap_manager, nullptr, nullptr, 0, false, 1));
19 provider->Initialize();
20 return provider;
23 static scoped_ptr<FakeResourceProvider> Create(
24 OutputSurface* output_surface,
25 SharedBitmapManager* shared_bitmap_manager,
26 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) {
27 scoped_ptr<FakeResourceProvider> provider(new FakeResourceProvider(
28 output_surface, shared_bitmap_manager, gpu_memory_buffer_manager,
29 nullptr, 0, false, 1));
30 provider->Initialize();
31 return provider;
34 private:
35 FakeResourceProvider(OutputSurface* output_surface,
36 SharedBitmapManager* shared_bitmap_manager,
37 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
38 BlockingTaskRunner* blocking_main_thread_task_runner,
39 int highp_threshold_min,
40 bool use_rgba_4444_texture_format,
41 size_t id_allocation_chunk_size)
42 : ResourceProvider(output_surface,
43 shared_bitmap_manager,
44 gpu_memory_buffer_manager,
45 blocking_main_thread_task_runner,
46 highp_threshold_min,
47 use_rgba_4444_texture_format,
48 id_allocation_chunk_size) {}
51 } // namespace cc
53 #endif // CC_TEST_FAKE_RESOURCE_PROVIDER_H_