summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2011-10-18 13:07:13 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-10-18 13:07:13 -0700
commitff5c8a747577c62ebfecfb18013d2744a3eb73e7 (patch)
treefda5d39880d045606d74a99bc56f04ef2aaeae4c /Source
parent9cbb37952fd7e7f6d739574d28a6a6795351db1d (diff)
parenta6d06cef38891b6e39dcbc455f7692f000309ba5 (diff)
downloadexternal_webkit-ff5c8a747577c62ebfecfb18013d2744a3eb73e7.zip
external_webkit-ff5c8a747577c62ebfecfb18013d2744a3eb73e7.tar.gz
external_webkit-ff5c8a747577c62ebfecfb18013d2744a3eb73e7.tar.bz2
am a6d06cef: Be less aggressive with clippings layers tiles
* commit 'a6d06cef38891b6e39dcbc455f7692f000309ba5': Be less aggressive with clippings layers tiles
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/platform/graphics/android/PaintedSurface.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/android/PaintedSurface.cpp b/Source/WebCore/platform/graphics/android/PaintedSurface.cpp
index d48c116..c5ed38c 100644
--- a/Source/WebCore/platform/graphics/android/PaintedSurface.cpp
+++ b/Source/WebCore/platform/graphics/android/PaintedSurface.cpp
@@ -51,6 +51,10 @@
#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
+
namespace WebCore {
PaintedSurface::PaintedSurface(LayerAndroid* layer)
@@ -208,6 +212,14 @@ void PaintedSurface::computeVisibleArea() {
IntRect layerRect = (*m_layer->drawTransform()).mapRect(m_area);
IntRect clippedRect = TilesManager::instance()->shader()->clippedRectWithViewport(layerRect);
m_visibleArea = (*m_layer->drawTransform()).inverse().mapRect(clippedRect);
+ if (!m_visibleArea.isEmpty()) {
+ float tileWidth = TilesManager::instance()->layerTileWidth();
+ float tileHeight = TilesManager::instance()->layerTileHeight();
+ int w = ceilf(m_area.width() / tileWidth);
+ int h = ceilf(m_area.height() / tileHeight);
+ if (w * h < MAX_UNCLIPPED_AREA)
+ m_visibleArea = m_area;
+ }
}
bool PaintedSurface::owns(BaseTileTexture* texture)