diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-11-10 08:28:39 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-11-10 08:28:39 -0800 |
commit | af1255496788b347a21a5db0e63c011c992c83b8 (patch) | |
tree | bfd1b2db1370f734e4c5f8a2585686282b48d6cc /WebCore | |
parent | 472f92f6354c0482276d23b91d7679b2ea65652d (diff) | |
parent | 68a4b61d4e32c8e45ba4bbf18125c7b1cea20668 (diff) | |
download | external_webkit-af1255496788b347a21a5db0e63c011c992c83b8.zip external_webkit-af1255496788b347a21a5db0e63c011c992c83b8.tar.gz external_webkit-af1255496788b347a21a5db0e63c011c992c83b8.tar.bz2 |
Merge change I888150fd into eclair-mr2
* changes:
up our max ram value before subsampling in the decoder
Diffstat (limited to 'WebCore')
-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 |