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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 110863003: skia: Use discardable memory for scaled image cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use SkGraphics::SetImageCacheByteLimit instead of SkScaledImageCache::SetByteLimit. Created 6 years, 11 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 | skia/skia_common.gypi » ('j') | 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 5e8db708edbb397c655e02f4a414fad57bd1aaff..f2c5879df9e3c267891379e60de642826bba4bcf 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -26,6 +26,7 @@
#include "base/threading/thread_local.h"
#include "base/threading/thread_restrictions.h"
#include "base/values.h"
+#include "cc/base/switches.h"
#include "content/child/appcache/appcache_dispatcher.h"
#include "content/child/appcache/appcache_frontend_impl.h"
#include "content/child/child_histogram_message_filter.h"
@@ -719,6 +720,19 @@ void RenderThreadImpl::EnsureWebKitInitialized() {
ScheduleIdleHandler(kLongIdleHandlerDelayMs);
webkit::SetSharedMemoryAllocationFunction(AllocateSharedMemoryFunction);
+
+ // Limit use of the scaled image cache to when deferred image decoding
+ // is enabled.
+ // TODO(reveman): Allow use of this cache on Android once
+ // SkDiscardablePixelRef is used for decoded images. crbug.com/330041
+ bool use_skia_scaled_image_cache = false;
+#if !defined(OS_ANDROID)
+ use_skia_scaled_image_cache =
+ command_line.HasSwitch(switches::kEnableDeferredImageDecoding) ||
+ cc::switches::IsImplSidePaintingEnabled();
+#endif
+ if (!use_skia_scaled_image_cache)
+ SkGraphics::SetImageCacheByteLimit(0u);
}
void RenderThreadImpl::RegisterSchemes() {
« no previous file with comments | « no previous file | skia/skia_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698