Commit 4b480f06 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Import Upstream version 1.2.9

parent 28012c61
This diff is collapsed.
1.2.9
-----
Several bugfixes that already flowed into the 1.4.x branch are now backported.
The main reason for shipping 1.2.9 is support for the 1.4.x SaWMan branch;
several API features that are required by SaWMan have been added.
DirectFB 1.2.9 is required for SaWMan 1.4.2 and upwards.
API changes
- Add application_id to a window with IDirectFBWindow_Set/GetApplicationID
- dynamic window association via IDirectFBWindow::SetAssociation()
- add DWCAPS_COLOR to the window capabilities
- allow the window config value "color" to colorize the window
config
- add missing include path for builddir != srcdir
- fixed missing JPEG=yes setting when LIBJPEG is set manually
- fix so trace will also print static funcs in stack dump
drivers
- fbdev: fixed RGB fields sizes in dfb_fbdev_set_gamma_ramp
- fbdev: fix for BGR555
- input: Implement driver_get_axis_info() in the linux-input driver
core
- consistently use doubles to calculate the inverse scale factors
- fix timing problems with vt-switching
- prevent deadlock when destroying context
- don't touch the module entry after dlclose() to prevent segfault
- fix for switching source from surface to surfaceless (video).
- add support for the DESTINATION Porter/Duff rule
gfx
- Bugs in pixel format convertion fixed (primarily 16 bit formats)
- converting to RGB32 sets alpha to ff
- buffer unlocking fixes in error paths
- jpeg: plug mem leak on file read error
and several other bugfixes.
1.2.8
-----
......
......@@ -2215,9 +2215,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#
DIRECTFB_MAJOR_VERSION=1
DIRECTFB_MINOR_VERSION=2
DIRECTFB_MICRO_VERSION=8
DIRECTFB_MICRO_VERSION=9
DIRECTFB_INTERFACE_AGE=0
DIRECTFB_BINARY_AGE=8
DIRECTFB_BINARY_AGE=0
DIRECTFB_VERSION=$DIRECTFB_MAJOR_VERSION.$DIRECTFB_MINOR_VERSION.$DIRECTFB_MICRO_VERSION
......@@ -24880,6 +24880,8 @@ echo "$as_me: WARNING:
echo "$as_me: WARNING:
*** JPEG library not found. JPEG image provider will not be built." >&2;}
fi
else
JPEG=yes
fi
fi
......
......@@ -16,9 +16,9 @@ AC_PREREQ(2.52)
#
DIRECTFB_MAJOR_VERSION=1
DIRECTFB_MINOR_VERSION=2
DIRECTFB_MICRO_VERSION=8
DIRECTFB_MICRO_VERSION=9
DIRECTFB_INTERFACE_AGE=0
DIRECTFB_BINARY_AGE=8
DIRECTFB_BINARY_AGE=0
DIRECTFB_VERSION=$DIRECTFB_MAJOR_VERSION.$DIRECTFB_MINOR_VERSION.$DIRECTFB_MICRO_VERSION
AC_SUBST(DIRECTFB_MAJOR_VERSION)
......@@ -680,6 +680,8 @@ if test "$enable_jpeg" = "yes"; then
AC_MSG_WARN([
*** JPEG library not found. JPEG image provider will not be built.])
fi
else
JPEG=yes
fi
fi
......
%define name directfb
%define version 1.2.8
%define version 1.2.9
%define oname DirectFB
%define libname lib%name
......
......@@ -53,7 +53,7 @@
#define FLOOR(x) ((s32)floor(x))
#endif
#ifdef ARCH_X86
static inline long
my_rint(const float x)
{
......@@ -96,7 +96,7 @@ my_floor(const float x)
: "m" (cwtmp), "m" (cw), "t" (arg));
return value;
}
#endif
#define F2COL(x) (RINT(x) & 0x00ffffff)
......
......@@ -885,9 +885,14 @@ typedef enum {
receives events */
DWCAPS_NODECORATION = 0x00000008, /* The window won't be decorated. */
DWCAPS_COLOR = 0x00000020, /* The window has no buffer;
it consumes no backing store.
It is filled with a constant color
and it receives events */
DWCAPS_NOFOCUS = 0x00000100, /* Window will never get focus or receive key events, unless it grabs them. */
DWCAPS_ALL = 0x0000010F /* All of these. */
DWCAPS_ALL = 0x0000012F /* All of these. */
} DFBWindowCapabilities;
/*
......@@ -3126,6 +3131,7 @@ typedef enum {
DSPD_DST_ATOP = 10, /* fs: 1.0-da fd: sa */
DSPD_ADD = 11, /* fs: 1.0 fd: 1.0 */
DSPD_XOR = 12, /* fs: 1.0-da fd: 1.0-sa */
DSPD_DST = 13, /* fs: 0.0 fd: 1.0 */
} DFBSurfacePorterDuffRule;
/*
......@@ -3989,7 +3995,7 @@ DEFINE_INTERFACE( IDirectFBSurface,
DFBResult (*Read) (
IDirectFBSurface *thiz,
const DFBRectangle *rect,
const void *ptr,
void *ptr,
int pitch
);
)
......@@ -4965,6 +4971,21 @@ DEFINE_INTERFACE( IDirectFBWindow,
DFBWindowOptions *ret_options
);
/*
* Set the window color, or colorises the window.
*
* In case you specified DWCAPS_COLOR, this sets the window draw color.
* In case you didn't, it colorises the window with this color; this will darken the window.
* no DWCAPS_COLOR and an opacity of 0 means: no effect.
*/
DFBResult (*SetColor) (
IDirectFBWindow *thiz,
u8 r,
u8 g,
u8 b,
u8 a
);
/*
* Set the window color key.
*
......@@ -5335,6 +5356,41 @@ DEFINE_INTERFACE( IDirectFBWindow,
IDirectFBWindow *thiz,
const DFBWindowGeometry *geometry
);
/** Association **/
/*
* Change the window association.
*
* If <b>window_id</b> is 0, the window will be dissociated.
*/
DFBResult (*SetAssociation) (
IDirectFBWindow *thiz,
DFBWindowID window_id
);
/** Application ID **/
/*
* Set application ID.
*
* The usage of the application ID is not imposed by DirectFB
* and can be used at will by the application. Any change will
* be notified, and as such, an application manager using SaWMan
* can be used to act on any change.
*/
DFBResult (*SetApplicationID) (
IDirectFBWindow *thiz,
unsigned long application_id
);
/*
* Get current application ID.
*/
DFBResult (*GetApplicationID) (
IDirectFBWindow *thiz,
unsigned long *ret_application_id
);
)
......
......@@ -202,6 +202,7 @@ struct DFBWindowCapabilitiesName {
{ DWCAPS_DOUBLEBUFFER, "DOUBLEBUFFER" }, \
{ DWCAPS_INPUTONLY, "INPUTONLY" }, \
{ DWCAPS_NODECORATION, "NODECORATION" }, \
{ DWCAPS_COLOR, "COLOR" }, \
{ DWCAPS_NOFOCUS, "NOFOCUS" }, \
{ DWCAPS_NONE, "NONE" } \
};
......
......@@ -31,8 +31,8 @@
#define DIRECTFB_MAJOR_VERSION (1)
#define DIRECTFB_MINOR_VERSION (2)
#define DIRECTFB_MICRO_VERSION (8)
#define DIRECTFB_BINARY_AGE (8)
#define DIRECTFB_MICRO_VERSION (9)
#define DIRECTFB_BINARY_AGE (0)
#define DIRECTFB_INTERFACE_AGE (0)
#endif /* __DIRECTFB_VERSION_H__ */
......@@ -85,6 +85,7 @@ typedef unsigned long kernel_ulong_t;
#include <sys/kd.h>
#include <stdlib.h>
#define DFB_INPUTDRIVER_HAS_AXIS_INFO
#include <directfb.h>
#include <directfb_keyboard.h>
......@@ -862,7 +863,7 @@ linux_input_EventThread( DirectThread *thread, void *driver_data )
for (i=0; i<readlen / sizeof(levt[0]); i++) {
DFBInputEvent temp = { .type = DIET_UNKNOWN };
if (data->touchpad) {
status = touchpad_fsm( &fsm_state, &levt[i], &temp );
if (status < 0) {
......@@ -899,7 +900,7 @@ linux_input_EventThread( DirectThread *thread, void *driver_data )
devt.type = DIET_UNKNOWN;
devt.flags = DIEF_NONE;
}
devt = temp;
if (D_FLAGS_IS_SET( devt.flags, DIEF_AXISREL ) && devt.type == DIET_AXISMOTION &&
......@@ -918,7 +919,7 @@ linux_input_EventThread( DirectThread *thread, void *driver_data )
break;
}
}
/* Event is dispatched in next round of loop. */
}
......@@ -1217,7 +1218,7 @@ driver_open_device( CoreInputDevice *device,
ret = ioctl( fd, EVIOCGRAB, 1 );
/* 2.4 kernels don't have EVIOCGRAB so ignore EINVAL */
if (ret && errno != EINVAL) {
D_PERROR( "Direc tFB/linux_input: could not grab device" );
D_PERROR( "DirectFB/linux_input: could not grab device" );
close( fd );
return DFB_INIT;
}
......@@ -1278,6 +1279,40 @@ driver_open_device( CoreInputDevice *device,
return DFB_OK;
}
/*
* Obtain information about an axis (only absolute axis so far).
*/
static DFBResult
driver_get_axis_info( CoreInputDevice *device,
void *driver_data,
DFBInputDeviceAxisIdentifier axis,
DFBInputDeviceAxisInfo *ret_info )
{
LinuxInputData *data = (LinuxInputData*) driver_data;
if (data->touchpad)
return DFB_OK;
if (axis <= ABS_PRESSURE && axis < DIAI_LAST) {
unsigned long absbit[NBITS(ABS_CNT)];
/* check if we have an absolute axes */
ioctl( data->fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit );
if (test_bit (axis, absbit)) {
struct input_absinfo absinfo;
if (ioctl( data->fd, EVIOCGABS(axis), &absinfo ) == 0 &&
(absinfo.minimum || absinfo.maximum)) {
ret_info->flags |= DIAIF_ABS_MIN | DIAIF_ABS_MAX;
ret_info->abs_min = absinfo.minimum;
ret_info->abs_max = absinfo.maximum;
}
}
}
return DFB_OK;
}
/*
* Fetch one entry from the kernel keymap.
......
......@@ -328,6 +328,7 @@ Construct( IDirectFBImageProvider *thiz,
jpeg_destroy_decompress(&cinfo);
buffer->Release( buffer );
DIRECT_DEALLOCATE_INTERFACE( thiz );
return DFB_FAILURE;
}
......
......@@ -753,9 +753,9 @@ install-exec-local:
@BUILD_STATIC_FALSE@all-local:
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@install-data-local:
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@install-data-local: install-libLTLIBRARIES
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ mkdir -p -- "$(DESTDIR)$(libdir)"
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ nm -n ".libs/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)"
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ nm -n "$(DESTDIR)$(libdir)/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)"
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
......@@ -30,7 +30,7 @@
#define DIRECT_BUILD_DEBUG (1)
#define DIRECT_BUILD_DEBUGS (1)
#define DIRECT_BUILD_TRACE (0)
#define DIRECT_BUILD_TRACE (1)
#define DIRECT_BUILD_TEXT (1)
#define DIRECT_BUILD_GETTID (1)
#define DIRECT_BUILD_NETWORK (1)
......
......@@ -276,9 +276,10 @@ direct_modules_explore_directory( DirectModuleDir *directory )
}
if (module->disabled) {
dlclose( handle );
module->loaded = false;
/* may call direct_modules_unregister() */
dlclose( handle );
}
else {
module->handle = handle;
......@@ -405,15 +406,20 @@ load_module( DirectModuleEntry *module )
static void
unload_module( DirectModuleEntry *module )
{
void *handle;
D_MAGIC_ASSERT( module, DirectModuleEntry );
D_ASSERT( module->dynamic == true );
D_ASSERT( module->handle != NULL );
D_ASSERT( module->loaded == true );
dlclose( module->handle );
handle = module->handle;
module->handle = NULL;
module->loaded = false;
/* may call direct_modules_unregister() */
dlclose( handle );
}
static void *
......
......@@ -796,9 +796,9 @@ install-exec-local:
@BUILD_STATIC_FALSE@all-local:
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@install-data-local:
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@install-data-local: install-libLTLIBRARIES
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ mkdir -p -- "$(DESTDIR)$(libdir)"
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ nm -n ".libs/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)"
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ nm -n "$(DESTDIR)$(libdir)/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)"
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
......@@ -655,9 +655,9 @@ install-exec-local:
@BUILD_STATIC_FALSE@all-local:
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@install-data-local:
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@install-data-local: install-libLTLIBRARIES
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ mkdir -p -- "$(DESTDIR)$(libdir)"
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ nm -n ".libs/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)"
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ nm -n "$(DESTDIR)$(libdir)/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)"
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
......@@ -16,8 +16,9 @@ idirectfbwindowdir = $(INTERFACES_DIR)/IDirectFBWindow
idirectfbvideoproviderdir = $(INTERFACES_DIR)/IDirectFBVideoProvider
INCLUDES = \
-I$(top_builddir)/include \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib \
-I$(top_builddir)/lib \
-I$(top_srcdir)/src \
-I$(top_srcdir)/proxy/requestor \
......
......@@ -447,8 +447,9 @@ idirectfbsurfacedir = $(INTERFACES_DIR)/IDirectFBSurface
idirectfbwindowdir = $(INTERFACES_DIR)/IDirectFBWindow
idirectfbvideoproviderdir = $(INTERFACES_DIR)/IDirectFBVideoProvider
INCLUDES = \
-I$(top_builddir)/include \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib \
-I$(top_builddir)/lib \
-I$(top_srcdir)/src \
-I$(top_srcdir)/proxy/requestor \
......
......@@ -16,8 +16,9 @@ idirectfbwindowdir = $(INTERFACES_DIR)/IDirectFBWindow
idirectfbvideoproviderdir = $(INTERFACES_DIR)/IDirectFBVideoProvider
INCLUDES = \
-I$(top_builddir)/include \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib \
-I$(top_builddir)/lib \
-I$(top_srcdir)/src \
-I$(top_srcdir)/proxy/dispatcher \
......
......@@ -446,8 +446,9 @@ idirectfbsurfacedir = $(INTERFACES_DIR)/IDirectFBSurface
idirectfbwindowdir = $(INTERFACES_DIR)/IDirectFBWindow
idirectfbvideoproviderdir = $(INTERFACES_DIR)/IDirectFBVideoProvider
INCLUDES = \
-I$(top_builddir)/include \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/lib \
-I$(top_builddir)/lib \
-I$(top_srcdir)/src \
-I$(top_srcdir)/proxy/dispatcher \
......
......@@ -3,9 +3,9 @@ if ENABLE_TRACE
LIBTONM = $(LTLIBRARIES:.la=-$(LT_RELEASE).so.$(LT_BINARY))
install-data-local:
install-data-local: install-libLTLIBRARIES
mkdir -p -- "$(DESTDIR)$(libdir)"
nm -n ".libs/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)"
nm -n "$(DESTDIR)$(libdir)/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)"
endif
endif
......@@ -737,9 +737,9 @@ uninstall-am: uninstall-internalincludeHEADERS \
@BUILD_STATIC_FALSE@all-local:
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@install-data-local:
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@install-data-local: install-libLTLIBRARIES
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ mkdir -p -- "$(DESTDIR)$(libdir)"
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ nm -n ".libs/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)"
@BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ nm -n "$(DESTDIR)$(libdir)/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)"
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
......@@ -590,6 +590,11 @@ dfb_gfxcard_state_check( CardState *state, DFBAccelerationMask accel )
return false;
}
/* Destination buffer may have been destroyed (suspended). i.e by a vt-switching */
if (dst->num_buffers == 0 ) {
return false;
}
/* Source may have been destroyed. */
if (DFB_BLITTING_FUNCTION( accel )) {
if (!src) {
......
......@@ -464,6 +464,8 @@ dfb_input_core_shutdown( DFBInputCore *data,
fusion_skirmish_destroy( &devshared->lock );
if (device->driver_data != NULL) {
void *driver_data;
D_ASSERT( driver->funcs != NULL );
D_ASSERT( driver->funcs->CloseDevice != NULL );
......@@ -472,8 +474,9 @@ dfb_input_core_shutdown( DFBInputCore *data,
driver->info.version.major,
driver->info.version.minor, driver->info.vendor );
driver->funcs->CloseDevice( device->driver_data );
driver_data = device->driver_data;
device->driver_data = NULL;
driver->funcs->CloseDevice( driver_data );
}
if (!--driver->nr_devices) {
......@@ -558,6 +561,8 @@ dfb_input_core_suspend( DFBInputCore *data )
D_ASSERT( devshared != NULL );
if (device->driver_data != NULL) {
void *driver_data;
D_ASSERT( driver->funcs != NULL );
D_ASSERT( driver->funcs->CloseDevice != NULL );
......@@ -566,8 +571,9 @@ dfb_input_core_suspend( DFBInputCore *data )
driver->info.version.major,
driver->info.version.minor, driver->info.vendor );
driver->funcs->CloseDevice( device->driver_data );
driver_data = device->driver_data;
device->driver_data = NULL;
driver->funcs->CloseDevice( driver_data );
}
flush_keys( device );
......
......@@ -106,6 +106,13 @@ context_destructor( FusionObject *object, bool zombie, void *ctx )
/* Remove the context from the layer's context stack. */
dfb_layer_remove_context( layer, context );
/*
* Detach input devices before taking the context lock to prevent a
* deadlock between windowstack destruction and input event processing.
*/
if (context->stack)
dfb_windowstack_detach_devices( context->stack );
dfb_layer_context_lock( context );
/* Destroy the window stack. */
......@@ -238,10 +245,7 @@ dfb_layer_context_activate( CoreLayerContext *context )
/* Iterate through all regions. */
fusion_vector_foreach (region, index, context->regions) {
/* Activate each region. */
if (dfb_layer_region_activate( region ))
D_WARN( "could not activate region!" );
/* first reallocate.. */
if (region->surface) {
D_ASSERT( region->surface_lock.buffer == NULL );
......@@ -249,6 +253,10 @@ dfb_layer_context_activate( CoreLayerContext *context )
if (ret)
D_DERROR( ret, "Core/Layers: Reallocation of layer surface failed!\n" );
}
/* ..then activate each region. */
if (dfb_layer_region_activate( region ))
D_WARN( "could not activate region!" );
}
context->active = true;
......@@ -662,19 +670,22 @@ dfb_layer_context_set_configuration( CoreLayerContext *context,
D_FLAGS_CLEAR( region->state, CLRSF_CONFIGURED );
/* Unlock the region surface */
if (region->surface) {
if (D_FLAGS_IS_SET( region->state, CLRSF_REALIZED )) {
if (!D_FLAGS_IS_SET( region->state, CLRSF_FROZEN ))
D_ASSUME( region->surface_lock.buffer != NULL );
if (region->surface_lock.buffer)
dfb_surface_unlock_buffer( region->surface, &region->surface_lock );
}
}
/* (Re)allocate the region's surface. */
if (surface) {
flags |= CLRCF_SURFACE | CLRCF_PALETTE;
if (region->surface) {
if (D_FLAGS_IS_SET( region->state, CLRSF_REALIZED )) {
if (!D_FLAGS_IS_SET( region->state, CLRSF_FROZEN ))
D_ASSUME( region->surface_lock.buffer != NULL );
if (region->surface_lock.buffer)
dfb_surface_unlock_buffer( region->surface, &region->surface_lock );
}
ret = reallocate_surface( layer, region, &region_config );
if (ret)
D_DERROR( ret, "Core/Layers: Reallocation of layer surface failed!\n" );
......
......@@ -363,22 +363,29 @@ dfb_surface_notify( CoreSurface *surface,
DFBResult
dfb_surface_flip( CoreSurface *surface, bool swap )
{
unsigned int back, front;
D_MAGIC_ASSERT( surface, CoreSurface );
if (surface->num_buffers == 0)
return DFB_SUSPENDED;
FUSION_SKIRMISH_ASSERT( &surface->lock );
D_ASSERT( surface->buffer_indices[CSBR_BACK] < surface->num_buffers );
D_ASSERT( surface->buffer_indices[CSBR_FRONT] < surface->num_buffers );
back = (surface->flips + CSBR_BACK) % surface->num_buffers;
front = (surface->flips + CSBR_FRONT) % surface->num_buffers;
D_ASSERT( surface->buffer_indices[back] < surface->num_buffers );
D_ASSERT( surface->buffer_indices[front] < surface->num_buffers );
if (surface->buffers[surface->buffer_indices[CSBR_BACK]]->policy !=
surface->buffers[surface->buffer_indices[CSBR_FRONT]]->policy)
if (surface->buffers[surface->buffer_indices[back]]->policy !=
surface->buffers[surface->buffer_indices[front]]->policy)
return DFB_UNSUPPORTED;
if (swap) {
int tmp = surface->buffer_indices[CSBR_BACK];
surface->buffer_indices[CSBR_BACK] = surface->buffer_indices[CSBR_FRONT];
surface->buffer_indices[CSBR_FRONT] = tmp;
int tmp = surface->buffer_indices[back];
surface->buffer_indices[back] = surface->buffer_indices[front];
surface->buffer_indices[front] = tmp;
}
else
surface->flips++;
......@@ -537,6 +544,9 @@ dfb_surface_lock_buffer( CoreSurface *surface,
D_MAGIC_ASSERT( surface, CoreSurface );
if (surface->num_buffers == 0)
return DFB_SUSPENDED;
if (fusion_skirmish_prevail( &surface->lock ))
return DFB_FUSION;
......@@ -583,6 +593,9 @@ dfb_surface_read_buffer( CoreSurface *surface,
D_ASSERT( pitch > 0 );
DFB_RECTANGLE_ASSERT_IF( rect );
if (surface->num_buffers == 0)
return DFB_SUSPENDED;
if (fusion_skirmish_prevail( &surface->lock ))
return DFB_FUSION;
......@@ -611,6 +624,9 @@ dfb_surface_write_buffer( CoreSurface *surface,
D_ASSERT( pitch > 0 );
DFB_RECTANGLE_ASSERT_IF( rect );
if (surface->num_buffers == 0)
return DFB_SUSPENDED;
if (fusion_skirmish_prevail( &surface->lock ))
return DFB_FUSION;
......@@ -637,6 +653,9 @@ dfb_surface_dump_buffer( CoreSurface *surface,
D_ASSERT( path != NULL );
D_ASSERT( prefix != NULL );
if (surface->num_buffers == 0)
return DFB_SUSPENDED;
if (fusion_skirmish_prevail( &surface->lock ))
return DFB_FUSION;
......
......@@ -358,11 +358,14 @@ dfb_window_create( CoreWindowStack *stack,
/* Create the window object. */
window = dfb_core_create_window( layer->core );
window->id = ++stack->id_pool;
window->caps = caps;
window->stack = stack;
window->config = config;
window->parent_id = (desc->flags & DWDESC_PARENT) ? desc->parent_id : 0;
window->id = ++stack->id_pool;
window->caps = caps;
window->stack = stack;
window->config = config;
window->config.association = (desc->flags & DWDESC_PARENT) ? desc->parent_id : 0;
if (desc->flags & DWDESC_RESOURCE_ID)
window->resource_id = desc->resource_id;
ret = dfb_wm_preconfigure_window( stack, window );
if(ret) {
......@@ -381,7 +384,7 @@ dfb_window_create( CoreWindowStack *stack,
window->caps, surface_caps, window->id );
/* Create the window's surface using the layer's palette if possible. */
if (! (caps & DWCAPS_INPUTONLY)) {
if (! (caps & (DWCAPS_INPUTONLY | DWCAPS_COLOR))) {
if (context->config.buffermode == DLBM_WINDOWS) {
CoreLayerRegion *region = NULL;
......@@ -1100,6 +1103,44 @@ dfb_window_unbind( CoreWindow *window,
return bound ? DFB_OK : DFB_ITEMNOTFOUND;
}
/*
* sets the source color key
*/
DFBResult
dfb_window_set_color( CoreWindow *window,
DFBColor color )
{
DFBResult ret;
DFBColor cc;
CoreWindowConfig config;
CoreWindowStack *stack = window->stack;
/* Lock the window stack. */
if (dfb_windowstack_lock( stack ))
return DFB_FUSION;
/* Never call WM after destroying the window. */
if (DFB_WINDOW_DESTROYED( window )) {
dfb_windowstack_unlock( stack );
return DFB_DESTROYED;
}
cc = window->config.color;
if ( (cc.a==color.a) && (cc.r==color.r) && (cc.g==color.g) && (cc.b==color.b) ) {
dfb_windowstack_unlock( stack );
return DFB_OK;
}
config.color = color;
ret = dfb_wm_set_window_config( window, &config, CWCF_COLOR );
/* Unlock the window stack. */
dfb_windowstack_unlock( stack );