OSDN Git Service

ignore rootlayer when drawing (fixes regression)
authorMike Reed <reed@google.com>
Fri, 26 Feb 2010 19:44:28 +0000 (14:44 -0500)
committerMike Reed <reed@google.com>
Fri, 26 Feb 2010 19:44:28 +0000 (14:44 -0500)
dump layers contents in displayTree.txt

WebCore/platform/graphics/android/LayerAndroid.cpp
WebKit/android/nav/WebView.cpp

index 9bd5a78..9d5d1ec 100644 (file)
@@ -295,9 +295,6 @@ void LayerAndroid::onDraw(SkCanvas* canvas, SkScalar opacity) {
         canvas->clipRect(r);
     }
 
-    if (!m_isRootLayer)
-        return;
-
     if (!prepareContext())
         return;
 
@@ -456,6 +453,11 @@ void LayerAndroid::dumpLayers(FILE* file, int indentLevel) const
     writeIntVal(file, indentLevel + 1, "fixedWidth", m_fixedWidth);
     writeIntVal(file, indentLevel + 1, "fixedHeight", m_fixedHeight);
 
+    if (m_recordingPicture) {
+        writeIntVal(file, indentLevel + 1, "picture width", m_recordingPicture->width());
+        writeIntVal(file, indentLevel + 1, "picture height", m_recordingPicture->height());
+    }
+
     if (countChildren()) {
         writeln(file, indentLevel + 1, "children = [");
         for (int i = 0; i < countChildren(); i++) {
index bcc6c26..0b4adc7 100644 (file)
@@ -1080,7 +1080,7 @@ int moveGeneration()
     return m_viewImpl->m_moveGeneration;
 }
 
-const LayerAndroid* rootLayer() const
+LayerAndroid* rootLayer() const
 {
     return m_rootLayer;
 }
@@ -1776,6 +1776,11 @@ static void nativeDumpDisplayTree(JNIEnv* env, jobject jwebview, jstring jurl)
             // this will playback the picture into the canvas, which will
             // spew its contents to the dumper
             view->getWebViewCore()->drawContent(&canvas, 0);
+            if (true) {
+                LayerAndroid* rootLayer = view->rootLayer();
+                if (rootLayer)
+                    rootLayer->draw(&canvas);
+            }
             // we're done with the file now
             fwrite("\n", 1, 1, file);
             fclose(file);