Platform/GFX/LayerScope: Difference between revisions

From MozillaWiki
< Platform‎ | GFX
Jump to navigation Jump to search
 
(40 intermediate revisions by 6 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''':
* 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 ===
: [http://people.mozilla.org/~vladimir/tools/layerscope/layerview.html Viewer Tool]
* LayerScope Viewer
: [https://github.com/vvuk/layerscope Viewer Source Code]
** [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]
** [https://github.com/BorisChiou/LayerScope-Addon/tree/legacy Layerscope Addon]


=== Connecting to Layer Scope ===
=== Connecting to Layer Scope ===
For the implementation, it creates a raw socket where it sends some simple framed data to.  You need to set up a tool called  [https://github.com/kanaka/websockify websockify] to expose this as a websocket API, and then use the viewer tool to view the data.
NOTE: from changeset [https://hg.mozilla.org/mozilla-central/rev/5f8d42207dfd] we removed dependency of websockify.
 
'''Desktop Example''':
To connect to local layerscope, start websockify, such as:


    python ./websockify/websockify.py localhost:23457 localhost:23456
Note: If you use Layerscope Addon, just clink the addon button, select the device, and press '''connect'''.
      It's much easier.


The first parameter is the address that the viewer app will connect to; the second parameter is the address that gecko will be listening for connections on.
For the implementation, it creates a websocket where it sends some simple framed data to. Just using the viewer tool to view the data.


Replace <tt>ws://192.168.112.129:23457</tt> with <tt>ws://localhost:23457</tt>, and press connect.
* '''Desktop Example''':
To connect to local layerscope, just press connect to '''<tt>ws://localhost:23456</tt>'''.


'''B2G Example''':
Note: If you want to change '''gfx.layerscope.port''' on your nightly browser, please revise
You need to find the address of your B2G device. To that effect, you can do:
      the connection address, for example, set the port to '''23457''', and then use the address  
      '''ws://localhost:23457''' on the layerscope tool page.


adb shell netcfg
* '''B2G Example''':
Just use adb forward to forward your host port to a target port. (The default value is 23456.)


Replace <tt>localhost:23456</tt> with address of B2G device. Eg. If device has address 192.168.1.22
adb forward tcp:23456 tcp:23456


    python ./websockify/websockify.py localhost:23457 192.168.1.22:23456
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>'''.

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.