Changes

Jump to: navigation, search

Platform/GFX/Quantum Render

1,600 bytes added, 16:14, 26 April 2019
Android: Add documentation about the WR debugger, minor other cleanups
to build and install. You will need to enable WR by setting <tt>gfx.webrender.all</tt> to true either via <tt>about:config</tt> or in a [[Platform/Platform-specific_build_defines#Prefs_files|prefs file]] that is used by GeckoView. If you change any Rust/C++ code, you need to re-run <tt>./mach build binaries && ./mach package && ./mach android install-geckoview_example</tt> to get the updates on-device.
=== Debugging with Android Studio ===
The Android Studio instructions on the [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_for_Android_build#Developing_Firefox_for_Android_in_Android_Studio build instructions] page work for the GeckoView Example App, as long as you choose the "geckoview_example" run configuration instead of the "app" run configuration. Debugging of Java and C++ code works in both the parent process and the content process, if you add this to your <tt>~/.lldbinit</tt> file:
Note that to debug a content process, you have to attach to it explicitly. After starting the app in a debug configuration from Android Studio, click on the "Attach debugger to Android process" icon (tall rectangle with a bug on it) in the toolbar and select the process you want to attach to. You can be attached to multiple processes at the same time.
 
=== Debugging with the WebRender Debugger ===
 
WebRender has a built-in debug server that can be interacted with a browser-based frontend. This debugger can let you toggle debug flags in WebRender, as well as extract some of WR's internal data structures "live". The browser-based frontend can be opened by pointing your browser to the `gfx/wr/debugger/index.html` file, and navigating the different panes will give you an idea of what kinds of things it can do.
 
The debug server in WebRender is not built or enabled by default. To build it, you need to add `ac_add_options --enable-webrender-debugger` to your mozconfig file. And to enable it, you need to set the `gfx.webrender.start-debug-server` pref to true. All WR renderer instances created after this pref is enabled will start a separate instance of the debug server. On desktop, this means new browser windows opened after the pref is enabled will each have a debug server, although in practice only the first will be able to acquire the port and the rest will fail. On mobile (for example in the GVE) the pref needs to be set during startup for the WR renderer instance to start the debug server.
 
Once you have the debug server enabled, you need to ensure the frontend can talk to it. If you are running the frontend and WR on the same machine this should just work. For debugging WR on Android, you will generally load the frontend on a desktop, and will need to use `adb forward tcp:3583 tcp:3583` to port-forward the connection to the device being debugged. Then click on the "Connect" button in the frontend and you should be good to go.
=== Bisecting ===
=== Captures ===
As of {{bug|1508652}}, it It is be possible to get WR captures from GeckoView-based products that have WR enabled. To trigger the capture, you need to run the product (e.g. GVE) with the <tt>devtools.remote.usb.enabled</tt> pref enabled, and use <tt>Web Developer > WebIDE</tt> in Firefox desktop to connect to the phone. In the "Main Process" browser console, run this command:
window.windowUtils.wrCapture();
Confirm
586
edits

Navigation menu