summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android/LayerAndroid.cpp
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2011-01-30 15:34:46 -0800
committerNicolas Roard <nicolas@android.com>2011-01-30 17:11:52 -0800
commitda44133fe92ec11fa6b904c498e7e5cd23a43cbf (patch)
tree9fb27831c884476be59161bd16fd0427412a1865 /WebCore/platform/graphics/android/LayerAndroid.cpp
parent49e6e531daf99d2349caab00380648b689e7c1dc (diff)
downloadexternal_webkit-da44133fe92ec11fa6b904c498e7e5cd23a43cbf.zip
external_webkit-da44133fe92ec11fa6b904c498e7e5cd23a43cbf.tar.gz
external_webkit-da44133fe92ec11fa6b904c498e7e5cd23a43cbf.tar.bz2
Add a ClassTracker class to more easily track leaks
bug:3376517 Change-Id: Ieb419bc3140963ccbda3e2f130778ec53b2920aa
Diffstat (limited to 'WebCore/platform/graphics/android/LayerAndroid.cpp')
-rw-r--r--WebCore/platform/graphics/android/LayerAndroid.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp
index 277840d..5d6d8ff 100644
--- a/WebCore/platform/graphics/android/LayerAndroid.cpp
+++ b/WebCore/platform/graphics/android/LayerAndroid.cpp
@@ -4,6 +4,7 @@
#if USE(ACCELERATED_COMPOSITING)
#include "AndroidAnimation.h"
+#include "ClassTracker.h"
#include "DrawExtra.h"
#include "GLUtils.h"
#include "MediaLayer.h"
@@ -38,14 +39,8 @@
namespace WebCore {
-static int gDebugLayerAndroidInstances;
static int gUniqueId;
-inline int LayerAndroid::instancesCount()
-{
- return gDebugLayerAndroidInstances;
-}
-
class OpacityDrawFilter : public SkDrawFilter {
public:
OpacityDrawFilter(int opacity) : m_opacity(opacity) { }
@@ -87,7 +82,9 @@ LayerAndroid::LayerAndroid(bool isRootLayer) : SkLayer(),
m_preserves3D = false;
m_dirty = false;
- gDebugLayerAndroidInstances++;
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->increment("LayerAndroid");
+#endif
}
LayerAndroid::LayerAndroid(const LayerAndroid& layer) : SkLayer(layer),
@@ -134,7 +131,9 @@ LayerAndroid::LayerAndroid(const LayerAndroid& layer) : SkLayer(layer),
for (KeyframesMap::const_iterator it = layer.m_animations.begin(); it != end; ++it)
m_animations.add((it->second)->name(), (it->second)->copy());
- gDebugLayerAndroidInstances++;
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->increment("LayerAndroid");
+#endif
}
LayerAndroid::LayerAndroid(SkPicture* picture) : SkLayer(),
@@ -153,7 +152,9 @@ LayerAndroid::LayerAndroid(SkPicture* picture) : SkLayer(),
m_backgroundColor = 0;
m_dirty = false;
SkSafeRef(m_recordingPicture);
- gDebugLayerAndroidInstances++;
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->increment("LayerAndroid");
+#endif
}
void LayerAndroid::removeTexture(BackedDoubleBufferedTexture* aTexture)
@@ -188,7 +189,9 @@ LayerAndroid::~LayerAndroid()
m_contentsImage->safeUnref();
m_recordingPicture->safeUnref();
m_animations.clear();
- gDebugLayerAndroidInstances--;
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->decrement("LayerAndroid");
+#endif
}
static int gDebugNbAnims = 0;