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()); |