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

Unified Diff: cc/tiles/gpu_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/gpu_image_decode_controller.h ('k') | cc/tiles/gpu_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/gpu_image_decode_controller.cc
diff --git a/cc/tiles/gpu_image_decode_controller.cc b/cc/tiles/gpu_image_decode_controller.cc
index 69f8b56454aed2fdd6377afd02eb976c4653315e..e64c9230b2af896ae994b65c200a3ead761191b1 100644
--- a/cc/tiles/gpu_image_decode_controller.cc
+++ b/cc/tiles/gpu_image_decode_controller.cc
@@ -27,7 +27,6 @@
namespace cc {
namespace {
-static const int kMaxGpuImageBytes = 1024 * 1024 * 96;
static const int kMaxDiscardableItems = 2000;
// Returns true if an image would not be drawn and should therefore be
@@ -153,13 +152,15 @@ GpuImageDecodeController::ImageData::ImageData(DecodedDataMode mode,
GpuImageDecodeController::ImageData::~ImageData() = default;
GpuImageDecodeController::GpuImageDecodeController(ContextProvider* context,
- ResourceFormat decode_format)
+ ResourceFormat decode_format,
+ size_t max_gpu_image_bytes)
: format_(decode_format),
context_(context),
image_data_(ImageDataMRUCache::NO_AUTO_EVICT),
cached_items_limit_(kMaxDiscardableItems),
- cached_bytes_limit_(kMaxGpuImageBytes),
- bytes_used_(0) {
+ cached_bytes_limit_(max_gpu_image_bytes),
+ bytes_used_(0),
+ max_gpu_image_bytes_(max_gpu_image_bytes) {
// Acquire the context_lock so that we can safely retrieve the
// GrContextThreadSafeProxy. This proxy can then be used with no lock held.
{
@@ -363,7 +364,7 @@ void GpuImageDecodeController::SetShouldAggressivelyFreeResources(
DeletePendingImages();
} else {
base::AutoLock lock(lock_);
- cached_bytes_limit_ = kMaxGpuImageBytes;
+ cached_bytes_limit_ = max_gpu_image_bytes_;
}
}
« no previous file with comments | « cc/tiles/gpu_image_decode_controller.h ('k') | cc/tiles/gpu_image_decode_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698