summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/rendering
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-05-18 17:02:33 -0700
committerChris Craik <ccraik@google.com>2012-05-18 17:02:33 -0700
commit48605bf1f6bc77a1f037f23285baf7706f45d198 (patch)
tree0118a279c6af10fed342b9816c35f761a117bc46 /Source/WebCore/platform/graphics/android/rendering
parentd423988553ea721896b4ac1d3720ed04332ebbb3 (diff)
downloadexternal_webkit-48605bf1f6bc77a1f037f23285baf7706f45d198.zip
external_webkit-48605bf1f6bc77a1f037f23285baf7706f45d198.tar.gz
external_webkit-48605bf1f6bc77a1f037f23285baf7706f45d198.tar.bz2
Remove paint tile operations for stale painters
bug:6516612 also adds ClassTracker to several classes Change-Id: I9a503084240d4935fba300a3256d266a2982dcc0
Diffstat (limited to 'Source/WebCore/platform/graphics/android/rendering')
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/PaintTileOperation.cpp7
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp7
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp8
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h3
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp7
5 files changed, 30 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/PaintTileOperation.cpp b/Source/WebCore/platform/graphics/android/rendering/PaintTileOperation.cpp
index 87096b0..3fcbdb2 100644
--- a/Source/WebCore/platform/graphics/android/rendering/PaintTileOperation.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/PaintTileOperation.cpp
@@ -30,6 +30,7 @@
#include "PaintTileOperation.h"
#include "AndroidLog.h"
+#include "ClassTracker.h"
#include "GLWebViewState.h"
#include "ImageTexture.h"
#include "ImagesManager.h"
@@ -49,6 +50,9 @@ PaintTileOperation::PaintTileOperation(Tile* tile, TilePainter* painter,
if (m_tile)
m_tile->setRepaintPending(true);
SkSafeRef(m_painter);
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->increment("PaintTileOperation");
+#endif
}
PaintTileOperation::~PaintTileOperation()
@@ -64,6 +68,9 @@ PaintTileOperation::~PaintTileOperation()
} else {
SkSafeUnref(m_painter);
}
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->decrement("PaintTileOperation");
+#endif
}
bool PaintTileOperation::operator==(const QueuedOperation* operation)
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp
index 78a9861..fcd9655 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp
@@ -31,6 +31,7 @@
#include "AndroidLog.h"
#include "Color.h"
+#include "ClassTracker.h"
#include "GLWebViewState.h"
#include "LayerAndroid.h"
@@ -46,6 +47,9 @@ SurfaceBacking::SurfaceBacking(bool isBaseSurface)
m_scale = -1;
m_futureScale = -1;
m_zooming = false;
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->increment("SurfaceBacking");
+#endif
}
SurfaceBacking::~SurfaceBacking()
@@ -53,6 +57,9 @@ SurfaceBacking::~SurfaceBacking()
delete m_frontTileGrid;
delete m_backTileGrid;
delete m_lowResTileGrid;
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->decrement("SurfaceBacking");
+#endif
}
void SurfaceBacking::prepareGL(GLWebViewState* state, bool allowZoom,
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp
index 0e5c3ba..f577d46 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp
@@ -33,7 +33,7 @@
#include "BaseLayerAndroid.h"
#include "ClassTracker.h"
#include "GLWebViewState.h"
-#include "BaseLayerAndroid.h"
+#include "PaintTileOperation.h"
#include "Surface.h"
#include "ScrollableLayerAndroid.h"
#include "TilesManager.h"
@@ -175,6 +175,12 @@ bool SurfaceCollection::isMissingBackgroundContent()
return m_surfaces[0]->isMissingContent();
}
+void SurfaceCollection::removePainterOperations()
+{
+ for (unsigned int i = 0; i < m_surfaces.size(); i++)
+ TilesManager::instance()->removeOperationsForFilter(new TilePainterFilter(m_surfaces[i]));
+}
+
void SurfaceCollection::computeTexturesAmount(TexturesResult* result)
{
for (unsigned int i = 0; i < m_surfaces.size(); i++)
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h
index 7088bec..ff4195f 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h
@@ -47,7 +47,7 @@ public:
SurfaceCollection(BaseLayerAndroid* compositedRoot);
virtual ~SurfaceCollection();
- // Tiled painting methods (executed on groups)
+ // Tiled painting methods (executed on Surfaces)
void prepareGL(const SkRect& visibleContentRect, bool tryToFastBlit = false);
bool drawGL(const SkRect& visibleContentRect);
Color getBackgroundColor();
@@ -56,6 +56,7 @@ public:
bool isReady();
bool isBaseSurfaceReady();
bool isMissingBackgroundContent();
+ void removePainterOperations();
void computeTexturesAmount(TexturesResult* result);
// Recursive tree methods (animations, invals, etc)
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
index 5abca02..724bf89 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
@@ -69,6 +69,7 @@ void SurfaceCollectionManager::swap()
if (m_drawingCollection) {
ALOGV("destroying drawing collection %p", m_drawingCollection);
m_drawingCollection->addFrameworkInvals();
+ m_drawingCollection->removePainterOperations();
SkSafeUnref(m_drawingCollection);
}
@@ -93,6 +94,12 @@ void SurfaceCollectionManager::swap()
// clear all of the content in the three collections held by the collection manager
void SurfaceCollectionManager::clearCollections()
{
+ // remove all painting operations, since they're no longer relevant
+ if (m_drawingCollection)
+ m_drawingCollection->removePainterOperations();
+ if (m_paintingCollection)
+ m_paintingCollection->removePainterOperations();
+
SkSafeUnref(m_drawingCollection);
m_drawingCollection = 0;
SkSafeUnref(m_paintingCollection);