summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android/GLWebViewState.cpp
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2011-02-10 19:33:59 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-10 19:33:59 -0800
commitf683cf60e404c2664a013ef2d4ffda87c4dfacdf (patch)
treeb1b5680338ca7f6b9f19848e9556f3264e9a1850 /WebCore/platform/graphics/android/GLWebViewState.cpp
parent246ea84a226462854f9c876c8dd03665271b3f78 (diff)
parent81ec1fafcb2c1bc433ec34b6ae4ea78d1ea7d3a8 (diff)
downloadexternal_webkit-f683cf60e404c2664a013ef2d4ffda87c4dfacdf.zip
external_webkit-f683cf60e404c2664a013ef2d4ffda87c4dfacdf.tar.gz
external_webkit-f683cf60e404c2664a013ef2d4ffda87c4dfacdf.tar.bz2
Merge "Fix ANR in the browser Sometimes we were not releasing textures as they were busy; they could still be deleted when swapping the layers trees, and as they were also still present in the LayerTexture Hashmap this was causing an ANR (at best -- the texture was already deallocated, the LayerTexture dtor was then trying to release() them...)"
Diffstat (limited to 'WebCore/platform/graphics/android/GLWebViewState.cpp')
-rw-r--r--WebCore/platform/graphics/android/GLWebViewState.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp
index 38b747d..5ba094b 100644
--- a/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -108,9 +108,9 @@ void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const IntRect& rect)
// We only update the layers if we are not currently
// waiting for a tiledPage to be painted
if (m_baseLayerUpdate) {
+ layer->safeRef();
m_currentBaseLayer->safeUnref();
m_currentBaseLayer = layer;
- m_currentBaseLayer->safeRef();
}
inval(rect);
}
@@ -118,9 +118,9 @@ void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const IntRect& rect)
void GLWebViewState::unlockBaseLayerUpdate() {
m_baseLayerUpdate = true;
android::Mutex::Autolock lock(m_baseLayerLock);
+ m_baseLayer->safeRef();
m_currentBaseLayer->safeUnref();
m_currentBaseLayer = m_baseLayer;
- m_currentBaseLayer->safeRef();
inval(m_invalidateRect);
IntRect empty;
m_invalidateRect = empty;
@@ -295,6 +295,19 @@ void GLWebViewState::setViewport(SkRect& viewport, float scale)
m_tiledPageB->updateBaseTileSize();
}
+bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, float scale, SkColor color)
+{
+ m_baseLayerLock.lock();
+ BaseLayerAndroid* baseLayer = m_currentBaseLayer;
+ baseLayer->safeRef();
+ m_baseLayerLock.unlock();
+ if (!baseLayer)
+ return false;
+ bool ret = baseLayer->drawGL(rect, viewport, scale, color);
+ baseLayer->safeUnref();
+ return ret;
+}
+
} // namespace WebCore
#endif // USE(ACCELERATED_COMPOSITING)