compiz
As I said in the previous blog post I am using compiz on my MacBook. It's kind of funky in a good way, even though I prefer the less glizzy OS X window manager which is also based on OpenGL.
While playing around with the Flash Player I noticed that Xorg-air was using quite a bit of CPU, along with FireFox itself. Now this is not completly unexpected, but switching to metacity confirmed my fears: The X11 shm extension might not work well or at all with AIGLX/compiz, meaning it probably spends a lot of time copying data to the GPU on each frame we pass to X11. Here are the two different tops testing the same content (and no, changing the active windows makes no change):


I'll try to debug that further once the player is more stable, for now we have to live with this. Hopefully there is an option to fix it up in the AIGLX/compiz code in a way that it uses DMA transfers to the GPU and only uploads parts of the image (usually by using glTexSubImage2D).
Don't get the idea that we can use OpenGL in the plugin for Linux, last time I checked the Netscape plugin API had no access to an OpenGL context for Unix targets. If anyone wants to do the work for Unix they are welcome, we would certainly use it and save a lot of CPU time with it if it's correctly done. It will soon be possible on OS X, Josh Aas from the Mozilla foundation is working on it and Tim Omernick from Apple has already started extending the WebKit to support CoreGraphics and OpenGL (look for his changes in WebKit/JavaScriptCore/bindings/npapi.h). This support will be required for 64bit targets and Leopard since QuickDraw is going away for good.
While playing around with the Flash Player I noticed that Xorg-air was using quite a bit of CPU, along with FireFox itself. Now this is not completly unexpected, but switching to metacity confirmed my fears: The X11 shm extension might not work well or at all with AIGLX/compiz, meaning it probably spends a lot of time copying data to the GPU on each frame we pass to X11. Here are the two different tops testing the same content (and no, changing the active windows makes no change):


I'll try to debug that further once the player is more stable, for now we have to live with this. Hopefully there is an option to fix it up in the AIGLX/compiz code in a way that it uses DMA transfers to the GPU and only uploads parts of the image (usually by using glTexSubImage2D).
Don't get the idea that we can use OpenGL in the plugin for Linux, last time I checked the Netscape plugin API had no access to an OpenGL context for Unix targets. If anyone wants to do the work for Unix they are welcome, we would certainly use it and save a lot of CPU time with it if it's correctly done. It will soon be possible on OS X, Josh Aas from the Mozilla foundation is working on it and Tim Omernick from Apple has already started extending the WebKit to support CoreGraphics and OpenGL (look for his changes in WebKit/JavaScriptCore/bindings/npapi.h). This support will be required for 64bit targets and Leopard since QuickDraw is going away for good.

