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

Unified Diff: cc/tiles/software_image_decode_controller.cc

Issue 1991363003: cc: Plumb gpu/sw image decode limits as layer tree settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/tiles/software_image_decode_controller.h ('k') | cc/tiles/software_image_decode_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/software_image_decode_controller.cc
diff --git a/cc/tiles/software_image_decode_controller.cc b/cc/tiles/software_image_decode_controller.cc
index e3c188d94398a50747ae0086da4aabfdc82a04a6..a9b239d04514ec2ab958a6498e44039f9f1919a5 100644
--- a/cc/tiles/software_image_decode_controller.cc
+++ b/cc/tiles/software_image_decode_controller.cc
@@ -27,11 +27,6 @@
namespace cc {
namespace {
-// The amount of memory we can lock ahead of time (128MB). This limit is only
-// used to inform the caller of the amount of space available in the cache. The
-// caller can still request tasks which can cause this limit to be breached.
-const size_t kLockedMemoryLimitBytes = 128 * 1024 * 1024;
-
// The largest single high quality image to try and process. Images above this
// size will drop down to medium quality.
const size_t kMaxHighQualityImageSizeBytes = 64 * 1024 * 1024;
@@ -185,10 +180,11 @@ void RecordLockExistingCachedImageHistogram(TilePriority::PriorityBin bin,
} // namespace
SoftwareImageDecodeController::SoftwareImageDecodeController(
- ResourceFormat format)
+ ResourceFormat format,
+ size_t locked_memory_limit_bytes)
: decoded_images_(ImageMRUCache::NO_AUTO_EVICT),
at_raster_decoded_images_(ImageMRUCache::NO_AUTO_EVICT),
- locked_images_budget_(kLockedMemoryLimitBytes),
+ locked_images_budget_(locked_memory_limit_bytes),
format_(format) {
// In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview).
// Don't register a dump provider in these cases.
@@ -199,9 +195,6 @@ SoftwareImageDecodeController::SoftwareImageDecodeController(
}
}
-SoftwareImageDecodeController::SoftwareImageDecodeController()
- : SoftwareImageDecodeController(RGBA_8888) {}
-
SoftwareImageDecodeController::~SoftwareImageDecodeController() {
DCHECK_EQ(0u, decoded_images_ref_counts_.size());
DCHECK_EQ(0u, at_raster_decoded_images_ref_counts_.size());
@@ -775,7 +768,7 @@ void SoftwareImageDecodeController::SanityCheckState(int line,
return;
}
- MemoryBudget budget(kLockedMemoryLimitBytes);
+ MemoryBudget budget(locked_images_budget_.total_limit_bytes());
for (const auto& image_pair : decoded_images_) {
const auto& key = image_pair.first;
const auto& image = image_pair.second;
« no previous file with comments | « cc/tiles/software_image_decode_controller.h ('k') | cc/tiles/software_image_decode_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698