Platform/GFX/LayerScope: Difference between revisions

From MozillaWiki
< Platform‎ | GFX
Jump to navigation Jump to search
Line 8: Line 8:


=== Enabling Layer Scope ===
=== Enabling Layer Scope ===
'''Desktop''': go to <u>about:config</u> and set <tt>gfx.layerscope.enabled</tt> to '''true'''.
'''Desktop''':
*Note: On linux, please also set <tt>layers.offmainthreadcomposition.enabled</tt> (enabled by default on Mac) and <tt>layers.acceleration.force-enabled</tt> to '''true'''. However, you don't have to change these two configs on Mac.
* Linux
  go to <u>about:config</u>
  set <tt>gfx.layerscope.enabled</tt> to '''true'''.
  set <tt>layers.offmainthreadcomposition.enabled</tt> to '''true'''.
  set <tt>layers.acceleration.force-enabled</tt> to '''true'''.
* Mac/ Windows
  go to <u>about:config</u>
  set <tt>gfx.layerscope.enabled</tt> to '''true'''.


'''B2G''':  
'''B2G''':  
* Go to the Developer in Settings and click "Dump layerscope" to enable Layerscope
* Go to the Developer in Settings and click "Dump layerscope" to enable Layerscope
* If your working branch doesn't have this item to enable it, please go with the following step
* If your working branch doesn't have this item to enable it, please go with the following step
Line 19: Line 25:
   user_pref("network.gonk.manage-offline-status", false);
   user_pref("network.gonk.manage-offline-status", false);
Save and exit.
Save and exit.
=== Enabling Display List Dump ===
=== Enabling Display List Dump ===
After {{Bug|1061393}} landing, we can have display list information revealing on the LayerScope viewer. To enable this feature, you need to enable "layout.display-list.dump" preference
After {{Bug|1061393}} landing, we can have display list information revealing on the LayerScope viewer. To enable this feature, you need to enable "layout.display-list.dump" preference

Revision as of 07:55, 4 August 2015

Layer Scope

Description

Vlad wrote:

While debugging a bug last week, I wrote a thing I'm calling LayerScope. It does real-time dumping of data from a layer manager. I did the initial implementation in the OGL layer manager, dumping relevant texture data from the various layers in the b2g compositor process. Hasn't been tested anywhere else, but should also work fine for Android. The same approach can be expanded out to other layers backends.


Enabling Layer Scope

Desktop:

  • Linux
 go to about:config
 set gfx.layerscope.enabled to true.
 set layers.offmainthreadcomposition.enabled to true.
 set layers.acceleration.force-enabled to true.
  • Mac/ Windows
 go to about:config
 set gfx.layerscope.enabled to true.

B2G:

  • Go to the Developer in Settings and click "Dump layerscope" to enable Layerscope
  • If your working branch doesn't have this item to enable it, please go with the following step
  run ./edit-prefs.sh and add
  user_pref("gfx.layerscope.enabled", true);
  user_pref("network.gonk.manage-offline-status", false);

Save and exit.

Enabling Display List Dump

After bug 1061393 landing, we can have display list information revealing on the LayerScope viewer. To enable this feature, you need to enable "layout.display-list.dump" preference

  • B2G
 ./edit-prefs.sh
 user_pref("layout.display-list.dump", true);
  • All the others
 about:config
 set layout.display-list.dump as true.

Application

Connecting to Layer Scope

NOTE: from changeset [1] we removed dependency of websockify.

Note: If you use Layerscope Addon, just clink the addon button, select the device, and press connect.
      It's much easier.

For the implementation, it creates a websocket where it sends some simple framed data to. Just using the viewer tool to view the data.

  • Desktop Example:

To connect to local layerscope, just press connect to ws://localhost:23456.

Note: If you want to change gfx.layerscope.port on your nightly browser, please revise
      the connection address, for example, set the port to 23457, and then use the address 
      ws://localhost:23457 on the layerscope tool page.
  • B2G Example:

Just use adb forward to forward your host port to a target port. (The default value is 23456.)

adb forward tcp:23456 tcp:23456

The first argument is the host port and the second one is the target port. And then press connect to ws://localhost:23456.