diff options
author | Nicolas Roard <nicolasroard@google.com> | 2011-10-18 13:07:13 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-10-18 13:07:13 -0700 |
commit | ff5c8a747577c62ebfecfb18013d2744a3eb73e7 (patch) | |
tree | fda5d39880d045606d74a99bc56f04ef2aaeae4c /Source/WebCore | |
parent | 9cbb37952fd7e7f6d739574d28a6a6795351db1d (diff) | |
parent | a6d06cef38891b6e39dcbc455f7692f000309ba5 (diff) | |
download | external_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/WebCore')
-rw-r--r-- | Source/WebCore/platform/graphics/android/PaintedSurface.cpp | 12 |
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) |