From 77a63f12c44ce6ef9e69cb9a2e104fc625d96cac Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Mon, 9 Apr 2012 14:39:00 -0700 Subject: Don't render expanded bounds if useMinimalMemory set Extracted TilesManager instance locally, and standardized the extraction naming. Change-Id: Ia6ba1013bc6502f7c3a49d5dbf5d74739d997d2e --- Source/WebCore/platform/graphics/android/GLWebViewState.cpp | 6 +++--- .../WebCore/platform/graphics/android/rendering/TileGrid.cpp | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'Source/WebCore') diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp index 99eb1c6..1b0513b 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -132,10 +132,10 @@ void GLWebViewState::setViewport(const SkRect& viewport, float scale) int viewMaxTileX = static_cast(ceilf((viewport.width()-1) * invTileContentWidth)) + 1; int viewMaxTileY = static_cast(ceilf((viewport.height()-1) * invTileContentHeight)) + 1; - TilesManager* manager = TilesManager::instance(); - int maxTextureCount = viewMaxTileX * viewMaxTileY * (manager->highEndGfx() ? 4 : 2); + TilesManager* tilesManager = TilesManager::instance(); + int maxTextureCount = viewMaxTileX * viewMaxTileY * (tilesManager->highEndGfx() ? 4 : 2); - manager->setMaxTextureCount(maxTextureCount); + tilesManager->setMaxTextureCount(maxTextureCount); // TODO: investigate whether we can move this return earlier. if ((m_viewport == viewport) diff --git a/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp b/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp index 5ce63bf..63f73aa 100644 --- a/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp @@ -153,8 +153,9 @@ void TileGrid::prepareGL(GLWebViewState* state, float scale, bool goingDown = m_prevTileY < m_area.y(); m_prevTileY = m_area.y(); + TilesManager* tilesManager = TilesManager::instance(); if (scale != m_scale) - TilesManager::instance()->removeOperationsForFilter(new ScaleFilter(painter, m_scale)); + tilesManager->removeOperationsForFilter(new ScaleFilter(painter, m_scale)); m_scale = scale; @@ -164,11 +165,11 @@ void TileGrid::prepareGL(GLWebViewState* state, float scale, m_tiles[i]->markAsDirty(m_dirtyRegion); // log inval region for the base surface - if (m_isBaseSurface && TilesManager::instance()->getProfiler()->enabled()) { + if (m_isBaseSurface && tilesManager->getProfiler()->enabled()) { SkRegion::Iterator iterator(m_dirtyRegion); while (!iterator.done()) { SkIRect r = iterator.rect(); - TilesManager::instance()->getProfiler()->nextInval(r, scale); + tilesManager->getProfiler()->nextInval(r, scale); iterator.next(); } } @@ -193,8 +194,8 @@ void TileGrid::prepareGL(GLWebViewState* state, float scale, IntRect fullArea = computeTilesArea(unclippedArea, scale); IntRect expandedArea = m_area; - // on systems reporting highEndGfx=true, use expanded high res bounds - if (TilesManager::instance()->highEndGfx()) + // on systems reporting highEndGfx=true and useMinimalMemory not set, use expanded bounds + if (tilesManager->highEndGfx() && !tilesManager->useMinimalMemory()) expandedArea.inflate(EXPANDED_BOUNDS_INFLATE); if (isLowResPrefetch) -- cgit v1.1