patchGnash - The GNU Flash player - Patches: patch #6546, GTK-AGG: Use GdkImage instead of...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #6546: GTK-AGG: Use GdkImage instead of talking directly to XShm/Xlib

Submitter:  Bastiaan Jacques <bjacques>
Submitted:  Fri 20 Jun 2008 10:11:58 PM UTC
   
 
Category:  gui-gtk Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  bjacques Open/Closed:  Closed

Jump to the original submission

Fri 07 Nov 2008 01:57:06 PM UTC, comment #6: 

The documentation would imply that is the case, but there's only one way to find out for sure.

Bastiaan Jacques <bjacques>
Group Member
Fri 07 Nov 2008 01:54:38 PM UTC, comment #5: 

Yes, of course. I was asking if we'd get a better handling
when that's not the case, like if MIT-SHM will be disabled
at runtime when not possible to use.

Sandro Santilli <strk>
Group Member
Fri 07 Nov 2008 01:28:52 PM UTC, comment #4: 

GdkImage specs say that "... [MIT-SHM accelerated GdkImage] will only be available if client and server are on the same machine and the shared memory extension is supported by the server."

Bastiaan Jacques <bjacques>
Group Member
Fri 07 Nov 2008 11:11:04 AM UTC, comment #3: 

See bug #24772 for an issue with mit-shm.
Would the GDK way fix that too ?

Sandro Santilli <strk>
Group Member
Thu 09 Oct 2008 04:14:13 PM UTC, comment #2: 

When I first wrote the patch I did test the performance with and without the patch; there was no discernible difference. That said, at the next pass I should do more thorough performance testing.

Bastiaan Jacques <bjacques>
Group Member
Sat 13 Sep 2008 12:31:53 PM UTC, comment #1: 

Sorry for the late answer - I'm currently busy with too much stuff :(

I haven't tested your patch nor did I have a look at the code but judging from your description it seems the right way to go.

As for the RGB32 this probably depends on your graphics card. There is no difference in terms of quality between the two formats but the 32 bit format allows a more natural pixel adressing since it matches the 4 bytes alignment.

So, it's fine to use RGBA32. The downside of this is that AGG generates transparency information for the main buffer wich is generally unnecessary. Perhaps the performance difference in total is near to zero.

I don't know if GdkImage is capable of this but theoretically this would also allow transparent Flash movies (wmode=transparent).

Assuming that your patch causes AGG to render in the current video mode's native format and pixel data goes directly to video RAM then the solution sounds good...

PS: The patch should be tested on low and big endian machines with 16, 24 and 32 bpp modes since we know AGG is sensible on this.

Udo Giacomozzi <udog>
Group Member
Fri 20 Jun 2008 10:11:58 PM UTC, original submission:  

This patch replaces our own XShm implementation in the GTK/AGG glue with usage of a GdkImage memory buffer. GdkImage will implicitly use XShm if it's available on the system, thus eliminating the need for Gnash to talk to Xlib directly.

There is one problem with the patch: GdkImage creates an image buffer with pixel format information it retrieves from the X Visual from the (gdk) drawing area. At least on my system, it extends the pixel format by 8 padding bytes, becoming an BGR24 with the upper 8 bits unused, or a BGR32, if you will.

Now, simply creating the Agg renderer with a BGRA32 pixel format works just fine. But I wonder if that's the "right" thing to do. So, Udo, is there a better way to tell AGG that the upper 8 bits of the RGB32 are unused?

Bastiaan Jacques <bjacques>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #15892:  gtkagg-gdkimage.diff added by bjacques (15KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by udog (Posted a comment)
  • -email is unavailable- added by bjacques (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-11-13 bjacques StatusNone Done
        Assigned toudog bjacques
        Open/ClosedOpen Closed
    2008-06-20 bjacques Attached File- Added gtkagg-gdkimage.diff, #15892

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code