Optimizing Mozilla and Pixmap Management in X [Updates]

Programming, Linux, mozilla 1 Comment »

A few days passed since my first post about issues relating image quality and memory consumption in X. I gathered a few people here at Révolution Linux to do some QA on my builds integrating my Mozilla framework modifications. Unfortunately, it seemed like intensive browsing and image viewing of scaled images led to some issues with my previous patches. One of these was caused by interlaced images which wouldn’t completely render. This was actually a bug in a Thebes function which would tell me that an image had done being uncompressed while that wasn’t the case. To support interlaced images, a new flag was added to indicate that an image had not completed its several decompression passes.

Next, there was a very light glitch when scrolling in upscaled images. This was caused by how I implemented scaling and memory usage reduction. I was creating subimages first and then scaling these to fit their destination rectangle. I now proceed with scaling before selecting subimages.

As my update section was explaining, I give users more flexibility of when to manipulate images and use GDK’s bilinear interpolation to increase image quality or when to limit memory usage by a single preference variable.

Finally, this new patch should be considered the final version for bug 395260. It also could be considered a first step toward 372462 resolution. Joe is currently refactoring the whole nsThebesImage code for the Gecko 1.9.1 release and I would expect him to port my GDK manipulations to its future code.

Thin client users, enjoy a more stable Mozilla environment. Here’s a precompiled version of my patch. Feel free to try it and please report any weird behavior with image rendering.

Download my patched Firefox 3.0.1 build (x86-linux)
Download my patched Firefox 3.0.1 build (x86-win32)
Download the patch only

Optimizing Mozilla and Pixmap Management in X

Programming, Linux, mozilla 1 Comment »

The lastest Firefox release, version 3.0, relays on the Gecko as a layout engine and libpr0n for image decompression. The underlying Cairo framework greatly improves the code portability and increases the rendering on supported platforms. Cairo is used in several projects and sounds very promising with the eventual support of glitz to benefit of 3d hardware acceleration.Thebes is the C++ code used to wrap the Cairo framework in Mozilla. It uses ImageSurfaces which get decompressed image data from libpr0n. The current design of these surfaces is to send a full pixmap (decompressed images) to X without any limitation. Then, the underlying Cairo surfaces can be painted and the Mozilla application’s memory freed. The actual image data is kept as a pixmap in X’s memory. This choice of storing the pixmaps in X instead of in the application’s memory can increase the performances when rendering image: the new visible data does not need to transfered on every scrolling event.

On the other hand, storing pixmaps in X might not be the best solution to optimize the speed of image rendering. Considering that the full pixmap needs to be transfered between the application and X, rendering the first visible frame will be slower. Also, using unlimited memory in X may steal the available ressources for other applications. Read the rest of this entry »

The Perfect Firefox (Mozilla) Development Environment

Programming, Linux 2 Comments »

Here are some pretty straight forward steps to quickly get a development environment based on the Eclipse IDE. The tools in this environment are

Note: Mozilla has great documentation to help building any of their application. Please have a look there before posting any question. The #developers irc.mozilla.org channel is also a good start.

This tutorial assumes you’re using Ubuntu or a similar distro.

Build and configure Firefox

1. Install required tools and Firefox dependencies

sudo apt-get install cvs distcc eclipse eclipse-cdt libcurl4-openssl-dev distccmon-gnome
sudo apt-get build-dep firefox

Read the rest of this entry »

Java Project Environment

Projects, Programming No Comments »

The Java community is loaded with tons of applications and tools to cover every aspect of a large computer software development cycle. Our latest project, soon to be covered in a later post, uses the tools listed below. The quantity of available options requires a deep analysis of a project’s needs to find the suitable combination of tools that will positively help development.

Tools

Maven : build management and configuration - http://maven.apache.org
Hibernate : database object-relational mapping http://www.hibernate.org
Struts : web applications development - http://struts.apache.org
CruiseControl : build automation - http://cruisecontrol.sourceforge.net
Subversion : version control system - http://subversion.tigris.org
Trac : issue tracking system - http://trac.edgewall.org
JUnit : java unit test framework - http://www.junit.org
Hadoop : load-balance operations - http://hadoop.apache.org/core

Eclipse plugins

SQL Explorer : database management - http://eclipsesql.sourceforge.net
Subclipse : team source synchronisation - http://subclipse.tigris.org
Maven : http://maven.apache.org/eclipse-plugin.html
Hibernate-Tools : http://www.hibernate.org/255.html

Documentation

Project structure :

http://www.onjava.com/pub/a/onjava/2006/03/29/maven-2-0.html
http://java.sun.com/blueprints/code/projectconventions.html

SVN management (tags and branches) :

http://svnbook.red-bean.com/en/1.1/ch04.html

Installing Oracle on Solaris :

http://www.dbspecialists.com/presentations/oracle920solaris.html

Hibernate and CHAR(%n) mapping

Programming No Comments »

By default, Hibernate seems to map CHAR(%n) database fields to java.lang.String. It causes no problem when querying a database without comparing this field, but unfortunately, the query may fail if the String does not containt %n chars. To avoid any problem, I suggest using VARCHAR(%n) fields where %n is the max size that can have your string. If you prefer to keep CHAR(%n) fields, probably for performance matters, refer to the hibernate documentation to specify a type such as “type=CharArray’” in your mapping.

The consequence of automatically mapping a database chararray field to a String object in java causes the impossibility of using this field in WHERE clauses.