From ffc715a2e6382fe9e331557c35fafc426507b8f5 Mon Sep 17 00:00:00 2001 From: Derek Sollenberger Date: Fri, 5 Nov 2010 08:12:51 -0400 Subject: 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 --- WebCore/platform/graphics/android/GLWebViewState.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'WebCore/platform/graphics/android/GLWebViewState.cpp') 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(ceilf(fnbw)); - float fnbh = m_viewport.height() * scale / TilesManager::instance()->tileHeight(); + float fnbh = m_viewport.height() * scale / TilesManager::tileHeight(); int nbh = static_cast(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(m_viewport.fLeft * scale / TilesManager::instance()->tileWidth()); - m_firstTileY = static_cast(m_viewport.fTop * scale / TilesManager::instance()->tileHeight()); + m_firstTileX = static_cast(m_viewport.fLeft * scale / TilesManager::tileWidth()); + m_firstTileY = static_cast(m_viewport.fTop * scale / TilesManager::tileHeight()); } } // namespace WebCore -- cgit v1.1