Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: cc/test/fake_resource_provider.h

Issue 1336703002: Revert of Re-land: cc: Use worker context for one-copy tile initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/fake_output_surface.h ('k') | cc/test/layer_tree_pixel_resource_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/resources/resource_provider.h" 8 #include "cc/resources/resource_provider.h"
9 #include "ui/gfx/buffer_types.h" 9 #include "ui/gfx/buffer_types.h"
10 10
11 namespace cc { 11 namespace cc {
12 12
13 class FakeResourceProvider : public ResourceProvider { 13 class FakeResourceProvider : public ResourceProvider {
14 public: 14 public:
15 static scoped_ptr<FakeResourceProvider> Create( 15 static scoped_ptr<FakeResourceProvider> Create(
16 OutputSurface* output_surface, 16 OutputSurface* output_surface,
17 SharedBitmapManager* shared_bitmap_manager) { 17 SharedBitmapManager* shared_bitmap_manager) {
18 scoped_ptr<FakeResourceProvider> provider(new FakeResourceProvider( 18 scoped_ptr<FakeResourceProvider> provider(new FakeResourceProvider(
19 output_surface, shared_bitmap_manager, nullptr, nullptr, 0, false, 1, 19 output_surface, shared_bitmap_manager, nullptr, nullptr, 0, false, 1,
20 false,
20 std::vector<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST) + 1, 21 std::vector<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST) + 1,
21 GL_TEXTURE_2D))); 22 GL_TEXTURE_2D)));
22 provider->Initialize(); 23 provider->Initialize();
23 return provider; 24 return provider;
24 } 25 }
25 26
26 static scoped_ptr<FakeResourceProvider> Create( 27 static scoped_ptr<FakeResourceProvider> Create(
27 OutputSurface* output_surface, 28 OutputSurface* output_surface,
28 SharedBitmapManager* shared_bitmap_manager, 29 SharedBitmapManager* shared_bitmap_manager,
29 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { 30 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) {
30 scoped_ptr<FakeResourceProvider> provider(new FakeResourceProvider( 31 scoped_ptr<FakeResourceProvider> provider(new FakeResourceProvider(
31 output_surface, shared_bitmap_manager, gpu_memory_buffer_manager, 32 output_surface, shared_bitmap_manager, gpu_memory_buffer_manager,
32 nullptr, 0, false, 1, 33 nullptr, 0, false, 1, false,
33 std::vector<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST) + 1, 34 std::vector<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST) + 1,
34 GL_TEXTURE_2D))); 35 GL_TEXTURE_2D)));
35 provider->Initialize(); 36 provider->Initialize();
36 return provider; 37 return provider;
37 } 38 }
38 39
39 private: 40 private:
40 FakeResourceProvider(OutputSurface* output_surface, 41 FakeResourceProvider(OutputSurface* output_surface,
41 SharedBitmapManager* shared_bitmap_manager, 42 SharedBitmapManager* shared_bitmap_manager,
42 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 43 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
43 BlockingTaskRunner* blocking_main_thread_task_runner, 44 BlockingTaskRunner* blocking_main_thread_task_runner,
44 int highp_threshold_min, 45 int highp_threshold_min,
45 bool use_rgba_4444_texture_format, 46 bool use_rgba_4444_texture_format,
46 size_t id_allocation_chunk_size, 47 size_t id_allocation_chunk_size,
48 bool use_persistent_map_for_gpu_memory_buffers,
47 const std::vector<unsigned>& use_image_texture_targets) 49 const std::vector<unsigned>& use_image_texture_targets)
48 : ResourceProvider(output_surface, 50 : ResourceProvider(output_surface,
49 shared_bitmap_manager, 51 shared_bitmap_manager,
50 gpu_memory_buffer_manager, 52 gpu_memory_buffer_manager,
51 blocking_main_thread_task_runner, 53 blocking_main_thread_task_runner,
52 highp_threshold_min, 54 highp_threshold_min,
53 use_rgba_4444_texture_format, 55 use_rgba_4444_texture_format,
54 id_allocation_chunk_size, 56 id_allocation_chunk_size,
57 use_persistent_map_for_gpu_memory_buffers,
55 use_image_texture_targets) {} 58 use_image_texture_targets) {}
56 }; 59 };
57 60
58 } // namespace cc 61 } // namespace cc
59 62
60 #endif // CC_TEST_FAKE_RESOURCE_PROVIDER_H_ 63 #endif // CC_TEST_FAKE_RESOURCE_PROVIDER_H_
OLDNEW
« no previous file with comments | « cc/test/fake_output_surface.h ('k') | cc/test/layer_tree_pixel_resource_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698