summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni/WebSettings.cpp
diff options
context:
space:
mode:
authorShimeng (Simon) Wang <swang@google.com>2011-01-06 14:14:18 -0800
committerShimeng (Simon) Wang <swang@google.com>2011-01-06 14:14:18 -0800
commitc1416369812a7eeaebe4a39a2d3fc2ffab03139d (patch)
tree8ff5a71fc8aa248adb10044872bbf81f81bb2156 /WebKit/android/jni/WebSettings.cpp
parent4014a341b3afd6f880646b046088025ea1f07807 (diff)
downloadexternal_webkit-c1416369812a7eeaebe4a39a2d3fc2ffab03139d.zip
external_webkit-c1416369812a7eeaebe4a39a2d3fc2ffab03139d.tar.gz
external_webkit-c1416369812a7eeaebe4a39a2d3fc2ffab03139d.tar.bz2
Not set max decoded image size in WebCore.
Two reasons: 1. the image size will be limited in ImageSourceAndroid.cpp. 2. WebCore will do an estimation comparison against that max value, which will limit some good cases. For example, in the case of the following bug, the background image size is limited and good, but its estimation value in WebCore will exceed the max. issue: 3240499 Change-Id: I721c7565beb648dd83200d05e223012299997e04
Diffstat (limited to 'WebKit/android/jni/WebSettings.cpp')
-rw-r--r--WebKit/android/jni/WebSettings.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp
index c971493..e4b30c3 100644
--- a/WebKit/android/jni/WebSettings.cpp
+++ b/WebKit/android/jni/WebSettings.cpp
@@ -452,8 +452,15 @@ public:
flag = env->GetBooleanField(obj, gFieldIds->mShrinksStandaloneImagesToFit);
s->setShrinksStandaloneImagesToFit(flag);
jlong maxImage = env->GetLongField(obj, gFieldIds->mMaximumDecodedImageSize);
- if (maxImage == 0)
- maxImage = computeMaxBitmapSizeForCache();
+ // Since in ImageSourceAndroid.cpp, the image will always not exceed
+ // MAX_SIZE_BEFORE_SUBSAMPLE, there's no need to pass the max value to
+ // WebCore, which checks (image_width * image_height * 4) as an
+ // estimation against the max value, which is done in CachedImage.cpp.
+ // And there're cases where the decoded image size will not
+ // exceed the max, but the WebCore estimation will. So the following
+ // code is commented out to fix those cases.
+ // if (maxImage == 0)
+ // maxImage = computeMaxBitmapSizeForCache();
s->setMaximumDecodedImageSize(maxImage);
flag = env->GetBooleanField(obj, gFieldIds->mPrivateBrowsingEnabled);