diff options
author | Mike Reed <reed@google.com> | 2009-11-06 14:14:26 -0500 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2009-11-06 14:15:51 -0500 |
commit | 68a4b61d4e32c8e45ba4bbf18125c7b1cea20668 (patch) | |
tree | 4c7500d73255e01c1524f7665b009fc8e129be9d /WebCore/platform/graphics | |
parent | 7b1ba95f7d592009a5674bbc38e3af9ee83a796a (diff) | |
download | external_webkit-68a4b61d4e32c8e45ba4bbf18125c7b1cea20668.zip external_webkit-68a4b61d4e32c8e45ba4bbf18125c7b1cea20668.tar.gz external_webkit-68a4b61d4e32c8e45ba4bbf18125c7b1cea20668.tar.bz2 |
up our max ram value before subsampling in the decoder
http://b/issue?id=2236822
todo: find a system-wide compile-flag to trigger off of
Diffstat (limited to 'WebCore/platform/graphics')
-rw-r--r-- | WebCore/platform/graphics/android/ImageSourceAndroid.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/WebCore/platform/graphics/android/ImageSourceAndroid.cpp b/WebCore/platform/graphics/android/ImageSourceAndroid.cpp index fc3b098..43facd5 100644 --- a/WebCore/platform/graphics/android/ImageSourceAndroid.cpp +++ b/WebCore/platform/graphics/android/ImageSourceAndroid.cpp @@ -37,6 +37,12 @@ #include "SkStream.h" #include "SkTemplates.h" +// need a flag to tell us when we're on a large-ram device (e.g. >= 256M) +// for now just use this hack +#if 1 + #define ON_LARGE_RAM_DEVICE +#endif + #ifdef ANDROID_ANIMATED_GIF #include "EmojiFont.h" #include "gif/GIFImageDecoder.h" @@ -52,9 +58,17 @@ SkPixelRef* SkCreateRLEPixelRef(const SkBitmap& src); //#define TRACE_RLE_BITMAPS -// don't use RLE for images smaller than this, since they incur a drawing cost -// (and don't work as patterns yet) we only want to use RLE when we must -#define MIN_RLE_ALLOC_SIZE (2*1024*1024) +#ifdef ON_LARGE_RAM_DEVICE + // don't use RLE for images smaller than this, since they incur a drawing cost + // (and don't work as patterns yet) we only want to use RLE when we must + #define MIN_RLE_ALLOC_SIZE (8*1024*1024) + + // see dox for computeMaxBitmapSizeForCache() + #define MAX_SIZE_BEFORE_SUBSAMPLE (8*1024*1024) +#else + #define MIN_RLE_ALLOC_SIZE (2*1024*1024) + #define MAX_SIZE_BEFORE_SUBSAMPLE (2*1024*1024) +#endif /* Images larger than this should be subsampled. Using ashmem, the decoded pixels will be purged as needed, so this value can be pretty large. Making @@ -67,7 +81,7 @@ SkPixelRef* SkCreateRLEPixelRef(const SkBitmap& src); Perhaps this value should be some fraction of the available RAM... */ static size_t computeMaxBitmapSizeForCache() { - return 2*1024*1024; + return MAX_SIZE_BEFORE_SUBSAMPLE; } /* 8bit images larger than this should be recompressed in RLE, to reduce |