Platform/GFX/LayerScope: Difference between revisions

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


'''B2G Example''':
'''B2G Example''':
You need to find the address of your B2G device and replace <tt>localhost:23456</tt> with address of B2G device. Eg. If device has address 192.168.1.22
You need to find the address of your B2G device. To that effect, you can do:
 
adb shell netcfg
 
Replace <tt>localhost:23456</tt> with address of B2G device. Eg. If device has address 192.168.1.22


     python ./websockify/websockify.py localhost:23457 192.168.1.22:23456
     python ./websockify/websockify.py localhost:23457 192.168.1.22:23456

Revision as of 14:26, 10 December 2013

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: go to about:config and set gfx.layerscope.enabled to true.

B2G: run ./edit-prefs.sh and add

   user_pref("gfx.layerscope.enabled", true);
   user_pref("network.gonk.manage-offline-status", false);

Save and exit.

Application

Viewer Tool
Viewer Source Code

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 websockify to expose this as a websocket API, and then use the viewer tool to view the data.

Desktop Example: To connect to local layerscope, start websockify, such as:

   python ./websockify/websockify.py localhost:23457 localhost:23456

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.

Replace ws://192.168.112.129:23457 with ws://localhost:23457, and press connect.

B2G Example: You need to find the address of your B2G device. To that effect, you can do:

adb shell netcfg

Replace localhost:23456 with address of B2G device. Eg. If device has address 192.168.1.22

   python ./websockify/websockify.py localhost:23457 192.168.1.22:23456