summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2011-06-21 16:21:55 -0700
committerNicolas Roard <nicolasroard@google.com>2011-07-14 18:16:39 -0700
commit3c131605fca8e29a88fdc4923d86bdc3f40adb2b (patch)
tree440bd04fb01b43ed995348f579e70d668fe52a85 /Source/WebCore/platform/graphics/android/GLWebViewState.cpp
parent5dcd286d3e3e60f6a090f775a1fdceb40f578b75 (diff)
downloadexternal_webkit-3c131605fca8e29a88fdc4923d86bdc3f40adb2b.zip
external_webkit-3c131605fca8e29a88fdc4923d86bdc3f40adb2b.tar.gz
external_webkit-3c131605fca8e29a88fdc4923d86bdc3f40adb2b.tar.bz2
Implements tiled layers. We remove all the existing code in LayerAndroid
related to the old texture management and introduce two new classes: - PaintedSurface, used as a placeholder ui-side for the regularly changing LayerAndroid - TiledTexture, implementing the tiling of PaintedSurface using a set of BaseTile bug:4580444 bug:3392331 Change-Id: I0daa079d2acce49f3baa8c312ea0b0dd457ccd5c
Diffstat (limited to 'Source/WebCore/platform/graphics/android/GLWebViewState.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/GLWebViewState.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
index 199ec01..2832017 100644
--- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -33,6 +33,7 @@
#include "GLUtils.h"
#include "LayerAndroid.h"
#include "TilesManager.h"
+#include "TilesTracker.h"
#include <wtf/CurrentTime.h>
#include <cutils/log.h>
@@ -80,6 +81,8 @@ GLWebViewState::GLWebViewState(android::Mutex* buttonMutex)
, m_backgroundColor(SK_ColorWHITE)
, m_displayRings(false)
, m_focusRingTexture(-1)
+ , m_goingDown(true)
+ , m_goingLeft(false)
{
m_viewport.setEmpty();
m_previousViewport.setEmpty();
@@ -109,8 +112,10 @@ GLWebViewState::~GLWebViewState()
// will remove any pending operations, and wait if one is underway).
delete m_tiledPageA;
delete m_tiledPageB;
+ SkSafeUnref(m_previouslyUsedRoot);
SkSafeUnref(m_currentBaseLayer);
SkSafeUnref(m_baseLayer);
+ m_previouslyUsedRoot = 0;
m_baseLayer = 0;
m_currentBaseLayer = 0;
#ifdef DEBUG_COUNT
@@ -504,6 +509,10 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect,
viewport.fRight * scale,
viewport.fBottom * scale);
+#ifdef DEBUG
+ TilesManager::instance()->getTilesTracker()->clear();
+#endif
+
m_baseLayerLock.lock();
BaseLayerAndroid* baseLayer = m_currentBaseLayer;
SkSafeRef(baseLayer);
@@ -532,7 +541,14 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect,
if (baseForComposited && baseForComposited->countChildren() >= 1)
compositedRoot = static_cast<LayerAndroid*>(baseForComposited->getChild(0));
+ if (compositedRoot != m_previouslyUsedRoot) {
+ TilesManager::instance()->swapLayersTextures(m_previouslyUsedRoot, compositedRoot);
+ TilesManager::instance()->cleanupTilesTextures();
+ }
+
bool ret = baseLayer->drawGL(compositedRoot, rect, viewport, webViewRect, titleBarHeight, clip, scale, color);
+ SkSafeRef(compositedRoot);
+ SkSafeUnref(m_previouslyUsedRoot);
m_previouslyUsedRoot = compositedRoot;
if (ret) {
FloatRect frameworkInval = TilesManager::instance()->shader()->rectInInvScreenCoord(m_frameworkInval);
@@ -563,6 +579,9 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect,
SkSafeUnref(baseForComposited);
SkSafeUnref(baseLayer);
+#ifdef DEBUG
+ TilesManager::instance()->getTilesTracker()->showTrackTextures();
+#endif
return ret;
}