Re: rendering-cleanup


At Tue, 3 Aug 2010 08:43:07 -0400,
Havoc Pennington wrote:
> On Tue, Aug 3, 2010 at 5:14 AM, Yasushi SHOJI <yashi atmark-techno com> wrote:
> > I assume I can't do the following:
> >
> >        pixbuf = gdk_pixbuf_get_from_drawable(NULL,window,NULL, ...);
> Oh, this is really not what you want to do at all - getting an image
> or pixbuf from drawable is actually going out to the X server and
> "screenshotting" the current pixels, which is typically slow compared
> to any drawing you might be doing. This would be a performance
> negative. the good news is, if you were doing this and didn't need to,
> then fixing this will give you back more performance than you'll lose
> doing a 565-to-888 conversion perhaps.

ah, that's right.  my bad.  In my case, I don't need any data from X
server (I'm just drawing on the surface), so get_from_drawable() is
waisting the round trip.

> > it just that my hardware platform does not have a powerful CPU like
> > desktop nor server.  and if I know that X is RBG565 format, I want to
> > use the exact same format to save some cpu cycle.
> To get the absolute fastest performance you'd probably have to use
> Xlib and XImage directly. Though in an ideal world, if you created a
> cairo surface for a 565 drawable (with gdk_cairo_create()) and could
> then draw with cairo operations instead of with direct pixel access,
> maybe cairo would never go through 888. But I don't know whether cairo
> has that optimization, and of course it would depend on using cairo
> drawing operations instead of direct pixel access.

yeah, that'd be a my dream come true, but cairo have dropped....
wait, I guess it's my lucky day.

I just checked cairo git repo and found this commit:

Yes! RGB565 support was added back for 1.9.6!

My Debian sid doesn't have that version yet but I guess I'll have to
try that.

Thanks Havoc, Oleg, and Jeff,
            yashi :-)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]