DFBResult ISurface_Real__SetConfig( CoreSurface *obj, const CoreSurfaceConfig *config ) { D_DEBUG_AT( DirectFB_CoreSurface, "%s()\n", __FUNCTION__ ); D_ASSERT( config != NULL ); return dfb_surface_reconfig( obj, config ); }
static DFBResult primaryReallocateSurface( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreSurface *surface ) { DFBResult ret; CoreSurfaceConfig conf; conf.flags = CSCONF_SIZE | CSCONF_FORMAT | CSCONF_CAPS; conf.size.w = config->width; conf.size.h = config->height; conf.format = config->format; conf.caps = DSCAPS_SYSTEMONLY; if (config->buffermode != DLBM_FRONTONLY) conf.caps |= DSCAPS_DOUBLE; ret = dfb_surface_reconfig( surface, &conf ); if (ret) return ret; if (DFB_PIXELFORMAT_IS_INDEXED(config->format) && !surface->palette) { DFBResult ret; CorePalette *palette; ret = dfb_palette_create( NULL, /* FIXME */ 1 << DFB_COLOR_BITS_PER_PIXEL( config->format ), &palette ); if (ret) return ret; if (config->format == DSPF_LUT8) dfb_palette_generate_rgb332_map( palette ); dfb_surface_set_palette( surface, palette ); dfb_palette_unref( palette ); } return DFB_OK; }