summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-08-24 13:23:03 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-24 13:23:03 -0700
commit1fc2193096f53e2b6f2080a7c0a516e224981c40 (patch)
tree904916b229584babb67a35f0d86f3c481df0b129 /Source/WebCore/platform
parent58e496cb1af06fa0e2854172cd14edd42348906e (diff)
parent349594acdaf53d8b35f1d153139231c25420e8de (diff)
downloadexternal_webkit-1fc2193096f53e2b6f2080a7c0a516e224981c40.zip
external_webkit-1fc2193096f53e2b6f2080a7c0a516e224981c40.tar.gz
external_webkit-1fc2193096f53e2b6f2080a7c0a516e224981c40.tar.bz2
Merge "Prevent preparing a page with an invalid size."
Diffstat (limited to 'Source/WebCore/platform')
-rw-r--r--Source/WebCore/platform/graphics/android/TiledPage.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/android/TiledPage.cpp b/Source/WebCore/platform/graphics/android/TiledPage.cpp
index a69f9d1..600b3f1 100644
--- a/Source/WebCore/platform/graphics/android/TiledPage.cpp
+++ b/Source/WebCore/platform/graphics/android/TiledPage.cpp
@@ -33,12 +33,15 @@
#include "PaintTileOperation.h"
#include "TilesManager.h"
-#ifdef DEBUG
-
#include <cutils/log.h>
#include <wtf/CurrentTime.h>
#include <wtf/text/CString.h>
+#undef XLOGC
+#define XLOGC(...) android_printLog(ANDROID_LOG_DEBUG, "TiledPage", __VA_ARGS__)
+
+#ifdef DEBUG
+
#undef XLOG
#define XLOG(...) android_printLog(ANDROID_LOG_DEBUG, "TiledPage", __VA_ARGS__)
@@ -248,7 +251,6 @@ void TiledPage::prepare(bool goingDown, bool goingLeft, const SkIRect& tileBound
TilesManager::instance()->gatherTextures();
// update the tiles distance from the viewport
updateTileState(tileBounds);
- m_prepare = true;
m_scrollingDown = goingDown;
int firstTileX = tileBounds.fLeft;
@@ -279,8 +281,15 @@ void TiledPage::prepare(bool goingDown, bool goingLeft, const SkIRect& tileBound
m_expandedTileBounds.fRight = lastTileX;
m_expandedTileBounds.fBottom = lastTileY;
+ if (nbTilesHeight * nbTilesWidth > TilesManager::getMaxTextureAllocation() + 1) {
+ XLOGC("ERROR: We don't have enough tiles for this page!"
+ " nbTilesHeight %d nbTilesWidth %d", nbTilesHeight, nbTilesWidth);
+ return;
+ }
for (int i = 0; i < nbTilesHeight; i++)
prepareRow(goingLeft, nbTilesWidth, firstTileX, firstTileY + i, tileBounds);
+
+ m_prepare = true;
}
bool TiledPage::ready(const SkIRect& tileBounds, float scale)