Sunday, February 25, 2007

Browsers, performance and interventions

This week I beat WebKit Qt's rendering into shape. I rewrote the theming and canvas code.
It works so nicely that I'm actually pretty happy with it. The rewrite helped me fix issues with statically positioned elements (which just didn't work on a scrollview/canvas combination I did before). Due to which my blog finally looks and behaves correctly as seen on the screenshot above. That plus scrolling is about 10x faster and you never see gray areas on scrolling as you did before.
This week George Staikos has been here in Oslo to work with us on the networking code. George and I have been friends for five or six years and he has this nasty habit that forces me to start an intervention and try to get him off it. What I'm referring to is the fact that George has been Canadian for, well his entire life, and it is my professional opinion (but I'm not a doctor) that he needs to move on. I'm not sure in which culture it is customary to bring Snapple ice-tea to your friends when you come to see them but we need to change him to that because he definitely didn't bring me any this time and that's just rude.
Going back to work, I'm sure Lars will blog about the networking magic they did so I'll keep my mouth shut. Once the code they were working on will be ready (which should happen within next week or two) and we'll start using in WebKit, we'll make the transition and start using WebKit Qt based browser on a daily basis. So we're close which is pretty exciting.

We have also started optimization run for Qt 4.3. My grand plan is to make sure Qt 4.3 is 2x faster in general rendering code than Qt 4.2 was. I have a list of algorithms to shave and rewrite over the next few weeks which will be rather challenging.
By the way of performance some people noticed that Qt OpenGL in recent snapshots with Antialiasing turned on is actually slower than it was in Qt 4.2. It's because of an experiment that we're trying on. We're now using GLSL to antialias primitives. Of course it's a lot slower than the old code but produces very high quality results. I don't really like it though because the performance hit is just too big.

Friday, February 09, 2007

Core dump

Today I'm joining the rapid fire blogging squad.

  • Roberto is moving back to Italy and last Wednesday was his last day at the office. Roberto is one of my best friends at Trolltech so I was incredibly bummed out by his departure. The office won't be the same place without him. Plus who will help me hack on a prototype GLSL jit engine that I wanted to do some research on? (rhetorical question, I'd only trust him with that anyway)
    Roberto is also, by far, one of the best hackers who ever worked on KDE so I'm very excited to say that Roberto and Trolltech came to an agreement by which Trolltech will sponsor Roberto for two days of the week to work on KDE.

  • This has been a bug fixing week so I didn't have any time to work on WebKit. Last week I did manage to finish off integrating SVG into WebKit Qt
    I also played a little bit with combining native Qt application rendering from within WebKit. One can embed a whole native Qt window inside an html frame and then control the Qt application from javascript (signals, slots and properties of the window and its children are dynamically exposed). Here's a native Qt application (my transform example) rendered inside the advertisment frame on cnn.com (sorry for the depressing image).


  • For the last two days I've been thinking about adding basic high dynamic range color support to Qt. QColor is already suitable for it and extending it wouldn't be a big issue. QColor's internal representation is a union of unsigned shorts. Basic HDR support requires 64bit, where every channel is a so-called, "half". Half values have 1-bit sign bit, 5 exponent bits, and 10 mantissa bits. It's a format used, among others, in OpenEXR and Cg. In fact OpenEXR project provides a C++ half implementation under a BSD-like license. Along a CIELAB colorspace support that I wanted to add to Qt for a while now, support for HDR would open a slew of new possibilities. On a silly, desktop level - imagine a desktop background the is light proportionally to the sun-light that you'd see for your currently configured timezone. On a more basic level HDR is pretty much essential for any kind of image processing/editing nowadays. I'll most likely write another blog dedicated to color-theory and things I'd like to fix/implemented in Qt that are related to it. Google returns hundred thousands of HDR images so if you'd like to see what people do with it, you won't have to look for long. One of my favorite examples is New York at night by Paulo Barcellos Jr that can be seen on fickr here.

  • During lunch at Trolltech there's only one kind of yellow cheese available. Climbing to the highest-levels of good-faith and stupidity I assumed the cheese would absolutely have to be vegetarian (many cheeses is still made with natural rennet, which is taken out of lining of young cattle's stomachs). Yesterday one of the people pointed out that it most likely isn't. Today morning I called Tine, which is the biggest dairy producer in Norway (and one whose cheese Trolltech buys) to ask them about the situation. The result was, that of course, the cheese is not vegetarian. If you're a vegetarian, do not eat cheese or any products containing it while in Norway. For me the bottom line is that for the last few months I've been having non-vegetarian cheese for lunch putting me right now in levels of pissed off/disappointed that I've never been at (you know that silly questions about graphics you wanted to ask me? you might want to wait with that a few days).