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

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

Issue 2631453002: Revert of cc: Add image decode queue functionality to image manager. (Closed)
Patch Set: 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)
35 : TileManager(client, 34 : TileManager(client,
36 base::ThreadTaskRunnerHandle::Get().get(), 35 base::ThreadTaskRunnerHandle::Get().get(),
37 nullptr,
38 std::numeric_limits<size_t>::max(), 36 std::numeric_limits<size_t>::max(),
39 false /* use_partial_raster */, 37 false /* use_partial_raster */,
40 false /* check_tile_priority_inversion */), 38 false /* check_tile_priority_inversion */),
41 image_decode_cache_( 39 image_decode_cache_(
42 ResourceFormat::RGBA_8888, 40 ResourceFormat::RGBA_8888,
43 LayerTreeSettings().software_decoded_image_budget_bytes) { 41 LayerTreeSettings().software_decoded_image_budget_bytes) {
44 SetDecodedImageTracker(&decoded_image_tracker_); 42 SetResources(
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) {
45 SetResources(resource_pool, &image_decode_cache_, 59 SetResources(resource_pool, &image_decode_cache_,
46 g_synchronous_task_graph_runner.Pointer(), 60 g_synchronous_task_graph_runner.Pointer(),
47 g_fake_raster_buffer_provider.Pointer(), 61 g_fake_raster_buffer_provider.Pointer(),
48 std::numeric_limits<size_t>::max(), 62 std::numeric_limits<size_t>::max(),
49 false /* use_gpu_rasterization */); 63 false /* use_gpu_rasterization */);
50 SetTileTaskManagerForTesting(base::MakeUnique<FakeTileTaskManagerImpl>()); 64 SetTileTaskManagerForTesting(base::MakeUnique<FakeTileTaskManagerImpl>());
51 } 65 }
52 66
53 FakeTileManager::~FakeTileManager() {} 67 FakeTileManager::~FakeTileManager() {}
54 68
55 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { 69 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) {
56 return std::find(tiles_for_raster.begin(), 70 return std::find(tiles_for_raster.begin(),
57 tiles_for_raster.end(), 71 tiles_for_raster.end(),
58 tile) != tiles_for_raster.end(); 72 tile) != tiles_for_raster.end();
59 } 73 }
60 74
61 } // namespace cc 75 } // 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