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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 397193002: Set ImageCacheSingleAllocationByteLimit to 64MB (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: response to revman comments Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 2666e22569efc3bcd3e2734e6b0c86c57610e0ac..a164643292d5e4315098a59a369f452d022dfa6c 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -172,6 +172,12 @@ const int kIdleCPUUsageThresholdInPercents = 3;
const int kMinRasterThreads = 1;
const int kMaxRasterThreads = 64;
+// Maximum allocation size allowed for image scaling filters that
+// require pre-scaling. Skia will fallback to a filter that doesn't
+// require pre-scaling if the default filter would require an
+// allocation that exceeds this limit.
+const size_t kImageCacheSingleAllocationByteLimit = 64 * 1024 * 1024;
+
// Keep the global RenderThreadImpl in a TLS slot so it is impossible to access
// incorrectly from the wrong thread.
base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> >
@@ -900,6 +906,9 @@ void RenderThreadImpl::EnsureWebKitInitialized() {
!is_impl_side_painting_enabled_)
SkGraphics::SetImageCacheByteLimit(0u);
+ SkGraphics::SetImageCacheSingleAllocationByteLimit(
+ kImageCacheSingleAllocationByteLimit);
+
if (command_line.HasSwitch(switches::kMemoryMetrics)) {
memory_observer_.reset(new MemoryObserver());
message_loop()->AddTaskObserver(memory_observer_.get());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698