summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp9
-rw-r--r--Source/WebCore/platform/graphics/android/LayerAndroid.cpp46
-rw-r--r--Source/WebCore/platform/graphics/android/LayerAndroid.h5
3 files changed, 56 insertions, 4 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
index 095ada7..a09eb35 100644
--- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
@@ -332,11 +332,12 @@ bool BaseLayerAndroid::drawGL(LayerAndroid* compositedRoot,
compositedRoot->setScale(scale);
#ifdef DEBUG
- int size = compositedRoot->countTextureSize();
- int nbLayers = compositedRoot->nbLayers();
- XLOG("We are using %d Mb for %d layers", size / 1024 / 1024, nbLayers);
- compositedRoot->showLayers();
+ compositedRoot->showLayer(0);
+ XLOG("We have %d layers, %d textured",
+ compositedRoot->nbLayers(),
+ compositedRoot->nbTexturedLayers());
#endif
+
// Clean up GL textures for video layer.
TilesManager::instance()->videoLayerManager()->deleteUnusedTextures();
diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp
index 947a0fc..05cb85e 100644
--- a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp
@@ -659,6 +659,52 @@ IntRect LayerAndroid::clippedRect() const
return rect;
}
+int LayerAndroid::nbLayers()
+{
+ int nb = 0;
+ int count = this->countChildren();
+ for (int i = 0; i < count; i++)
+ nb += this->getChild(i)->nbLayers();
+ return nb+1;
+}
+
+int LayerAndroid::nbTexturedLayers()
+{
+ int nb = 0;
+ int count = this->countChildren();
+ for (int i = 0; i < count; i++)
+ nb += this->getChild(i)->nbTexturedLayers();
+ if (needsTexture())
+ nb++;
+ return nb;
+}
+
+void LayerAndroid::showLayer(int indent)
+{
+ char spaces[256];
+ memset(spaces, 0, 256);
+ for (unsigned int i = 0; i < indent; i++)
+ spaces[i] = ' ';
+
+ if (!indent)
+ XLOGC("\n\n--- LAYERS TREE ---");
+
+ IntRect r(0, 0, getWidth(), getHeight());
+ IntRect tr = m_drawTransform.mapRect(r);
+ XLOGC("%s [%d:0x%x] - %s - (%d, %d, %d, %d) %s prepareContext(%d), pic w: %d h: %d",
+ spaces, uniqueId(), m_owningLayer,
+ needsTexture() ? "needs a texture" : "no texture",
+ tr.x(), tr.y(), tr.width(), tr.height(),
+ contentIsScrollable() ? "SCROLLABLE" : "",
+ prepareContext(),
+ m_recordingPicture ? m_recordingPicture->width() : -1,
+ m_recordingPicture ? m_recordingPicture->height() : -1);
+
+ int count = this->countChildren();
+ for (int i = 0; i < count; i++)
+ this->getChild(i)->showLayer(indent + 1);
+}
+
void LayerAndroid::assignTexture(LayerAndroid* oldTree)
{
int count = this->countChildren();
diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.h b/Source/WebCore/platform/graphics/android/LayerAndroid.h
index 15c7e0f..c4ed9fe 100644
--- a/Source/WebCore/platform/graphics/android/LayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/LayerAndroid.h
@@ -114,6 +114,11 @@ public:
virtual bool needsTexture();
+ // Debug helper methods
+ int nbLayers();
+ int nbTexturedLayers();
+ void showLayer(int indent);
+
void setScale(float scale);
float getScale() { return m_scale; }
virtual bool drawGL(GLWebViewState*, SkMatrix&);