diff options
author | Chris Craik <ccraik@google.com> | 2011-07-20 16:12:29 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2011-07-21 14:21:33 -0700 |
commit | 687472b6cb489b5d3ea6a9a2fff110a685c27a79 (patch) | |
tree | cf3816df277c1242c69602a62f0fedd3a2eab016 /Source/WebCore/platform/graphics/android/TilesProfiler.cpp | |
parent | 4f25266c21bdd7dcd9996807fae04f7dfb0373de (diff) | |
download | external_webkit-687472b6cb489b5d3ea6a9a2fff110a685c27a79.zip external_webkit-687472b6cb489b5d3ea6a9a2fff110a685c27a79.tar.gz external_webkit-687472b6cb489b5d3ea6a9a2fff110a685c27a79.tar.bz2 |
New tile logging JNI interface
bug:5062896
Added more functionality to tile logging and querying (explicit location and
size), invalidation region logging, as well as string-based JNI query method
which should stabilize the JNI interface in the future.
Change-Id: I937d4227abf0d0f18124c484438fd13a62439fb6
Diffstat (limited to 'Source/WebCore/platform/graphics/android/TilesProfiler.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/TilesProfiler.cpp | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/Source/WebCore/platform/graphics/android/TilesProfiler.cpp b/Source/WebCore/platform/graphics/android/TilesProfiler.cpp index 5c6aaa0..466923a 100644 --- a/Source/WebCore/platform/graphics/android/TilesProfiler.cpp +++ b/Source/WebCore/platform/graphics/android/TilesProfiler.cpp @@ -28,6 +28,7 @@ #if USE(ACCELERATED_COMPOSITING) +#include "TilesManager.h" #include <wtf/CurrentTime.h> #ifdef DEBUG @@ -47,6 +48,7 @@ // Hard limit on amount of frames (and thus memory) profiling can take #define MAX_PROF_FRAMES 400 +#define INVAL_CODE -2 namespace WebCore { TilesProfiler::TilesProfiler() @@ -77,7 +79,7 @@ void TilesProfiler::clear() m_records.clear(); } -void TilesProfiler::nextFrame(int l, int t, int r, int b) +void TilesProfiler::nextFrame(int left, int top, int right, int bottom, float scale) { if (!m_enabled || (m_records.size() > MAX_PROF_FRAMES)) return; @@ -96,22 +98,44 @@ void TilesProfiler::nextFrame(int l, int t, int r, int b) m_records.append(WTF::Vector<TileProfileRecord>()); //first two records designate viewport - m_records.last().append(TileProfileRecord(l, t, true, (int)(timeDelta * 1000))); - m_records.last().append(TileProfileRecord(r, b, true, -1)); - + m_records.last().append(TileProfileRecord( + left, top, right, bottom, + scale, true, (int)(timeDelta * 1000))); } -void TilesProfiler::nextTile(int x, int y, bool isReady, int level, bool inView) +void TilesProfiler::nextTile(BaseTile& tile, float scale, bool inView) { if (!m_enabled || (m_records.size() > MAX_PROF_FRAMES)) return; + + bool isReady = tile.isTileReady(); + int left = tile.x() * TilesManager::tileWidth(); + int top = tile.y() * TilesManager::tileWidth(); + int right = left + TilesManager::tileWidth(); + int bottom = top + TilesManager::tileWidth(); + if (inView) { if (isReady) m_goodTiles++; else m_badTiles++; } - m_records.last().append(TileProfileRecord(x, y, isReady, level)); + m_records.last().append(TileProfileRecord( + left, top, right, bottom, + scale, isReady, tile.usedLevel())); + XLOG("adding tile %d %d %d %d, scale %f", left, top, right, bottom, scale); +} + +void TilesProfiler::nextInval(const IntRect& rect, float scale) +{ + if (!m_enabled || (m_records.size() > MAX_PROF_FRAMES)) + return; + + m_records.last().append(TileProfileRecord( + rect.x(), rect.y(), + rect.maxX(), rect.maxY(), scale, false, INVAL_CODE)); + XLOG("adding inval region %d %d %d %d, scale %f", rect.x(), rect.y(), + rect.maxX(), rect.maxY(), scale); } } // namespace WebCore |