summaryrefslogtreecommitdiffstats
path: root/WebCore/platform
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2011-02-11 10:00:52 -0800
committerNicolas Roard <nicolas@android.com>2011-02-11 11:13:46 -0800
commitfc648fc6f8fdbf673cde145ae2d3e67c4f8c16d9 (patch)
tree2e5afd2ddca670f986320e6e21e4d214fdab0d97 /WebCore/platform
parentf683cf60e404c2664a013ef2d4ffda87c4dfacdf (diff)
downloadexternal_webkit-fc648fc6f8fdbf673cde145ae2d3e67c4f8c16d9.zip
external_webkit-fc648fc6f8fdbf673cde145ae2d3e67c4f8c16d9.tar.gz
external_webkit-fc648fc6f8fdbf673cde145ae2d3e67c4f8c16d9.tar.bz2
Clip layers if the texture size is too large for the GPU
bug:3436987 Change-Id: I180b9f54b9db5d190ca2832bea8b9ff210a0619a
Diffstat (limited to 'WebCore/platform')
-rw-r--r--WebCore/platform/graphics/android/LayerAndroid.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp
index 8771d3b..bee423c 100644
--- a/WebCore/platform/graphics/android/LayerAndroid.cpp
+++ b/WebCore/platform/graphics/android/LayerAndroid.cpp
@@ -674,7 +674,9 @@ void LayerAndroid::computeTextureSize()
// If we are under the maximum, and the layer inspected
// needs a texture less than the maxLayerSize, use the full texture.
if ((total < max) &&
- (layer->fullTextureSize() < maxLayerSize)) {
+ (layer->fullTextureSize() < maxLayerSize) &&
+ (layer->getWidth() * m_scale < TilesManager::instance()->getMaxTextureSize()) &&
+ (layer->getHeight() * m_scale < TilesManager::instance()->getMaxTextureSize())) {
IntRect full(0, 0, layer->getWidth(), layer->getHeight());
layer->m_layerTextureRect = full;
clipped = false;