Platform/GFX/LayerScope

From MozillaWiki
< Platform‎ | GFX
Revision as of 07:34, 3 December 2013 by DanGlastonbury (talk | contribs) (Created page with " == 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 m...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 and 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