GTK for OLPC: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
Line 18: Line 18:
[[Image:torture_screenshot.png|220px|Theme torturer tab]]
[[Image:torture_screenshot.png|220px|Theme torturer tab]]
[[Image:Torture_screenshot2.png|220px|Crash tester tab]]
[[Image:Torture_screenshot2.png|220px|Crash tester tab]]

Right now, I'm integrating the widget profiler's infrastructure into the torturer (nearly finished), and it lets me obtain precise time measures and average times over lots of iterations.


=== A few observations ===
=== A few observations ===
Line 30: Line 32:


I will keep Marco Pesenti Gritti (marcopg) and Dan Williams (dcbw) posted on my progress and coordinate with them.
I will keep Marco Pesenti Gritti (marcopg) and Dan Williams (dcbw) posted on my progress and coordinate with them.

== Simulation Tools ==

I began hacking Xephyr to let it emulate the color swizzling. I can manipulate the RGB buffer but I still have trouble with Xlib to understand how to get the RGB coordinates of a particular pixel and change them (still need to understand the concepts behind colormaps, etc., it is trickier than I thought). I have good hope to make it run in (near) real time (cross my fingers...).

Apart from that, Federico already made a simple "color swizzling" program that operates only on still images (to simulate color swizzling with the DCON chip).


== Various enhancements ==
== Various enhancements ==
Line 45: Line 53:


A (probably final) version of the patch (both for GtkEntry and GtkTreeView) is available [here http://www.manucornet.net/pub/olpc/enhancements/cursor_blink_lifetime.diff].
A (probably final) version of the patch (both for GtkEntry and GtkTreeView) is available [here http://www.manucornet.net/pub/olpc/enhancements/cursor_blink_lifetime.diff].

== Simulation Tools ==

Federico made a simple "color swizzling" program that operates only on still images (to simulate color swizzling with the DCON chip). Plans are to integrate this into Xephyr and make it good enough for real time, but it probably won't be technically possible to run it at more than a few frames per second. Priority given to the theme itself, and I might use only still images for previewing.

Revision as of 12:05, 17 July 2006

This is the wiki page for the "GTK+ for OLPC" project, as a "Summer of Code" project. The student is Manu Cornet, mentor is Federico Mena-Quintero. You can find the initial goals of the project on the OLPC Google Summer of Code page.

GTK theme/engine torturer and crash tester

The application

This "gtk-theme-torturer" is an application to detect performance issues in GTK themes/engines. It does two things:

  • For each of the most common widget types (very easy to add some more), it packs an instance of it in a container, and resizes/redraws it many, many times. You can set a "pain level" to determine the number of times widgets will get redrawn while scaling.
  • It takes each one of the gtk_paint_* functions (implemented by the engines themselves) and tries all possible parameters configurations, including unusual values to see if the engine crashes.

The current version of gtk-theme-torturer is [here http://www.manucornet.net/pub/olpc/gtk-theme-torturer/] (current tarball in the parent directory). The torturer is fully functionnal and mainly finished. Future enhancements :

  • Currently, the detailed log is sent to stdout. It would be more convenient to let the use choose (GtkFileChooser) a log file.
  • Plans are to merge this app with Federico Mena Quintero's Widget Profiler in order to get a detailed analysis of the time that was necessary to allocate/map/redraw/etc. widgets.

Theme torturer tab Crash tester tab

Right now, I'm integrating the widget profiler's infrastructure into the torturer (nearly finished), and it lets me obtain precise time measures and average times over lots of iterations.

A few observations

I've been "torturing" a few themes, here are the first results. Simple high-contrast themes, as well as Clearlooks, behave very well and are pretty fast (still need to use the profiler to get precise time measures). The new Human (Ubuntu Dapper) theme, however, is much slower (especially, in the crash test, on options and checks). Note that all themes crash on a particular parameter set of gtk_draw_handle (GTK_STATE_NORMAL, GTK_SHADOW_NONE, GTK_ORIENTATION_HORIZONTAL, detail = NULL, width = height = 1, area = (0, 0, 1, 1)), still need to figure out why.

GTK+ theme engine

I began hacking the theme by first making it more crash-proof with the torturer. The next big, very big issue, is performance: the theme is much slower than most other popular themes when using the torturer. I still need to make precise time measurements (very soon) with the (torturer + profiler).

The first goal is to match [Diana's mockups http://people.redhat.com/dfong/olpc/] the best I can while making a light/fast theme. An important issue will be to adapt the theme to the hardware constraints (high dpi value, color swizzling, greyscale mode, etc.).

I will keep Marco Pesenti Gritti (marcopg) and Dan Williams (dcbw) posted on my progress and coordinate with them.

Simulation Tools

I began hacking Xephyr to let it emulate the color swizzling. I can manipulate the RGB buffer but I still have trouble with Xlib to understand how to get the RGB coordinates of a particular pixel and change them (still need to understand the concepts behind colormaps, etc., it is trickier than I thought). I have good hope to make it run in (near) real time (cross my fingers...).

Apart from that, Federico already made a simple "color swizzling" program that operates only on still images (to simulate color swizzling with the DCON chip).

Various enhancements

Cursor blinking

I began with this (probably quite simple to do). The purpose is to let the cursor blink for a few seconds, then just stay on and stop blinking (affects GtkEntry and GtkTextView).

This is done by :

  • Adding an XSetting called "gtk-cursor-blink-lifetime", which defaults to 5 seconds.
  • Adding a timeout with the corresponding lifetime each time the code asks the cursor to begin blinking. When the timeout is over, the cursor stays on.

A (probably final) version of the patch (both for GtkEntry and GtkTreeView) is available [here http://www.manucornet.net/pub/olpc/enhancements/cursor_blink_lifetime.diff].