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

Side by Side Diff: cc/test/fake_tile_manager.cc

Issue 2537683002: cc: Add image decode queue functionality to image manager. (Closed)
Patch Set: test fix Created 3 years, 11 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_tile_manager.h ('k') | cc/test/layer_tree_test.cc » ('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 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 #include "cc/test/fake_tile_manager.h" 5 #include "cc/test/fake_tile_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 12 matching lines...) Expand all
23 namespace { 23 namespace {
24 24
25 base::LazyInstance<SynchronousTaskGraphRunner> g_synchronous_task_graph_runner = 25 base::LazyInstance<SynchronousTaskGraphRunner> g_synchronous_task_graph_runner =
26 LAZY_INSTANCE_INITIALIZER; 26 LAZY_INSTANCE_INITIALIZER;
27 27
28 base::LazyInstance<FakeRasterBufferProviderImpl> g_fake_raster_buffer_provider = 28 base::LazyInstance<FakeRasterBufferProviderImpl> g_fake_raster_buffer_provider =
29 LAZY_INSTANCE_INITIALIZER; 29 LAZY_INSTANCE_INITIALIZER;
30 30
31 } // namespace 31 } // namespace
32 32
33 FakeTileManager::FakeTileManager(TileManagerClient* client) 33 FakeTileManager::FakeTileManager(TileManagerClient* client,
34 ResourcePool* resource_pool)
34 : TileManager(client, 35 : TileManager(client,
35 base::ThreadTaskRunnerHandle::Get().get(), 36 base::ThreadTaskRunnerHandle::Get().get(),
37 nullptr,
36 std::numeric_limits<size_t>::max(), 38 std::numeric_limits<size_t>::max(),
37 false /* use_partial_raster */, 39 false /* use_partial_raster */,
38 false /* check_tile_priority_inversion */), 40 false /* check_tile_priority_inversion */),
39 image_decode_cache_( 41 image_decode_cache_(
40 ResourceFormat::RGBA_8888, 42 ResourceFormat::RGBA_8888,
41 LayerTreeSettings().software_decoded_image_budget_bytes) { 43 LayerTreeSettings().software_decoded_image_budget_bytes) {
42 SetResources( 44 SetDecodedImageTracker(&decoded_image_tracker_);
43 nullptr, &image_decode_cache_, g_synchronous_task_graph_runner.Pointer(),
44 g_fake_raster_buffer_provider.Pointer(),
45 std::numeric_limits<size_t>::max(), false /* use_gpu_rasterization */);
46 SetTileTaskManagerForTesting(base::MakeUnique<FakeTileTaskManagerImpl>());
47 }
48
49 FakeTileManager::FakeTileManager(TileManagerClient* client,
50 ResourcePool* resource_pool)
51 : TileManager(client,
52 base::ThreadTaskRunnerHandle::Get().get(),
53 std::numeric_limits<size_t>::max(),
54 false /* use_partial_raster */,
55 false /* check_tile_priority_inversion */),
56 image_decode_cache_(
57 ResourceFormat::RGBA_8888,
58 LayerTreeSettings().software_decoded_image_budget_bytes) {
59 SetResources(resource_pool, &image_decode_cache_, 45 SetResources(resource_pool, &image_decode_cache_,
60 g_synchronous_task_graph_runner.Pointer(), 46 g_synchronous_task_graph_runner.Pointer(),
61 g_fake_raster_buffer_provider.Pointer(), 47 g_fake_raster_buffer_provider.Pointer(),
62 std::numeric_limits<size_t>::max(), 48 std::numeric_limits<size_t>::max(),
63 false /* use_gpu_rasterization */); 49 false /* use_gpu_rasterization */);
64 SetTileTaskManagerForTesting(base::MakeUnique<FakeTileTaskManagerImpl>()); 50 SetTileTaskManagerForTesting(base::MakeUnique<FakeTileTaskManagerImpl>());
65 } 51 }
66 52
67 FakeTileManager::~FakeTileManager() {} 53 FakeTileManager::~FakeTileManager() {}
68 54
69 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { 55 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) {
70 return std::find(tiles_for_raster.begin(), 56 return std::find(tiles_for_raster.begin(),
71 tiles_for_raster.end(), 57 tiles_for_raster.end(),
72 tile) != tiles_for_raster.end(); 58 tile) != tiles_for_raster.end();
73 } 59 }
74 60
75 } // namespace cc 61 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_tile_manager.h ('k') | cc/test/layer_tree_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698