diff options
author | Chris Craik <ccraik@google.com> | 2012-01-18 17:01:48 -0800 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2012-01-24 11:40:05 -0800 |
commit | bac79a8ecce7b3aaf3bc4964957c9c59f163de38 (patch) | |
tree | ecf1a24494b50a7216c7482bc73c58a16abf90c9 /Source/WebCore/platform/graphics/android | |
parent | 53f436aa7cd90d8c691b1fbfd92d6a6a4b01db77 (diff) | |
download | external_webkit-bac79a8ecce7b3aaf3bc4964957c9c59f163de38.zip external_webkit-bac79a8ecce7b3aaf3bc4964957c9c59f163de38.tar.gz external_webkit-bac79a8ecce7b3aaf3bc4964957c9c59f163de38.tar.bz2 |
Add tree swapping properties and stats
Change-Id: I0033b8794ae33dade050069d6c209653f0d21fd1
Diffstat (limited to 'Source/WebCore/platform/graphics/android')
3 files changed, 24 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp index fbf7ae6..cbbbe5c 100644 --- a/Source/WebCore/platform/graphics/android/TilesManager.cpp +++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp @@ -103,6 +103,8 @@ TilesManager::TilesManager() , m_invertedScreen(false) , m_invertedScreenSwitch(false) , m_useMinimalMemory(true) + , m_useDoubleBuffering(true) + , m_treeUpdates(0) , m_drawGLCount(1) , m_lastTimeLayersUsed(0) , m_hasLayerTextures(false) diff --git a/Source/WebCore/platform/graphics/android/TilesManager.h b/Source/WebCore/platform/graphics/android/TilesManager.h index f798196..dd01fc5 100644 --- a/Source/WebCore/platform/graphics/android/TilesManager.h +++ b/Source/WebCore/platform/graphics/android/TilesManager.h @@ -178,6 +178,16 @@ public: return m_useMinimalMemory; } + void setUseDoubleBuffering(bool useDoubleBuffering) + { + m_useDoubleBuffering = useDoubleBuffering; + } + bool useDoubleBuffering() { return m_useDoubleBuffering; } + + void incTreeUpdates() { m_treeUpdates++; } + unsigned int getTreeUpdates() { return m_treeUpdates; } + void clearTreeUpdates() { m_treeUpdates = 0; } + void incDrawGLCount() { m_drawGLCount++; @@ -227,6 +237,9 @@ private: bool m_useMinimalMemory; + bool m_useDoubleBuffering; + unsigned int m_treeUpdates; + sp<TexturesGenerator> m_pixmapsGenerationThread; android::Mutex m_texturesLock; diff --git a/Source/WebCore/platform/graphics/android/TreeManager.cpp b/Source/WebCore/platform/graphics/android/TreeManager.cpp index 35ddeb8..be161a0 100644 --- a/Source/WebCore/platform/graphics/android/TreeManager.cpp +++ b/Source/WebCore/platform/graphics/android/TreeManager.cpp @@ -159,10 +159,15 @@ void TreeManager::updateWithTree(Layer* newTree, bool brandNew) if (m_queuedTree || m_paintingTree) { // currently painting, so defer this new tree if (m_queuedTree) { - // have a queued tree, copy over invals so the regions are - // eventually repainted + // already have a queued tree, copy over invals so the regions are + // eventually repainted and let the old queued tree be discarded m_queuedTree->mergeInvalsInto(newTree); + if (!TilesManager::instance()->useDoubleBuffering()) { + // not double buffering, count discarded tree/webkit paint as an update + TilesManager::instance()->incTreeUpdates(); + } + XLOG("DISCARDING tree - %p, has children %d, has animations %d", newTree, newTree && newTree->countChildren(), newTree && newTree->countChildren() @@ -222,9 +227,10 @@ bool TreeManager::drawGL(double currentTime, IntRect& viewRect, if (laTree) laTree->computeTexturesAmount(texturesResultPtr); - if (/*!m_fastSwapMode && */ m_paintingTree->isReady()) { + if (!TilesManager::instance()->useDoubleBuffering() || m_paintingTree->isReady()) { XLOG("have painting tree %p ready, swapping!", m_paintingTree); didTreeSwap = true; + TilesManager::instance()->incTreeUpdates(); swap(); if (treesSwappedPtr) *treesSwappedPtr = true; |