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

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

Issue 2780843002: Split image decode cache limits into "working set" vs "cache" limits (Closed)
Patch Set: comments Created 3 years, 8 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/raster/raster_source_unittest.cc ('k') | cc/tiles/gpu_image_decode_cache.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 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 25 matching lines...) Expand all
36 36
37 FakeTileManager::FakeTileManager(TileManagerClient* client, 37 FakeTileManager::FakeTileManager(TileManagerClient* client,
38 ResourcePool* resource_pool) 38 ResourcePool* resource_pool)
39 : TileManager(client, 39 : TileManager(client,
40 base::ThreadTaskRunnerHandle::Get().get(), 40 base::ThreadTaskRunnerHandle::Get().get(),
41 nullptr, 41 nullptr,
42 std::numeric_limits<size_t>::max(), 42 std::numeric_limits<size_t>::max(),
43 TileManagerSettings()), 43 TileManagerSettings()),
44 image_decode_cache_( 44 image_decode_cache_(
45 ResourceFormat::RGBA_8888, 45 ResourceFormat::RGBA_8888,
46 LayerTreeSettings().software_decoded_image_budget_bytes) { 46 LayerTreeSettings().decoded_image_working_set_budget_bytes) {
47 SetDecodedImageTracker(&decoded_image_tracker_); 47 SetDecodedImageTracker(&decoded_image_tracker_);
48 SetResources(resource_pool, &image_decode_cache_, GetGlobalTaskGraphRunner(), 48 SetResources(resource_pool, &image_decode_cache_, GetGlobalTaskGraphRunner(),
49 GetGlobalRasterBufferProvider(), 49 GetGlobalRasterBufferProvider(),
50 std::numeric_limits<size_t>::max(), 50 std::numeric_limits<size_t>::max(),
51 false /* use_gpu_rasterization */); 51 false /* use_gpu_rasterization */);
52 SetTileTaskManagerForTesting(base::MakeUnique<FakeTileTaskManagerImpl>()); 52 SetTileTaskManagerForTesting(base::MakeUnique<FakeTileTaskManagerImpl>());
53 } 53 }
54 54
55 FakeTileManager::~FakeTileManager() {} 55 FakeTileManager::~FakeTileManager() {}
56 56
57 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { 57 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) {
58 return std::find(tiles_for_raster.begin(), 58 return std::find(tiles_for_raster.begin(),
59 tiles_for_raster.end(), 59 tiles_for_raster.end(),
60 tile) != tiles_for_raster.end(); 60 tile) != tiles_for_raster.end();
61 } 61 }
62 62
63 } // namespace cc 63 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/raster_source_unittest.cc ('k') | cc/tiles/gpu_image_decode_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698