diff options
author | Chris Craik <ccraik@google.com> | 2012-05-21 14:27:56 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-05-21 14:27:56 -0700 |
commit | b8c4cb7fb8272759e5758b57ff84e403b1c692e3 (patch) | |
tree | 577d9bc2b100d2aff7ba48287e0d3fc3f41826f1 | |
parent | 34cffb2c52db9a9ae5a7debff0ba6b43cbde04e1 (diff) | |
parent | 6718ce8aa305996bd53ef3836f5ed057b5180cd8 (diff) | |
download | external_webkit-b8c4cb7fb8272759e5758b57ff84e403b1c692e3.zip external_webkit-b8c4cb7fb8272759e5758b57ff84e403b1c692e3.tar.gz external_webkit-b8c4cb7fb8272759e5758b57ff84e403b1c692e3.tar.bz2 |
am 6718ce8a: am 48605bf1: Remove paint tile operations for stale painters
* commit '6718ce8aa305996bd53ef3836f5ed057b5180cd8':
Remove paint tile operations for stale painters
7 files changed, 46 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp index 3241a61..a0a1b58 100644 --- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp @@ -31,6 +31,7 @@ #include "AndroidLog.h" #include "CachedImage.h" +#include "ClassTracker.h" #include "DrawQuadData.h" #include "FixedPositioning.h" #include "GLWebViewState.h" @@ -117,6 +118,10 @@ FixedBackgroundImageLayerAndroid::FixedBackgroundImageLayerAndroid(PassRefPtr<Re setFixedPosition(position); position->setPosition(left, top); + +#ifdef DEBUG_COUNT + ClassTracker::instance()->increment("FixedBackgroundImageLayerAndroid"); +#endif } FixedBackgroundImageLayerAndroid::FixedBackgroundImageLayerAndroid(const FixedBackgroundImageLayerAndroid& layer) @@ -124,6 +129,16 @@ FixedBackgroundImageLayerAndroid::FixedBackgroundImageLayerAndroid(const FixedBa , m_width(layer.m_width) , m_height(layer.m_height) { +#ifdef DEBUG_COUNT + ClassTracker::instance()->increment("FixedBackgroundImageLayerAndroid"); +#endif +} + +FixedBackgroundImageLayerAndroid::~FixedBackgroundImageLayerAndroid() +{ +#ifdef DEBUG_COUNT + ClassTracker::instance()->decrement("FixedBackgroundImageLayerAndroid"); +#endif } static bool needToDisplayImage(bool repeatX, bool repeatY, float dx, float dy) diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h index 9ce8a07..55b4b21 100644 --- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h @@ -65,6 +65,7 @@ class FixedBackgroundImageLayerAndroid : public LayerAndroid { public: FixedBackgroundImageLayerAndroid(PassRefPtr<RenderStyle> style, int w, int h); FixedBackgroundImageLayerAndroid(const FixedBackgroundImageLayerAndroid& layer); + virtual ~FixedBackgroundImageLayerAndroid(); virtual LayerAndroid* copy() const { return new FixedBackgroundImageLayerAndroid(*this); } virtual bool needsTexture() { return true; } virtual SubclassType subclassType() const { return LayerAndroid::FixedBackgroundImageLayer; } 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); |