mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
libtriple/framebuffer: use DirectFB acceleration
Use a hack, almost as ugly as the original Coolstream code ;), to accelerate drawing of boxes and blitting with DirectFB functions.
This commit is contained in:
@@ -21,11 +21,12 @@ static const char * FILENAME = "init_td.cpp";
|
|||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
|
|
||||||
/* the super interface */
|
/* the super interface */
|
||||||
static IDirectFB *dfb;
|
IDirectFB *dfb;
|
||||||
/* the primary surface */
|
/* the primary surface */
|
||||||
static IDirectFBSurface *primary;
|
static IDirectFBSurface *primary;
|
||||||
static IDirectFBSurface *dest;
|
IDirectFBSurface *dfbdest;
|
||||||
static IDirectFBDisplayLayer *layer;
|
static IDirectFBDisplayLayer *layer;
|
||||||
|
int gfxfd = -1;
|
||||||
|
|
||||||
#define DFBCHECK(x...) \
|
#define DFBCHECK(x...) \
|
||||||
err = x; \
|
err = x; \
|
||||||
@@ -74,13 +75,13 @@ static void dfb_init()
|
|||||||
primary->GetPixelFormat(primary, &pixelformat);
|
primary->GetPixelFormat(primary, &pixelformat);
|
||||||
primary->GetSize(primary, &SW, &SH);
|
primary->GetSize(primary, &SW, &SH);
|
||||||
primary->Clear(primary, 0, 0, 0, 0);
|
primary->Clear(primary, 0, 0, 0, 0);
|
||||||
primary->GetSubSurface(primary, NULL, &dest);
|
primary->GetSubSurface(primary, NULL, &dfbdest);
|
||||||
dest->Clear(dest, 0, 0, 0, 0);
|
dfbdest->Clear(dfbdest, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dfb_deinit()
|
static void dfb_deinit()
|
||||||
{
|
{
|
||||||
dest->Release(dest);
|
dfbdest->Release(dfbdest);
|
||||||
primary->Release(primary);
|
primary->Release(primary);
|
||||||
layer->Release(layer);
|
layer->Release(layer);
|
||||||
dfb->Release(dfb);
|
dfb->Release(dfb);
|
||||||
@@ -119,6 +120,9 @@ void init_td_api()
|
|||||||
if (setpgid(0, pid))
|
if (setpgid(0, pid))
|
||||||
perror("setpgid");
|
perror("setpgid");
|
||||||
rc_init();
|
rc_init();
|
||||||
|
gfxfd = open("/dev/stb/tdgfx", O_RDWR);
|
||||||
|
if (gfxfd < 0)
|
||||||
|
perror("open /dev/stb/tdgfx");
|
||||||
}
|
}
|
||||||
initialized = true;
|
initialized = true;
|
||||||
fprintf(stderr, "%s:%s end\n", FILENAME, __FUNCTION__);
|
fprintf(stderr, "%s:%s end\n", FILENAME, __FUNCTION__);
|
||||||
@@ -129,5 +133,8 @@ void shutdown_td_api()
|
|||||||
fprintf(stderr, "%s:%s, initialized = %d\n", FILENAME, __FUNCTION__, (int)initialized);
|
fprintf(stderr, "%s:%s, initialized = %d\n", FILENAME, __FUNCTION__, (int)initialized);
|
||||||
if (initialized)
|
if (initialized)
|
||||||
dfb_deinit();
|
dfb_deinit();
|
||||||
|
if (gfxfd > -1)
|
||||||
|
close(gfxfd);
|
||||||
|
gfxfd = -1;
|
||||||
initialized = false;
|
initialized = false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user