From 786bea48df0dc6d76b2ad00409804a803fe2f4b6 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 20 Oct 2008 12:19:50 +0100 Subject: [PATCH] [boilerplate/directfb] Create ARGB surfaces on demand. Create an RGB or ARGB surface depending upon the content type of the test target, with the result that the directfb rgb24 target no longer unconditionally fails. --- boilerplate/cairo-boilerplate-directfb.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/boilerplate/cairo-boilerplate-directfb.c b/boilerplate/cairo-boilerplate-directfb.c index f0c96a00a..7a6462f6f 100644 --- a/boilerplate/cairo-boilerplate-directfb.c +++ b/boilerplate/cairo-boilerplate-directfb.c @@ -109,18 +109,18 @@ _cairo_boilerplate_directfb_window_create_surface (DFBInfo *info, content == CAIRO_CONTENT_COLOR_ALPHA ? "ARGB" : "unknown content!", width, height); - desc.flags = DWDESC_POSX | DWDESC_POSY | - DWDESC_WIDTH | DWDESC_HEIGHT - /*| DWDESC_CAPS|DSDESC_PIXELFORMAT*/; + desc.flags = DWDESC_POSX | DWDESC_POSY | + DWDESC_WIDTH | DWDESC_HEIGHT; + desc.caps = DSCAPS_NONE; desc.posx = 0; desc.posy = 0; desc.width = width; desc.height = height; -#if 0 /*Test using native format by default*/ - desc.caps = DWCAPS_DOUBLEBUFFER; - desc.caps |= DWCAPS_ALPHACHANNEL; - desc.pixelformat = DSPF_ARGB; -#endif + if (content == CAIRO_CONTENT_COLOR_ALPHA) { + desc.flags |= DWDESC_CAPS | DSDESC_PIXELFORMAT; + desc.caps |= DWCAPS_DOUBLEBUFFER | DWCAPS_ALPHACHANNEL; + desc.pixelformat = DSPF_ARGB; + } DFBCHECK (info->layer->CreateWindow (info->layer, &desc, &info->window)); info->window->SetOpacity (info->window, 0xFF); @@ -151,11 +151,14 @@ _cairo_boilerplate_directfb_bitmap_create_surface (DFBInfo *info, content == CAIRO_CONTENT_COLOR_ALPHA ? "ARGB" : "unknown content!", width, height); - desc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT; + desc.flags = DSDESC_WIDTH | DSDESC_HEIGHT; desc.caps = DSCAPS_NONE; desc.width = width; desc.height = height; - desc.pixelformat = DSPF_ARGB; + if (content == CAIRO_CONTENT_COLOR_ALPHA) { + desc.flags |= DSDESC_PIXELFORMAT; + desc.pixelformat = DSPF_ARGB; + } DFBCHECK (info->dfb->CreateSurface (info->dfb, &desc, &info->surface)); return cairo_directfb_surface_create (info->dfb, info->surface);