Title: [269066] trunk/Source/WebKitLegacy/win
Revision
269066
Author
[email protected]
Date
2020-10-27 12:53:43 -0700 (Tue, 27 Oct 2020)

Log Message

[WinCairo][WK1] Implement WebView::layerTreeAsString
https://bugs.webkit.org/show_bug.cgi?id=218217

Reviewed by Don Olmstead.

The menu item "Show Layer Tree" didn't work in WinCairo WebKit1
MiniBrowser.

* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::layerTreeAsString const): Added.
* WebCoreSupport/AcceleratedCompositingContext.h:
* WebView.cpp:
(WebView::layerTreeAsString): Added code for USE(TEXTURE_MAPPER_GL).

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (269065 => 269066)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2020-10-27 19:53:22 UTC (rev 269065)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2020-10-27 19:53:43 UTC (rev 269066)
@@ -1,3 +1,19 @@
+2020-10-27  Fujii Hironori  <[email protected]>
+
+        [WinCairo][WK1] Implement WebView::layerTreeAsString
+        https://bugs.webkit.org/show_bug.cgi?id=218217
+
+        Reviewed by Don Olmstead.
+
+        The menu item "Show Layer Tree" didn't work in WinCairo WebKit1
+        MiniBrowser.
+
+        * WebCoreSupport/AcceleratedCompositingContext.cpp:
+        (AcceleratedCompositingContext::layerTreeAsString const): Added.
+        * WebCoreSupport/AcceleratedCompositingContext.h:
+        * WebView.cpp:
+        (WebView::layerTreeAsString): Added code for USE(TEXTURE_MAPPER_GL).
+
 2020-10-27  Tetsuharu Ohzeki  <[email protected]>
 
         Make WebCore::FocusDirection to enum class

Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp (269065 => 269066)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp	2020-10-27 19:53:22 UTC (rev 269065)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp	2020-10-27 19:53:43 UTC (rev 269066)
@@ -333,4 +333,12 @@
     return m_webView.deviceScaleFactor();
 }
 
+String AcceleratedCompositingContext::layerTreeAsString() const
+{
+    if (!m_rootLayer)
+        return { };
+
+    return m_rootLayer->layerTreeAsText(LayerTreeAsTextShowAll);
+}
+
 #endif // USE(TEXTURE_MAPPER_GL)

Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.h (269065 => 269066)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.h	2020-10-27 19:53:22 UTC (rev 269065)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.h	2020-10-27 19:53:43 UTC (rev 269066)
@@ -66,6 +66,8 @@
     bool flushPendingLayerChangesSoon();
     void scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
 
+    String layerTreeAsString() const;
+
 private:
     WebView& m_webView;
     std::unique_ptr<WebCore::GLContext> m_context;

Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (269065 => 269066)


--- trunk/Source/WebKitLegacy/win/WebView.cpp	2020-10-27 19:53:22 UTC (rev 269065)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp	2020-10-27 19:53:43 UTC (rev 269066)
@@ -7878,11 +7878,14 @@
         return S_OK;
 
     String tree = m_layerTreeHost->layerTreeAsString();
-
+#elif USE(TEXTURE_MAPPER_GL)
+    if (!isAcceleratedCompositing())
+        return S_OK;
+    String tree = m_acceleratedCompositingContext->layerTreeAsString();
+#endif
     *treeBstr = BString(tree).release();
     if (!*treeBstr && tree.length())
         return E_OUTOFMEMORY;
-#endif
 
     return S_OK;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to