diff options
author | Dave Burke <daveburke@google.com> | 2011-02-01 12:55:51 +0000 |
---|---|---|
committer | Dave Burke <daveburke@google.com> | 2011-02-01 12:55:51 +0000 |
commit | f09d842c6d6d0b10ceaf6619d540a8c3f9056922 (patch) | |
tree | d523a9bf70e15759a6e703acb56a96f4d2d1f2b7 /WebCore/platform/graphics/android/TilesManager.cpp | |
parent | d7c28d82f1f7f97cd9527fc6372596fbf69bd2fd (diff) | |
download | external_webkit-f09d842c6d6d0b10ceaf6619d540a8c3f9056922.zip external_webkit-f09d842c6d6d0b10ceaf6619d540a8c3f9056922.tar.gz external_webkit-f09d842c6d6d0b10ceaf6619d540a8c3f9056922.tar.bz2 |
Smoother scrolling by preparing offscreen tiles (credit: Ben Murdoch)
Change-Id: I80c7757bfb85f0b45726f2fa2f18644d2493fced
Diffstat (limited to 'WebCore/platform/graphics/android/TilesManager.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/TilesManager.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/WebCore/platform/graphics/android/TilesManager.cpp b/WebCore/platform/graphics/android/TilesManager.cpp index 81b0404..21162ff 100644 --- a/WebCore/platform/graphics/android/TilesManager.cpp +++ b/WebCore/platform/graphics/android/TilesManager.cpp @@ -54,9 +54,11 @@ // one viewport, otherwise the allocation may stall. // We need n textures for one TiledPage, and another n textures for the // second page used when scaling. -// In our case, we use 300x300 textures. On the tablet, this equals to -// at least 24 (6 * 4) textures, hence 48. -#define MAX_TEXTURE_ALLOCATION 48 +// In our case, we use 300x300 textures. On the tablet, this equates to +// at least 5 * 3 = 15 textures. We can also enable offscreen textures +#define EXPANDED_TILE_BOUNDS_X 1 +#define EXPANDED_TILE_BOUNDS_Y 4 +#define MAX_TEXTURE_ALLOCATION (5+EXPANDED_TILE_BOUNDS_X*2)*(3+EXPANDED_TILE_BOUNDS_Y*2)*2 #define TILE_WIDTH 300 #define TILE_HEIGHT 300 @@ -69,6 +71,7 @@ namespace WebCore { TilesManager::TilesManager() : m_layersMemoryUsage(0) , m_maxTextureCount(0) + , m_expandedTileBounds(false) , m_generatorReady(false) { XLOG("TilesManager ctor"); @@ -366,6 +369,14 @@ float TilesManager::tileHeight() return TILE_HEIGHT; } +int TilesManager::expandedTileBoundsX() { + return m_expandedTileBounds ? EXPANDED_TILE_BOUNDS_X : 0; +} + +int TilesManager::expandedTileBoundsY() { + return m_expandedTileBounds ? EXPANDED_TILE_BOUNDS_Y : 0; +} + TilesManager* TilesManager::instance() { if (!gInstance) { |