Bug 37050 - CAIRO_FORMAT_RGB24 mapped to wrong DirectFB pixelformat.
Summary: CAIRO_FORMAT_RGB24 mapped to wrong DirectFB pixelformat.
Status: RESOLVED NOTABUG
Alias: None
Product: cairo
Classification: Unclassified
Component: directfb backend (show other bugs)
Version: 1.10.2
Hardware: Other All
: medium normal
Assignee: cairo-bugs mailing list
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-09 23:41 UTC by haithem
Modified: 2011-05-09 23:49 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description haithem 2011-05-09 23:41:30 UTC
Hi,

in the file "src/cairo-directfb-surface"
CAIRO_FORMAT_RGB24 should be mapped to DSPF_RGB24 instead of DSPF_RGB32.
attached a patch for it.

regards.
Haithem.
Comment 1 Andrea Canciani 2011-05-09 23:49:37 UTC
(In reply to comment #0)
> Hi,
> 
> in the file "src/cairo-directfb-surface"
> CAIRO_FORMAT_RGB24 should be mapped to DSPF_RGB24 instead of DSPF_RGB32.

I don't think so. The DirectFB documentation (http://directfb.org/docs/DirectFB_Reference_1_5/types.html#DFBSurfacePixelFormat) states:
DSPF_RGB24	 	DFB_SURFACE_PIXELFORMAT( 2, 24, 0, 0, 0, 3, 0, 0, 0, 0, 0 )	 	24 bit RGB (3 byte, red 8@16, green 8@8, blue 8@0)
DSPF_RGB32	 	DFB_SURFACE_PIXELFORMAT( 3, 24, 0, 0, 0, 4, 0, 0, 0, 0, 0 )	 	24 bit RGB (4 byte, nothing@24, red 8@16, green 8@8, blue 8@0)

So we obviously need DSPF_RGB32, because:

CAIRO_FORMAT_RGB24 each pixel is a 32-bit quantity, with the upper 8 bits unused. Red, Green, and Blue are stored in the remaining 24 bits in that order.

(from http://www.cairographics.org/manual/cairo-Image-Surfaces.html#cairo-format-t )

Please check again and reopen if I'm missing something.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.