diff options
Diffstat (limited to 'WebCore/platform/graphics/android')
8 files changed, 65 insertions, 3 deletions
diff --git a/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/WebCore/platform/graphics/android/BaseLayerAndroid.cpp index 3719c35..d5119b1 100644 --- a/WebCore/platform/graphics/android/BaseLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/BaseLayerAndroid.cpp @@ -220,6 +220,13 @@ 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) return ret; } diff --git a/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp b/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp index 35e2821..31a1186 100644 --- a/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp +++ b/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp @@ -34,6 +34,14 @@ namespace WebCore { +#ifdef DEBUG_COUNT +static int gDoubleBufferedTextureCount = 0; +int DoubleBufferedTexture::count() +{ + return gDoubleBufferedTextureCount; +} +#endif + DoubleBufferedTexture::DoubleBufferedTexture(EGLContext sharedContext) { m_display = eglGetCurrentDisplay(); @@ -42,6 +50,17 @@ DoubleBufferedTexture::DoubleBufferedTexture(EGLContext sharedContext) m_writeableTexture = &m_textureA; m_lockedConsumerTexture = GL_NO_TEXTURE; m_supportsEGLImage = GLUtils::isEGLImageSupported(); + +#ifdef DEBUG_COUNT + gDoubleBufferedTextureCount++; +#endif +} + +DoubleBufferedTexture::~DoubleBufferedTexture() +{ +#ifdef DEBUG_COUNT + gDoubleBufferedTextureCount--; +#endif } SharedTexture* DoubleBufferedTexture::getWriteableTexture() diff --git a/WebCore/platform/graphics/android/DoubleBufferedTexture.h b/WebCore/platform/graphics/android/DoubleBufferedTexture.h index d90c0d1..d16d5f3 100644 --- a/WebCore/platform/graphics/android/DoubleBufferedTexture.h +++ b/WebCore/platform/graphics/android/DoubleBufferedTexture.h @@ -33,9 +33,12 @@ namespace WebCore { class DoubleBufferedTexture { public: +#ifdef DEBUG_COUNT + static int count(); +#endif // consumer thread functions DoubleBufferedTexture(EGLContext sharedContext); - virtual ~DoubleBufferedTexture() { } + virtual ~DoubleBufferedTexture(); // provider thread functions virtual TextureInfo* producerLock(); diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp index 21836e1..bbaed78 100644 --- a/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -55,6 +55,14 @@ namespace WebCore { using namespace android; +#ifdef DEBUG_COUNT +static int gGLWebViewStateCount = 0; +int GLWebViewState::count() +{ + return gGLWebViewStateCount; +} +#endif + GLWebViewState::GLWebViewState() : m_scaleRequestState(kNoScaleRequest) , m_currentScale(1) @@ -76,6 +84,9 @@ GLWebViewState::GLWebViewState() m_invalidatedRect.setEmpty(); m_tiledPageA = new TiledPage(FIRST_TILED_PAGE_ID, this); m_tiledPageB = new TiledPage(SECOND_TILED_PAGE_ID, this); +#ifdef DEBUG_COUNT + gGLWebViewStateCount++; +#endif } GLWebViewState::~GLWebViewState() @@ -83,6 +94,9 @@ GLWebViewState::~GLWebViewState() delete m_tiledPageA; delete m_tiledPageB; delete m_navLayer; +#ifdef DEBUG_COUNT + gGLWebViewStateCount--; +#endif } void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, IntRect& rect) @@ -97,7 +111,6 @@ void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, IntRect& rect) m_invalidatedRect.set(rect); m_currentPictureCounter++; } - XLOG("%x setBaseLayer %x (%d)", this, layer, m_currentPictureCounter); } void GLWebViewState::setExtra(android::DrawExtra* extra, LayerAndroid* navLayer) diff --git a/WebCore/platform/graphics/android/GLWebViewState.h b/WebCore/platform/graphics/android/GLWebViewState.h index 4cbbdc0..1fc62df 100644 --- a/WebCore/platform/graphics/android/GLWebViewState.h +++ b/WebCore/platform/graphics/android/GLWebViewState.h @@ -126,6 +126,9 @@ class LayerAndroid; class GLWebViewState { public: +#ifdef DEBUG_COUNT + static int count(); +#endif enum GLScaleStates { kNoScaleRequest = 0, kWillScheduleRequest = 1, diff --git a/WebCore/platform/graphics/android/TileSet.cpp b/WebCore/platform/graphics/android/TileSet.cpp index f1845ad..fe13ef3 100644 --- a/WebCore/platform/graphics/android/TileSet.cpp +++ b/WebCore/platform/graphics/android/TileSet.cpp @@ -64,7 +64,7 @@ TileSet::TileSet(int id, int firstTileX, int firstTileY, int rows, int cols) , m_nbCols(cols) { #ifdef DEBUG_COUNT - gTilesSetCount++; + gTileSetCount++; #endif } diff --git a/WebCore/platform/graphics/android/TiledPage.cpp b/WebCore/platform/graphics/android/TiledPage.cpp index f52c2f9..fc33377 100644 --- a/WebCore/platform/graphics/android/TiledPage.cpp +++ b/WebCore/platform/graphics/android/TiledPage.cpp @@ -51,12 +51,23 @@ namespace WebCore { using namespace android; +#ifdef DEBUG_COUNT +static int gTilePageCount = 0; +int TiledPage::count() +{ + return gTilePageCount; +} +#endif + TiledPage::TiledPage(int id, GLWebViewState* state) : m_id(id) , m_scale(1) , m_invScale(1) , m_glWebViewState(state) { +#ifdef DEBUG_COUNT + gTilePageCount++; +#endif } TiledPage::~TiledPage() { @@ -70,6 +81,9 @@ TiledPage::~TiledPage() { // by the TextureGenerator, and as we did reset the BaseLayer in GLWebViewState, // in WebView's destructor (so no additional painting can be scheduled) deleteAllValues(m_baseTiles); +#ifdef DEBUG_COUNT + gTilePageCount--; +#endif } BaseTile* TiledPage::getBaseTile(int x, int y) diff --git a/WebCore/platform/graphics/android/TiledPage.h b/WebCore/platform/graphics/android/TiledPage.h index 94306bf..2daf226 100644 --- a/WebCore/platform/graphics/android/TiledPage.h +++ b/WebCore/platform/graphics/android/TiledPage.h @@ -51,6 +51,9 @@ typedef HashMap<TileKey, BaseTile*> TileMap; */ class TiledPage { public: +#ifdef DEBUG_COUNT + static int count(); +#endif TiledPage(int id, GLWebViewState* state); ~TiledPage(); |