Skip to content

Commit

Permalink
Merge "Fix ANR when hitting very large layers" into ics-mr1
Browse files Browse the repository at this point in the history
  • Loading branch information
camaelon authored and Android (Google) Code Review committed Dec 9, 2011
2 parents 2ee7946 + 900fb96 commit c52e565
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Source/WebCore/platform/graphics/android/PaintedSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit c52e565

Please sign in to comment.