On Tue, 2010-04-13 at 12:50 +0100, Andre Draszik wrote: > OK to change? Sth like this? Could make the deprecated thing a normal define instead...
Cheers, Andre'
>From 35b435745956b20801ad804220a1b67e8acc4bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.dras...@st.com> Date: Wed, 14 Apr 2010 04:11:56 +0100 Subject: [PATCH] smooth scaling is not limited to DirectFB's software fallback Hardware accelerated DirectFB gfxdrivers can implement it as well, so it is at least a bit confusing to refer to it as smooth _software_ scaling. --- README | 5 +++-- include/sawman.h | 13 +++++++++++-- samples/testman.c | 2 +- src/isawmanmanager.c | 2 +- src/sawman_draw.c | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/README b/README index 24ff610..0334e7f 100644 --- a/README +++ b/README @@ -58,9 +58,10 @@ You can try running "df_andi --dfb:force-windowed" or even simply run df_window. Hitting F9 cycles the focus through managed windows. F10 would switch layout modes, but there's only one implemented in the test code. -F11 switches between "smooth software" or "standard (hw/sw)" scaling (for windows only). +F11 switches between "smooth (hw where available/sw)" or "standard (hw/sw)" + scaling (for windows only). -The smooth scaling algorithms have also been developed in the scope of this project. +The smooth software scaling algorithms have also been developed in the scope of this project. Using testrun diff --git a/include/sawman.h b/include/sawman.h index 3ee9017..c13be36 100644 --- a/include/sawman.h +++ b/include/sawman.h @@ -71,10 +71,19 @@ typedef enum { typedef enum { - SWMSM_SMOOTH_SW, /* Smooth scaling algorithm in software */ - SWMSM_STANDARD /* As provided by hardware, otherwise software (nearest neighbor) */ + SWMSM_SMOOTH, /* DirectFB's smooth scaling, setting DFBSurfaceRenderOptions appropriately */ + SWMSM_STANDARD /* DirectFB's standard scaling, DirectFB's software fallback uses nearest neighbor */ } SaWManScalingMode; +static inline SaWManScalingMode +__attribute__((deprecated)) +__deprecated_SWMSM_SMOOTH_SW(void) +{ + return SWMSM_SMOOTH; +} +/* for backwards compatibility of existing source, don't use for new code */ +#define SWMSM_SMOOTH_SW __deprecated_SWMSM_SMOOTH_SW() + typedef enum { SWMPF_NONE = 0x00000000, diff --git a/samples/testman.c b/samples/testman.c index 1b90a9f..585b277 100644 --- a/samples/testman.c +++ b/samples/testman.c @@ -626,7 +626,7 @@ input_filter( void *context, return DFB_BUSY; case DIKS_F11: - tm->scaling_mode = (tm->scaling_mode == SWMSM_SMOOTH_SW) ? SWMSM_STANDARD : SWMSM_SMOOTH_SW; + tm->scaling_mode = (tm->scaling_mode == SWMSM_SMOOTH) ? SWMSM_STANDARD : SWMSM_SMOOTH; manager->SetScalingMode( manager, tm->scaling_mode ); manager->Unlock( manager ); return DFB_BUSY; diff --git a/src/isawmanmanager.c b/src/isawmanmanager.c index caf7984..86893d4 100644 --- a/src/isawmanmanager.c +++ b/src/isawmanmanager.c @@ -307,7 +307,7 @@ ISaWManManager_SetScalingMode( ISaWManManager *thiz, DIRECT_INTERFACE_GET_DATA( ISaWManManager ) - if (mode != SWMSM_STANDARD && mode != SWMSM_SMOOTH_SW) + if (mode != SWMSM_STANDARD && mode != SWMSM_SMOOTH) return DFB_INVARG; sawman = data->sawman; diff --git a/src/sawman_draw.c b/src/sawman_draw.c index 01aa2d6..6d9c5f0 100644 --- a/src/sawman_draw.c +++ b/src/sawman_draw.c @@ -449,7 +449,7 @@ draw_window( SaWManTier *tier, dfb_state_set_blitting_flags( state, flags ); /* Set render options. */ - if (sawman->scaling_mode == SWMSM_SMOOTH_SW) + if (sawman->scaling_mode == SWMSM_SMOOTH) dfb_state_set_render_options( state, DSRO_SMOOTH_DOWNSCALE | DSRO_SMOOTH_UPSCALE ); else dfb_state_set_render_options( state, DSRO_NONE ); -- 1.7.0
_______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev