summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2011-12-12 12:35:16 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-12-12 12:35:16 -0800
commitca9aabbb6f6fa2e5a36710427ee0f9f8972018e9 (patch)
tree3f104cbef0dfb97637ea4d112a81979664a582b1 /Source
parent1c42978931fbc36259741b9ccbb90b974e385693 (diff)
parent5f0a489e7a7dbb42ae725b31e34a92901c65eb0a (diff)
downloadexternal_webkit-ca9aabbb6f6fa2e5a36710427ee0f9f8972018e9.zip
external_webkit-ca9aabbb6f6fa2e5a36710427ee0f9f8972018e9.tar.gz
external_webkit-ca9aabbb6f6fa2e5a36710427ee0f9f8972018e9.tar.bz2
am 5f0a489e: am c52e5656: Merge "Fix ANR when hitting very large layers" into ics-mr1
* commit '5f0a489e7a7dbb42ae725b31e34a92901c65eb0a': Fix ANR when hitting very large layers
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/platform/graphics/android/PaintedSurface.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/WebCore/platform/graphics/android/PaintedSurface.cpp b/Source/WebCore/platform/graphics/android/PaintedSurface.cpp
index d3c1e15..45c7579 100644
--- a/Source/WebCore/platform/graphics/android/PaintedSurface.cpp
+++ b/Source/WebCore/platform/graphics/android/PaintedSurface.cpp
@@ -52,9 +52,8 @@
#endif // DEBUG
-// Allows layers using less than MAX_UNCLIPPED_AREA tiles to
-// schedule all of them instead of clipping the area with the visible rect.
-#define MAX_UNCLIPPED_AREA 16
+// Layers with an area larger than 2048*2048 should never be unclipped
+#define MAX_UNCLIPPED_AREA 4194304
namespace WebCore {
@@ -203,10 +202,14 @@ IntRect PaintedSurface::computeVisibleArea(LayerAndroid* layer) {
return area;
if (!layer->contentIsScrollable()
- && layer->state()->layersRenderingMode() == GLWebViewState::kAllTextures)
+ && layer->state()->layersRenderingMode() == GLWebViewState::kAllTextures) {
area = layer->unclippedArea();
- else
+ double total = ((double) area.width()) * ((double) area.height());
+ if (total > MAX_UNCLIPPED_AREA)
+ area = layer->visibleArea();
+ } else {
area = layer->visibleArea();
+ }
return area;
}