diff options
author | Nicolas Roard <nicolas@android.com> | 2011-02-15 17:48:19 -0800 |
---|---|---|
committer | Nicolas Roard <nicolas@android.com> | 2011-02-15 17:48:19 -0800 |
commit | f18fc03d63334e364d1a1b8e07dafb3fb0650c92 (patch) | |
tree | a96e3d634e643578b109487028ca034e55d137a0 /WebCore/platform/graphics/android/BaseLayerAndroid.cpp | |
parent | e5c90f700f64667817813fbb2e8478ddb7a6927b (diff) | |
download | external_webkit-f18fc03d63334e364d1a1b8e07dafb3fb0650c92.zip external_webkit-f18fc03d63334e364d1a1b8e07dafb3fb0650c92.tar.gz external_webkit-f18fc03d63334e364d1a1b8e07dafb3fb0650c92.tar.bz2 |
Improve layers repaint speed.
Computing the layers texture size is heavy; we delay this
computation if one was done recently.
bug:3375416
Change-Id: I0ce79cdfcaa15cd1521370a1d5b8df5a5e5ea2c5
Diffstat (limited to 'WebCore/platform/graphics/android/BaseLayerAndroid.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/BaseLayerAndroid.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/WebCore/platform/graphics/android/BaseLayerAndroid.cpp index 2f0e999..35c3b36 100644 --- a/WebCore/platform/graphics/android/BaseLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/BaseLayerAndroid.cpp @@ -116,12 +116,11 @@ void BaseLayerAndroid::drawCanvas(SkCanvas* canvas) } #if USE(ACCELERATED_COMPOSITING) -bool BaseLayerAndroid::drawBasePictureInGL(SkRect& viewport, float scale) +bool BaseLayerAndroid::drawBasePictureInGL(SkRect& viewport, float scale, double currentTime) { if (!m_glWebViewState) return false; - double currentTime = WTF::currentTime(); bool goingDown = m_previousVisible.fTop - viewport.fTop <= 0; bool goingLeft = m_previousVisible.fLeft - viewport.fLeft >= 0; @@ -282,7 +281,8 @@ bool BaseLayerAndroid::drawGL(IntRect& viewRect, SkRect& visibleRect, shader->setViewRect(viewRect); shader->setViewport(visibleRect); - ret = drawBasePictureInGL(visibleRect, scale); + double currentTime = WTF::currentTime(); + ret = drawBasePictureInGL(visibleRect, scale, currentTime); if (countChildren() >= 1) { LayerAndroid* compositedRoot = static_cast<LayerAndroid*>(getChild(0)); @@ -311,7 +311,7 @@ bool BaseLayerAndroid::drawGL(IntRect& viewRect, SkRect& visibleRect, scale = m_glWebViewState->futureScale(); } compositedRoot->setScale(scale); - compositedRoot->computeTextureSize(); + compositedRoot->computeTextureSize(currentTime); compositedRoot->reserveGLTextures(); #ifdef DEBUG @@ -337,12 +337,6 @@ bool BaseLayerAndroid::drawGL(IntRect& viewRect, SkRect& visibleRect, glBindBuffer(GL_ARRAY_BUFFER, 0); m_previousVisible = visibleRect; -#ifdef DEBUG_COUNT - XLOG("GLWebViewState(%d) DoubleBufferedTexture(%d) BaseTile(%d) TileSet(%d) TiledPage(%d)", - GLWebViewState::count(), DoubleBufferedTexture::count(), - BaseTile::count(), TileSet::count(), TiledPage::count()); -#endif // DEBUG_COUNT - #endif // USE(ACCELERATED_COMPOSITING) #ifdef DEBUG ClassTracker::instance()->show(); |