Platform/GFX/LayerScope: Difference between revisions

< Platform‎ | GFX
No edit summary
 
(26 intermediate revisions by 5 users not shown)
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''': run <tt>./edit-prefs.sh</tt> and add
'''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
  add user_pref("gfx.layerscope.enabled", true);
  add user_pref("network.gonk.manage-offline-status", false);
Save and exit.


    user_pref("gfx.layerscope.enabled", true);
=== Enabling Display List Dump ===
    user_pref("network.gonk.manage-offline-status", false);
After {{Bug|1061393}} and {{Bug|1193834}} landed, layerscope is able to present display list information on the viewer. To enable this feature, you have to enable "layout.display-list.dump" preference manually.
* B2G
There are two ways on B2G to enable display list dump.
  ./edit-prefs.sh
  user_pref("layout.display-list.dump", true);


Save and exit.
  Or, in Settings app, check "dump display list"
  Developer->Dump Display List
* All the others
  go to <u>about:config</u>
  set layout.display-list.dump as true.


=== Application ===
=== Application ===
* LayerScope Viewer
* LayerScope Viewer
** [http://mozilla.github.io/layerscope Stable Viewer Tool.]
** [http://cjku.github.io/layerscope Beta Viewer Tool. (CJ's github)]
** [https://github.com/mozilla/layerscope Viewer Source Code]
** [https://github.com/mephisto41/LayerScope-Addon Layerscope Addon]
* LayerScope Viewer (Depreciated)
** [http://people.mozilla.org/~vladimir/tools/layerscope/layerview.html Viewer Tool]
** [http://people.mozilla.org/~vladimir/tools/layerscope/layerview.html Viewer Tool]
** [https://github.com/vvuk/layerscope Viewer Source Code]
** [https://github.com/BorisChiou/LayerScope-Addon/tree/legacy Layerscope Addon]
** [https://github.com/mephisto41/LayerScope-Addon Layerscope Addon]
* LayerScope Viewer by google protocol buffer (after 2014/07/12) ([https://hg.mozilla.org/mozilla-central/rev/6808a2c6eab4 Changeset])
** [http://people.mozilla.org/~bchiou/layerscope/layerview.html Viewer Tool (by Google protocol buffer)]
** [https://github.com/mozilla/layerscope Viewer Source Code (by Google protocol buffer)]


=== Connecting to Layer Scope ===
=== Connecting to Layer Scope ===
NOTE!: from changeset [https://hg.mozilla.org/mozilla-central/rev/5f8d42207dfd] we removed dependency of websockify.
NOTE: from changeset [https://hg.mozilla.org/mozilla-central/rev/5f8d42207dfd] 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.
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''':
* '''Desktop Example''':
To connect to local layerscope
To connect to local layerscope, just press connect to '''<tt>ws://localhost:23456</tt>'''.
 
Replace <tt>ws://192.168.112.129:23456</tt> with <tt>ws://localhost:23456</tt>, and press connect.


  Note: If you want to change '''gfx.layerscope.port''' on your nightly browser, please revise
  Note: If you want to change '''gfx.layerscope.port''' on your nightly browser, please revise
Line 41: Line 64:
       '''ws://localhost:23457''' on the layerscope tool page.
       '''ws://localhost:23457''' on the layerscope tool page.


'''B2G Example''':
* '''B2G Example''':
You need to find the address of your B2G device. To that effect, you can do:
Just use adb forward to forward your host port to a target port. (The default value is 23456.)
 
adb shell netcfg


Replace <tt>ws://192.168.112.129:23456</tt> with address of B2G device, and press connect
adb forward tcp:23456 tcp:23456


Note: Or you can do "'''adb forward tcp:23456 tcp:23456'''", the first argument is the host  
The first argument is the host port and the second one is the target port. And then press connect to '''<tt>ws://localhost:23456</tt>'''.
      port and the second one is the target port. And then, just press connect to  
      '''ws://localhost:23456'''

Latest revision as of 05:35, 8 September 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
  add user_pref("gfx.layerscope.enabled", true);
  add user_pref("network.gonk.manage-offline-status", false);

Save and exit.

Enabling Display List Dump

After bug 1061393 and bug 1193834 landed, layerscope is able to present display list information on the viewer. To enable this feature, you have to enable "layout.display-list.dump" preference manually.

  • B2G

There are two ways on B2G to enable display list dump.

 ./edit-prefs.sh
 user_pref("layout.display-list.dump", true);
 Or, in Settings app, check "dump display list"
 Developer->Dump Display List
  • All the others
 go to 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.