diff options
author | Bart Sears <bsears@google.com> | 2011-11-30 22:19:20 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-11-30 22:19:20 -0800 |
commit | 2fa7f06c10694943d7955dd790f2e110dded30bc (patch) | |
tree | 73aadd6c8088c47c883d77e635d2d4f99a27c798 | |
parent | 03fac317bdee01cf7191d19143f4dd05bac92239 (diff) | |
parent | 587dc59f75f0e53388e6250472d091f7b65c9227 (diff) | |
download | external_webkit-2fa7f06c10694943d7955dd790f2e110dded30bc.zip external_webkit-2fa7f06c10694943d7955dd790f2e110dded30bc.tar.gz external_webkit-2fa7f06c10694943d7955dd790f2e110dded30bc.tar.bz2 |
am 587dc59f: Merge "Fix offscreen tile optimization with small content" into ics-mr1
* commit '587dc59f75f0e53388e6250472d091f7b65c9227':
Fix offscreen tile optimization with small content
-rw-r--r-- | Source/WebCore/platform/graphics/android/TiledPage.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Source/WebCore/platform/graphics/android/TiledPage.cpp b/Source/WebCore/platform/graphics/android/TiledPage.cpp index 2b3c2ee..8352cce 100644 --- a/Source/WebCore/platform/graphics/android/TiledPage.cpp +++ b/Source/WebCore/platform/graphics/android/TiledPage.cpp @@ -257,23 +257,23 @@ void TiledPage::prepare(bool goingDown, bool goingLeft, const SkIRect& tileBound firstTileY -= expandY; nbTilesHeight += expandY * 2; - } - // crop the prepared region to the contents of the base layer - float maxWidthTiles = m_glWebViewState->baseContentWidth() * m_scale / TilesManager::tileWidth(); - float maxHeightTiles = m_glWebViewState->baseContentHeight() * m_scale / TilesManager::tileHeight(); + // crop the prepared region to the contents of the base layer + float maxWidthTiles = m_glWebViewState->baseContentWidth() * m_scale / TilesManager::tileWidth(); + float maxHeightTiles = m_glWebViewState->baseContentHeight() * m_scale / TilesManager::tileHeight(); - // adjust perimeter to not go outside base content bounds - if (firstTileX < 0) { - nbTilesWidth += firstTileX; - firstTileX = 0; - } - if (firstTileY < 0) { - nbTilesHeight += firstTileY; - firstTileY = 0; + // adjust perimeter to not go outside base content bounds + if (firstTileX < 0) { + nbTilesWidth += firstTileX; + firstTileX = 0; + } + if (firstTileY < 0) { + nbTilesHeight += firstTileY; + firstTileY = 0; + } + nbTilesWidth = std::min(nbTilesWidth, static_cast<int>(ceilf(maxWidthTiles)) - firstTileX); + nbTilesHeight = std::min(nbTilesHeight, static_cast<int>(ceilf(maxHeightTiles)) - firstTileY); } - nbTilesWidth = std::min(nbTilesWidth, static_cast<int>(ceilf(maxWidthTiles)) - firstTileX); - nbTilesHeight = std::min(nbTilesHeight, static_cast<int>(ceilf(maxHeightTiles)) - firstTileY); // check against corrupted scale values giving bad height/width (use float to avoid overflow) float numTiles = static_cast<float>(nbTilesHeight) * static_cast<float>(nbTilesWidth); |