diff options
author | Derek Sollenberger <djsollen@google.com> | 2010-11-05 08:12:51 -0400 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2010-11-11 09:16:38 -0500 |
commit | ffc715a2e6382fe9e331557c35fafc426507b8f5 (patch) | |
tree | 577666e385afbe4332e11e79d3246f0751f1a9fe /WebCore/platform/graphics/android/GLWebViewState.cpp | |
parent | a1e806ed3b2d9e2727d08cc2a3958fce501f6f33 (diff) | |
download | external_webkit-ffc715a2e6382fe9e331557c35fafc426507b8f5.zip external_webkit-ffc715a2e6382fe9e331557c35fafc426507b8f5.tar.gz external_webkit-ffc715a2e6382fe9e331557c35fafc426507b8f5.tar.bz2 |
Use a fixed number of BaseTiles per TiledPage.
This CL ensures that the TiledPage only keeps track of BaseTiles
that are backed by a texture. In order to avoid unecessary
allocations on the stack we pre-allocate the memory for the tiles
and reuse tiles.
Change-Id: I894cf4d5c6b564169ccf7a967629f5d670a5426d
Diffstat (limited to 'WebCore/platform/graphics/android/GLWebViewState.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/GLWebViewState.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp index 4ad22d8..617690c 100644 --- a/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -217,9 +217,9 @@ void GLWebViewState::setViewport(SkRect& viewport, float scale) return; m_viewport = viewport; - float fnbw = m_viewport.width() * scale / TilesManager::instance()->tileWidth(); + float fnbw = m_viewport.width() * scale / TilesManager::tileWidth(); int nbw = static_cast<int>(ceilf(fnbw)); - float fnbh = m_viewport.height() * scale / TilesManager::instance()->tileHeight(); + float fnbh = m_viewport.height() * scale / TilesManager::tileHeight(); int nbh = static_cast<int>(ceilf(fnbh)); m_nbTilesWidth = nbw + 1; m_nbTilesHeight = nbh + 1; @@ -227,8 +227,8 @@ void GLWebViewState::setViewport(SkRect& viewport, float scale) m_viewport.fLeft, m_viewport.fTop, m_viewport.fRight, m_viewport.fBottom, m_viewport.width(), m_viewport.height(), scale, m_nbTilesWidth, m_nbTilesHeight); - m_firstTileX = static_cast<int>(m_viewport.fLeft * scale / TilesManager::instance()->tileWidth()); - m_firstTileY = static_cast<int>(m_viewport.fTop * scale / TilesManager::instance()->tileHeight()); + m_firstTileX = static_cast<int>(m_viewport.fLeft * scale / TilesManager::tileWidth()); + m_firstTileY = static_cast<int>(m_viewport.fTop * scale / TilesManager::tileHeight()); } } // namespace WebCore |