August 25th, 2008
I was planning to use OpenGL[X] extensions to speedup texture creation for 3D transitions in the Impress for some time. Last week I finally got to it.
I use GLX_EXT_texture_from_pixmap and GL_SGIS_generate_mipmap extensions. It works like this: the slide content is rendered into cairo canvas bitmap which is passed to the transition engine. The engine then asks for pixmap handles for these bitmaps and creates GLXPixmaps from them (glXCreatePixmap call). Later it binds them to the textures (glXBindTexImageEXT call). The GL_SGIS_generate_mipmap extension is used to generate mipmap levels.
The result is 9.3x speedup. On my system it took around 0.33sec to prepare textures of both slides and now it takes about 0.035sec. This big difference can be accounted to the fact, that we avoid bus round trips for 2 fullscreen images as these are now only accessed in the video memory on the graphics card instead of copying them to the system memory and back.
Big thanks go to David Reveman and NVIDIA guys who brought us the GLX_EXT_texture_from_pixmap extension. Not sure who to thank for the other extension.
I have also noticed, that we have still some issues with animation smoothness, which can be avoided by synchronizing X calls during the transition, so I force it now until the transition finish. It looks to me as the issue happens somewhere in the slideshow code as I was using XSync calls in 3D transitions already, but only to partial effect.
I also refactored a bit the transitioner class code, as it was getting more hairy with additional logic for frame buffer configs and other X related things.
Posted in Work | No Comments »
October 11th, 2007
From the last time I blogged about EMF+ in OOo I was busy implementing rendering in the edit view. The EMF+ parser and renderer code is located in the cppcanvas module and is extending the existing GDI metafile renderer. The reason for this is that GDI metafile does not have enough features to cover all the EMF+ possibilities. The floating point vs. integer coordinates is most visible deficiency. Thus EMF+ records data are tunneled thru GDI Metafile comments, similar to what is already done for features like texture and gradient fills. When they arrive in cppcanvas renderer we can use all the features the canvas provides, including the floating point coordinates.
What works wonderfully for slideshow is a problem for an edit view though, because it uses different metafile renderer located in the vcl. To avoid duplicating the code and reducing the quality I am now calling cppcanvas renderer from the vcl one to render embedded metafiles to bitmap with an alpha channel, which is then rendered by vcl. This solution is a bit temporary because edit view will use the canvas in the future, but so far there is no other way. You can see the working proof of concept in the following screenshot.

EMF+ in the edit mode
You can also notice fixed polygon parsing, the brick wall is displayed correctly.
Valek Filippov sent me a nice report of problems in OOo’s WMF import filter, see the issue #82518.
Posted in Work | Comments Off
October 3rd, 2007
For about the last 2 months I have been working on improving EMF metafile format import and rendering in OOo for Novell. These days nearly everything which is saved in EMF format from MS Office is dual EMF+. It means that it contains data in EMF as well as newer EMF+ formats. The reasoning for that is to use EMF data on low performance systems as PDAs and mobile phones, while EMF+ on desktop systems.
So far OOo supported only EMF part and even only partially. This sometimes results in quite wrong import of documents containing EMF vector images. At the following picture you can see how the EMF+ import/rendering improves things so far. It is not yet perfect either (in few details like the firewall, etc.), but definitely big improvement. On the left is how OOo renders it today and on the right modified OOo using the EMF+ data. Original picture looks like this. You can find another example and comparison at go-oo.org.

EMF vs. EMF+ in the OpenOffice.org
We will be up-streaming this work when it’s done under the JCA.
Posted in Work | No Comments »
July 3rd, 2007
The Novell hack week ended on Friday. It was great event and I was happy to meet everyone in Prague office, from Wednesday to Friday. I really enjoyed the journeys on bike to the office as well.
Evo color management
I was able to get color management work nicely in the Evolution mailer. It works in the mail view and also in the composer. I made the patches available here, gtkhtml-cms.diff and evolution-cms.diff. The diffs are against gtkhtml 3.10.0 and evolution 2.6.0. These are what I use on my server machine which has my mail.
I run into few issues which are worth to look into:
- xicc seems to work only in multi monitor environment with multiple X screens, one per monitor. This is not the case on my desktop, where I have one X screen spanning over 2 monitors.
- loading embedded profiles is painful to do in applications, which use GdkPixbuf. Ideally embedded profile should be read by GdkPixbufLoader and stored into GdkPixbuf. Reading profile [info] from exif data in GdkPixbuf will make sense as well
It was also interesting to see the differences when we calibrated and profiled Kendy’s CRT monitor and compared it to my laptop LCD screen. I remember the differences between my desktop LCD and laptop, but these were far bigger. I guess it is because the CRT is driven by an analog signal and thus the calibration can use the whole LUT, maybe even more than 8 bits, which is today limitation of many LCD DVI driven monitors.
Along the hacking I was also thinking about implementing color management for the OpenOffice.org. It will be a bit harder compared to the Evolution, as the places where are the images loaded and where are rendered are separated by many logical levels. OTOH, we are loading the images directly in OOo, so we will not be dependent on the GdkPixbuf changes.
I look forward to the next Hack week

Kendy’s monitors realm
Posted in Work | Comments Off
June 26th, 2007
Evolution color management update
- attached images are now also transformed before rendering
- background issue fixed, background images are now transformed as well
- started working on embedded profiles/exif profile information processing. looks like there’s a lot of different ways to embed the color profile. more work on this tomorrow.

Example screenshot
The above screenshot was taken on my laptop running hacked version of the Evolution on the SLED. It was then transformed back from my laptop display color space back to sRGB - using the Cinepaint. So make sure to view the screenshot in your color management capable browser
The version of Firefox I have installed still doesn’t do color management, but there is always hope.
I have also added 2 ideas for color management in SLED
The former one would be nice hack week mini project for interested packager. The later one will take probably more time.
Tomorrow
If everything goes well, I will be from Wednesday to Friday hacking at the SUSE Prague office. Stop by to see the color managed Evolution in real.
I will also bring a display colorimeter, so ask me if you want to calibrate and profile your display. It is supported by the great and famous Argyll color management system.
Looking forward to see everyone in Prague.
Happy hacking!
Posted in Work | Comments Off
June 25th, 2007
Today at Novell started a Hack week. It is a great event, where I will able to spend one week hacking time on a project I choose.
After some thinking I remembered I am missing color management in the desktop applications I use daily. I planned to implement it in the OpenOffice.org as well for some time. Given that one week is not much time to do a bigger project I decided I might improve few applications with implementing display color management, at least to some degree.
Evolution mailer is first on my list. I spent few years maintaining gtkhtml, so I quickly jumped into old code. After few hours I had first version ready. So far it uses sRGB color space profile as input profile for the color transformation. The output device profile is taken from _ICC_PROFILE X atom as described in ICC Profiles In X Specification. For doing the actual work I am using Little CMS, it works really nice. In the beginning I had troubles with images containing alpha channel, LittleCMS doesn’t copy it when doing the transformation - opposite to what I was expecting. There is also something broken with the background rendering, hopefully nothing hard to fix. Later I hope to reuse some code from Eye of Gnome to retrieve image’s embedded color profiles.
One thing that bothers me is that these days mailer uses GtkImage widget to show the attached images. This means I will have to do color transformations in the gtkhtml and in the evolution mailer as well. Let’s hope I can nail down all the issues tomorrow and move to the OpenOffice.org slideshow soon. It will be the next stop.
Posted in Work | Comments Off
November 3rd, 2006
On Sunday I returned from short vacation I spent with my friends in Red hills and Rohace mountains in Slovakia. First two days we were lucky and the weather was very warm, considering this part of the year. Autumn colors were attacking us from all the sides.

On the way up
Once we ascended above the trees and scrubs, we were able to see all the beauty around. In the evening the sunlight modeled the landscape and the colors were even more saturated.

Red hills
The other two days it was raining all the time, strong wind together with rain and frozen snow were trying to blow us away. Most of the time we were in hazy clouds and the atmosphere reminded me somewhat the Stalker movie. In the end we were rewarded for our endurance. At the time we reached Klin, the top level cloudiness went away and we saw all the surrounding mountains bathing in the clouds and sunset.

Sailing in the sky
Posted in Friends, Photos, Free time | Comments Off
September 28th, 2006
Second day started with Debra’s and Zaheda’s keynotes.

Debra’s Novell keynote
I had to finish my slides for tomorrow, so most of the day I spent oscillating between various talks and hacking room. At noon we went for lunch to the student restaurant. The meal was really good and I was happy I can get something hot for my stomach. After talks were finished we were invited to the party in the city hall. Buses waited for us before INSA building and took us quickly to very nice city hall of Lyon.

Entry door
The party went great and we had a chance to taste some delicious french cocktail snacks. I enjoyed taking portraits. In the end my flash batteries went out, fortunately Tor saved me with his spare ones. You may find more photos in the gallery.
Posted in Work, Photos | Comments Off
September 26th, 2006
GStreamer support in OOo is getting polished. Lately I worked on these:
- tolerate errors and do not block OOo thread when they occur
- make avmedia provide the content of the media object for audio and use gst player window for video only
- let OOo know about video/theora and audio/vorbis content types, include ogg/theora/vorbis and flac in insert media file chooser
- display the 1st frame of video stream in the player window after loaded
Next I would like to implement sounds over multiple slides we lack badly.
Posted in Work | Comments Off
September 26th, 2006
This year OOoCon took place in beautiful city called Lyon, in east part of France. I thought about what I liked most on Lyon and it seems that mostly nice live center, not overcrowded with tourists, only few cars and reasonably clean river. Water front and surrounding buildings reminded me those in Prague.

Lyon
Together with Petr Mladek we arrived before the noon, went to the INSA (university which held the conference), registered and met with others guys. It was nice to meet OOo people again after a year. Later we left for hotel and then went to taste the city atmosphere. Did not have much time though as Novell dinner on the boat started with the dusk. The meal was original to us and tasted good. Fresh air on the top deck, beautiful sights and great atmosphere ended the first day.

Boat waiting for us
You may find more photos in the gallery.
Posted in Work, Photos | Comments Off