Hacking for OLPC


Some news of what I’ve been working on lately, on my summer of code project (thanks Google !) for the One Laptop Per Child project.

Gtk Theme/engine Torturer The GTK theme for the laptop needs to be fast and stable. That’s why I’ve been coding a “GTK Theme/engine Torturer” application, to make all quick-hacked themes suffer (<sadistic grin>). It basically does two things. First, it takes the most commonly used types of widgets and resize/redraw them lots of times; this would be the “Torturer” part, which looks like this:


See the suffering widget? Glaaah, I like that (<shiny eyes>). Notice that it produces detailed time measures about how much time was needed to create/map/redraw/destroy the widget (thanks to Federico’s widget profiler infrastructure, which I tweaked a little for the torturer). The second thing it does is that it calls every basic drawing function GTK has (the gtk_paint_* ones) with unusual, even weird parameters to make the engine (<excited lip-licking>) crash. Oh yeah. That’s what it looks like:

Crash Test

This would be the “Crash test” part. The program outputs a very detailed output of what it is doing, so that you know which particular function made the engine crash, with which set of parameters.

Laptop display simulation

One of the smart things with the laptop display is the DCON chip that allows the screen to keep being refreshed while the CPU is suspended, in order to save power. The laptop has a “color swizzling” mode in which the DCON chip only keeps the red part of the signal for the first pixel, the green part for the second pixel, blue for the third, etc., like this:

Color swizzling

This has a lot of benefits from a hardware point of view, but it makes the UI design a little trickier since small objects like thin lines or small fonts don’t look very good. In order to be able to preview what it will look like while designing Sugar, I hacked Xephyr to enable color swizzling. Here’s what Firefox looks like in this mode (automatic picture resizing might make the screenshot look really weird, make sure you view it at 100%):

Swizzled Firefox

Actually, this is not very loyal to the actual display, because it will have much more luminosity than that (it is darker simply because the color swizzling discards approximately two thirds of the signal), but it is probably good enough for previewing and designing purposes. If you zoom into the window close enough, you will see the same arrangement of red/green/blue pixels as described above. Now, because I enjoy torturing the poor GTK themes so much (ahem), here’s another screenshot of the crash test, with the swizzled flavor:

Swizzled crash test


Apart from these, I’ve also been hacking around a little bit, making a patch for GTK+ to let the input cursor (in entries and text views) stop blinking (and stay on) after a few seconds (so that the display can stay completely still), or making the current version of the OLPC theme a bit more crash-proof. More information on the project’s wiki page. All the code mentionned above is available from here. Thanks very very much to Federico who is being a great mentor, always available when I need his advice/help (as you can guess, he’s pretty busy), kind, friendly and patient. Federico, you rock :-) 0 publish closed open 2007-02-26 22:24:37 2007-02-26 21:24:37 0 http://www.manucornet.net/blog/dreamerant/?p=39 0 post 0