diff options
author | Nicolas Roard <nicolasroard@google.com> | 2011-10-18 11:51:51 -0700 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2011-10-18 11:51:51 -0700 |
commit | a6d06cef38891b6e39dcbc455f7692f000309ba5 (patch) | |
tree | 32a38ec754702f23d7610f114686b49544161185 /Source | |
parent | d76089f28a901fd7694a3574f0c8036febdb1103 (diff) | |
download | external_webkit-a6d06cef38891b6e39dcbc455f7692f000309ba5.zip external_webkit-a6d06cef38891b6e39dcbc455f7692f000309ba5.tar.gz external_webkit-a6d06cef38891b6e39dcbc455f7692f000309ba5.tar.bz2 |
Be less aggressive with clippings layers tiles
This also improves performances a bit when animating small layers.
bug:5472082 bug:5297559
Change-Id: I0b9fa0a9abf98ab53928f97f53c3134056b15889
Diffstat (limited to 'Source')
-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) |