mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-02-06 02:01:50 +08:00
Upgrade DrmDriverOps to version 2 and enhance ChechHWBlit
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ(2.60)
|
||||
AC_INIT(libminigui, 5.0.13)
|
||||
AC_INIT(libminigui, 5.0.14)
|
||||
AC_CONFIG_SRCDIR(src/main/main.c)
|
||||
|
||||
dnl Set various version strings - taken gratefully from the SDL sources
|
||||
@@ -16,9 +16,9 @@ dnl Set various version strings - taken gratefully from the SDL sources
|
||||
#
|
||||
MINIGUI_MAJOR_VERSION=5
|
||||
MINIGUI_MINOR_VERSION=0
|
||||
MINIGUI_MICRO_VERSION=13
|
||||
MINIGUI_INTERFACE_AGE=1
|
||||
MINIGUI_BINARY_AGE=3
|
||||
MINIGUI_MICRO_VERSION=14
|
||||
MINIGUI_INTERFACE_AGE=0
|
||||
MINIGUI_BINARY_AGE=0
|
||||
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
||||
|
||||
AC_SUBST(MINIGUI_MAJOR_VERSION)
|
||||
|
||||
@@ -84,6 +84,12 @@ extern "C" {
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** The current version of DRM driver. */
|
||||
#define DRM_DRIVER_VERSION 2
|
||||
|
||||
#define DRM_SURBUF_TYPE_OFFSCREEN 0x0000
|
||||
#define DRM_SURBUF_TYPE_SCANOUT 0x0001
|
||||
|
||||
/**
|
||||
* The struct type represents the DRI sub driver.
|
||||
* The concrete struct should be defined by the driver.
|
||||
@@ -157,8 +163,50 @@ typedef struct _DrmSurfaceBuffer {
|
||||
uint8_t* buff;
|
||||
} DrmSurfaceBuffer;
|
||||
|
||||
typedef enum {
|
||||
BLIT_COPY_NORMAL = 0,
|
||||
BLIT_COPY_SCALE,
|
||||
BLIT_COPY_ROT_90,
|
||||
BLIT_COPY_ROT_180,
|
||||
BLIT_COPY_ROT_270,
|
||||
BLIT_COPY_FLIP_H,
|
||||
BLIT_COPY_FLIP_V,
|
||||
BLIT_COPY_FLIP_H_V
|
||||
} BlitCopyOperation;
|
||||
|
||||
typedef enum {
|
||||
BLIT_COLORKEY_NONE = 0,
|
||||
BLIT_COLORKEY_NORMAL,
|
||||
BLIT_COLORKEY_INVERT,
|
||||
} BlitKeyOperation;
|
||||
|
||||
typedef enum {
|
||||
BLIT_ALPHA_NONE = 0,
|
||||
BLIT_ALPHA_BYTE,
|
||||
BLIT_ALPHA_FLOAT,
|
||||
} BlitAlphaOperation;
|
||||
|
||||
typedef struct _DrmBlitOperations {
|
||||
BlitCopyOperation cpy;
|
||||
BlitKeyOperation key;
|
||||
BlitAlphaOperation alf;
|
||||
ColorBlendMethod bld;
|
||||
ColorLogicalOp rop;
|
||||
ScalingFilter scl;
|
||||
|
||||
uint32_t key_min, key_max;
|
||||
union {
|
||||
uint8_t alpha_byte;
|
||||
double alpha_float;
|
||||
};
|
||||
} DrmBlitOperations;
|
||||
|
||||
typedef int (*CB_DRM_BLIT) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer *src_buf, const GAL_Rect *src_rc,
|
||||
DrmSurfaceBuffer *dst_buf, const GAL_Rect *dst_rc,
|
||||
const DrmBlitOperations *blit_ops);
|
||||
/**
|
||||
* The structure type defines the operations for a DRM driver.
|
||||
* The structure type defines the operations for a userland DRM driver.
|
||||
*/
|
||||
typedef struct _DrmDriverOps {
|
||||
/**
|
||||
@@ -194,7 +242,7 @@ typedef struct _DrmDriverOps {
|
||||
*/
|
||||
DrmSurfaceBuffer* (* create_buffer) (DrmDriver *driver,
|
||||
uint32_t drm_format, uint32_t hdr_size,
|
||||
uint32_t width, uint32_t height);
|
||||
uint32_t width, uint32_t height, unsigned flags);
|
||||
|
||||
/**
|
||||
* This operation creates a buffer from a given and possibly foreign handle
|
||||
@@ -207,7 +255,9 @@ typedef struct _DrmDriverOps {
|
||||
* DrmSurfaceBuffer object.
|
||||
*/
|
||||
DrmSurfaceBuffer* (* create_buffer_from_handle) (DrmDriver *driver,
|
||||
uint32_t handle, size_t size);
|
||||
uint32_t handle, size_t size,
|
||||
uint32_t drm_format, uint32_t hdr_size,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
|
||||
/**
|
||||
* This operation creates a buffer for the given system global name
|
||||
@@ -219,7 +269,9 @@ typedef struct _DrmDriverOps {
|
||||
* DrmSurfaceBuffer object.
|
||||
*/
|
||||
DrmSurfaceBuffer* (* create_buffer_from_name) (DrmDriver *driver,
|
||||
uint32_t name);
|
||||
uint32_t name,
|
||||
uint32_t drm_format, uint32_t hdr_size,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
|
||||
/**
|
||||
* This operation creates a buffer for the given PRIME file descriptor
|
||||
@@ -231,21 +283,19 @@ typedef struct _DrmDriverOps {
|
||||
* DrmSurfaceBuffer object.
|
||||
*/
|
||||
DrmSurfaceBuffer* (* create_buffer_from_prime_fd) (DrmDriver *driver,
|
||||
int prime_fd, size_t size);
|
||||
int prime_fd, size_t size,
|
||||
uint32_t drm_format, uint32_t hdr_size,
|
||||
uint32_t width, uint32_t height, uint32_t pitch);
|
||||
|
||||
/**
|
||||
* This operation maps the buffer into the current process's virtual memory
|
||||
* space, and returns the virtual address. If failed, it returns NULL.
|
||||
*
|
||||
* When \a for_scanout is not zero, the buffer will be used for scan out
|
||||
* frame buffer.
|
||||
*
|
||||
* \note The driver must implement this operation. The driver must
|
||||
* set a valid value for buff field of the DrmSurfaceBuffer object
|
||||
* on success.
|
||||
*/
|
||||
uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer,
|
||||
int for_scanout);
|
||||
uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
|
||||
|
||||
/**
|
||||
* This operation un-maps a buffer.
|
||||
@@ -264,96 +314,61 @@ typedef struct _DrmDriverOps {
|
||||
void (* destroy_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
|
||||
|
||||
/**
|
||||
* This operation clears the specific rectangle area of a buffer
|
||||
* This operation fills the specific rectangle area of a buffer
|
||||
* with the specific pixel value. If succeed, it returns 0.
|
||||
*
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated clear operation.
|
||||
* hardware accelerated filling operation.
|
||||
*/
|
||||
int (* clear_buffer) (DrmDriver *driver,
|
||||
int (* fill_rect) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* rc, uint32_t pixel_value);
|
||||
|
||||
/**
|
||||
* This operation checks whether a hardware accelerated blit
|
||||
* This operation checks whether a specified hardware accelerated blit
|
||||
* can be done between the source buffer and the destination buffer.
|
||||
* If succeed, it returns 0.
|
||||
* If succeed, it returns a callback for the specified blit operations.
|
||||
*
|
||||
* \note If this operation is set as NULL, it will be supposed that
|
||||
* the driver does not support any hardware accelerated blitting operation.
|
||||
*/
|
||||
int (* check_blit) (DrmDriver *driver,
|
||||
CB_DRM_BLIT (* check_blit) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||
const DrmBlitOperations *ops);
|
||||
|
||||
/**
|
||||
* This operation copies the whole bits from a source buffer to
|
||||
* a destination buffer.
|
||||
*
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated copy operation between buffers.
|
||||
*/
|
||||
int (* copy_buff) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf);
|
||||
|
||||
/**
|
||||
* This operation copies bits from a source buffer to a destination buffer.
|
||||
* This operation rotates the bits from a source buffer to
|
||||
* a destination buffer.
|
||||
*
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated copy blitting.
|
||||
*
|
||||
* \note Currently, the logical operation is ignored.
|
||||
* hardware accelerated rotation operation between buffers.
|
||||
*/
|
||||
int (* copy_blit) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||
ColorLogicalOp logic_op);
|
||||
int (* rotate_buff) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf,
|
||||
BlitCopyOperation op);
|
||||
|
||||
/**
|
||||
* This operation blits pixels from a source buffer with the source alpha
|
||||
* value specified to a destination buffer.
|
||||
* This operation flips the bits from a source buffer to
|
||||
* a destination buffer.
|
||||
*
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated blitting with alpha.
|
||||
* hardware accelerated flip operation between buffers.
|
||||
*/
|
||||
int (* alpha_blit) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||
uint8_t alpha);
|
||||
|
||||
/**
|
||||
* This operation blits pixels from a source buffer to a destination buffer,
|
||||
* but skipping the pixel value specified by \a color_key.
|
||||
*
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated blitting with color key.
|
||||
*/
|
||||
int (* key_blit) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||
uint32_t color_key);
|
||||
|
||||
/**
|
||||
* This operation blits pixels from a source buffer with the source alpha
|
||||
* value specified to a destination buffer, but skipping the pixel value
|
||||
* specified.
|
||||
*
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated blitting with alpha and color key.
|
||||
*/
|
||||
int (* alpha_key_blit) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||
uint8_t alpha, uint32_t color_key);
|
||||
|
||||
/**
|
||||
* This operation blits pixels from a source buffer with the source alpha
|
||||
* value of pixels to the destination buffer, and with the specified color
|
||||
* compositing/blending method (\a ColorBlendMethod).
|
||||
*
|
||||
* \note If this operation is set as NULL, the driver does not support
|
||||
* hardware accelerated blitting with alpha on basis per pixel.
|
||||
*
|
||||
* \note Currently, the color compositing/blending method is ignored.
|
||||
*/
|
||||
int (* alpha_pixel_blit) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
|
||||
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
|
||||
ColorBlendMethod blend_method);
|
||||
|
||||
int (* flip_buff) (DrmDriver *driver,
|
||||
DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf,
|
||||
BlitCopyOperation op);
|
||||
} DrmDriverOps;
|
||||
|
||||
/** The current version of DRM driver. */
|
||||
#define DRM_DRIVER_VERSION 1
|
||||
|
||||
/**
|
||||
* Implement this stub to return the DRI driver operations
|
||||
*
|
||||
|
||||
@@ -5170,7 +5170,8 @@ MG_EXPORT BOOL GUIAPI FillBitmapPartInBox (HDC hdc, int box_x, int box_y,
|
||||
*/
|
||||
typedef enum {
|
||||
COLOR_BLEND_LEGACY = 0,
|
||||
COLOR_BLEND_FLAGS_MASK = 0x00FF,
|
||||
COLOR_BLEND_MASK = 0xFFFF,
|
||||
COLOR_BLEND_PIXMAN_MASK = 0x00FF,
|
||||
|
||||
/** Porter Duff rule: clear */
|
||||
COLOR_BLEND_PD_CLEAR = 0x0100, // PIXMAN_OP_CLEAR = 0x00
|
||||
@@ -5308,22 +5309,25 @@ typedef enum {
|
||||
* The color logical operations.
|
||||
*/
|
||||
typedef enum {
|
||||
COLOR_LOGICOP_CLEAR = 0,
|
||||
COLOR_LOGICOP_NOR,
|
||||
COLOR_LOGICOP_AND_INVERTED,
|
||||
COLOR_LOGICOP_COPY_INVERTED,
|
||||
COLOR_LOGICOP_AND_REVERSE,
|
||||
COLOR_LOGICOP_INVERT,
|
||||
COLOR_LOGICOP_XOR,
|
||||
COLOR_LOGICOP_NAND,
|
||||
COLOR_LOGICOP_AND,
|
||||
COLOR_LOGICOP_EQUIV,
|
||||
COLOR_LOGICOP_NOOP0,
|
||||
COLOR_LOGICOP_OR_INVERTED1,
|
||||
COLOR_LOGICOP_COPY,
|
||||
COLOR_LOGICOP_OR_REVERSE,
|
||||
COLOR_LOGICOP_OR,
|
||||
COLOR_LOGICOP_SET,
|
||||
COLOR_LOGICOP_CLEAR = 0,
|
||||
COLOR_LOGICOP_NOR = 0x01 << 24,
|
||||
COLOR_LOGICOP_AND_INVERTED = 0x02 << 24,
|
||||
COLOR_LOGICOP_COPY_INVERTED = 0x03 << 24,
|
||||
COLOR_LOGICOP_AND_REVERSE = 0x04 << 24,
|
||||
COLOR_LOGICOP_INVERT = 0x05 << 24,
|
||||
COLOR_LOGICOP_XOR = 0x06 << 24,
|
||||
COLOR_LOGICOP_NAND = 0x07 << 24,
|
||||
COLOR_LOGICOP_AND = 0x08 << 24,
|
||||
COLOR_LOGICOP_EQUIV = 0x09 << 24,
|
||||
COLOR_LOGICOP_NOOP0 = 0x0A << 24,
|
||||
COLOR_LOGICOP_OR_INVERTED1 = 0x0B << 24,
|
||||
COLOR_LOGICOP_COPY = 0x0C << 24,
|
||||
COLOR_LOGICOP_OR_REVERSE = 0x0D << 24,
|
||||
COLOR_LOGICOP_OR = 0x0E << 24,
|
||||
COLOR_LOGICOP_SET = 0x0F << 24,
|
||||
|
||||
COLOR_LOGICOP_MASK = 0x0F << 24,
|
||||
COLOR_LOGICOP_SHIFT = 24,
|
||||
} ColorLogicalOp;
|
||||
|
||||
/**
|
||||
@@ -5353,15 +5357,18 @@ typedef enum {
|
||||
* in the destination DC.
|
||||
* \param dy The y coordinate of the upper-left corner of the rectangle
|
||||
* in the destination DC.
|
||||
* \param dwRop The color blending method, see \a ColorBlendMethod.
|
||||
* This argument is only valid when Pixman is used.
|
||||
* \param dwRop The color blending method, see \a ColorBlendMethod, OR'd
|
||||
* with a color logical operation, see \a ColorLogicalOp.
|
||||
* This argument is only valid when Pixman is used, or the hardware
|
||||
* provides a proper accelerator.
|
||||
*
|
||||
* \note When the source color key is specified for the blitting operation,
|
||||
* or the formats of the device contexts are not supported by Pixman,
|
||||
* this function will use the legacy implementation. In this situation,
|
||||
* the color blending method will be ignored.
|
||||
*
|
||||
* \sa StretchBlt, SetMemDCAlpha, SetMemDCColorKey, ColorBlendMethod
|
||||
* \sa StretchBlt, SetMemDCAlpha, SetMemDCColorKey, ColorBlendMethod,
|
||||
* ColorLogicalOp
|
||||
*/
|
||||
MG_EXPORT void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh,
|
||||
HDC hddc, int dx, int dy, DWORD dwRop);
|
||||
@@ -5371,18 +5378,20 @@ MG_EXPORT void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh,
|
||||
*/
|
||||
typedef enum {
|
||||
/** The fast filter (DDA scaler) */
|
||||
SCALING_FILTER_FAST = 0x00000000,
|
||||
SCALING_FILTER_FAST = 0x0000 << 16,
|
||||
/** The good filter */
|
||||
SCALING_FILTER_GOOD = 0x00010000,
|
||||
SCALING_FILTER_GOOD = 0x0001 << 16,
|
||||
/** The best filter */
|
||||
SCALING_FILTER_BEST = 0x00020000,
|
||||
SCALING_FILTER_BEST = 0x0002 << 16,
|
||||
/** The filter using nearest algorithm */
|
||||
SCALING_FILTER_NEAREST = 0x00020000,
|
||||
SCALING_FILTER_NEAREST = 0x0003 << 16,
|
||||
/** The filter using bi-linear algorithm */
|
||||
SCALING_FILTER_BILINEAR = 0x00040000,
|
||||
SCALING_FILTER_BILINEAR = 0x0004 << 16,
|
||||
/** The filter using convolution algorithm */
|
||||
SCALING_FILTER_CONVOLUTION = 0x00050000,
|
||||
SCALING_FILTER_SHIFT = 16,
|
||||
SCALING_FILTER_CONVOLUTION = 0x0005 << 16,
|
||||
|
||||
SCALING_FILTER_MASK = (0x0F << 16),
|
||||
SCALING_FILTER_SHIFT = 16,
|
||||
} ScalingFilter;
|
||||
|
||||
/**
|
||||
@@ -5435,8 +5444,10 @@ typedef struct _STRETCH_EXTRA_INFO {
|
||||
* \param sei The pointer to a stretch extra information strucure;
|
||||
* can be NULL. Note this only works when Pixman is used.
|
||||
* \param dwRop The color blending method, see \a ColorBlendMethod, OR'd
|
||||
* with a fiter of the scaling, see \a ScalingFilter.
|
||||
* This argument only works when Pixman is used.
|
||||
* with a fiter of the scaling, see \a ScalingFilter, and OR'd
|
||||
* with a color logical operation, see \a ColorLogicalOp.
|
||||
* This argument only works when Pixman is used or the hardware
|
||||
* provides a proper accelerator.
|
||||
*
|
||||
* \return TRUE for success, FALSE for bad arguments and there is no any
|
||||
* drawing occurred.
|
||||
@@ -5448,7 +5459,7 @@ typedef struct _STRETCH_EXTRA_INFO {
|
||||
* will be ignored.
|
||||
*
|
||||
* \sa BitBlt, SetMemDCAlpha, SetMemDCColorKey, STRETCH_EXTRA_INFO,
|
||||
* ColorBlendMethod, ScalingFilter
|
||||
* ColorBlendMethod, ScalingFilter, ColorLogicalOp
|
||||
*/
|
||||
MG_EXPORT BOOL GUIAPI StretchBltEx (HDC hsdc, int sx, int sy, int sw, int sh,
|
||||
HDC hddc, int dx, int dy, int dw, int dh,
|
||||
|
||||
@@ -171,7 +171,8 @@ static int GAL_PixmanBlit (struct GAL_Surface *src, GAL_Rect *srcrect,
|
||||
#endif
|
||||
|
||||
/* Figure out which of many blit routines to set up on a surface */
|
||||
int GAL_CalculateBlit(GAL_Surface *surface)
|
||||
int GAL_CalculateBlit(GAL_Surface *surface, const GAL_Rect *srcrc,
|
||||
const GAL_Rect *dstrc, DWORD op)
|
||||
{
|
||||
int blit_index;
|
||||
GAL_VideoDevice *src_video, *dst_video, *cur_video = NULL;
|
||||
@@ -242,7 +243,8 @@ int GAL_CalculateBlit(GAL_Surface *surface)
|
||||
if (hw_blit_ok && cur_video) {
|
||||
GAL_VideoDevice *video = cur_video;
|
||||
GAL_VideoDevice *this = cur_video;
|
||||
video->CheckHWBlit (this, surface, surface->map->dst);
|
||||
video->CheckHWBlit (this, surface, srcrc,
|
||||
surface->map->dst, dstrc, op);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +345,7 @@ int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops)
|
||||
else
|
||||
src->msk_img = NULL;
|
||||
|
||||
ops &= COLOR_BLEND_FLAGS_MASK;
|
||||
ops &= COLOR_BLEND_PIXMAN_MASK;
|
||||
if (ops == COLOR_BLEND_LEGACY) {
|
||||
if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) {
|
||||
src->pix_op = PIXMAN_OP_OVER;
|
||||
|
||||
@@ -80,7 +80,10 @@ typedef struct GAL_BlitMap {
|
||||
Uint8 *table;
|
||||
GAL_blit hw_blit;
|
||||
GAL_blit sw_blit;
|
||||
struct private_hwaccel *hw_data;
|
||||
union {
|
||||
struct private_hwaccel *hw_data;
|
||||
void *hw_void;
|
||||
};
|
||||
struct private_swaccel *sw_data;
|
||||
|
||||
int identity;
|
||||
@@ -94,7 +97,8 @@ typedef struct GAL_BlitMap {
|
||||
#include "blit_A.h"
|
||||
|
||||
/* Functions found in GAL_blit.c */
|
||||
extern int GAL_CalculateBlit(GAL_Surface *surface);
|
||||
extern int GAL_CalculateBlit(GAL_Surface *surface, const GAL_Rect *srcrc,
|
||||
const GAL_Rect *dstrc, DWORD op);
|
||||
|
||||
/* Functions found in GAL_blit_{0,1,N,A}.c */
|
||||
extern GAL_loblit GAL_CalculateBlit0(GAL_Surface *surface, int complex);
|
||||
|
||||
@@ -115,7 +115,8 @@ static GAL_Surface *DRM_SetVideoMode(_THIS, GAL_Surface *current,
|
||||
/* DRM engine methods accelerated */
|
||||
static int DRM_AllocHWSurface_Accl(_THIS, GAL_Surface *surface);
|
||||
static void DRM_FreeHWSurface_Accl(_THIS, GAL_Surface *surface);
|
||||
static int DRM_CheckHWBlit_Accl(_THIS, GAL_Surface *src, GAL_Surface *dst);
|
||||
static int DRM_CheckHWBlit_Accl(_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
|
||||
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op);
|
||||
static int DRM_FillHWRect_Accl(_THIS, GAL_Surface *dst, GAL_Rect *rect,
|
||||
Uint32 color);
|
||||
|
||||
@@ -776,7 +777,7 @@ static GAL_Surface* create_surface_from_buffer (_THIS,
|
||||
/* for dumb buffer, already mapped */
|
||||
if (surface_buffer->buff == NULL &&
|
||||
vdata->driver && vdata->driver_ops->map_buffer) {
|
||||
if (!vdata->driver_ops->map_buffer(vdata->driver, surface_buffer, 0)) {
|
||||
if (!vdata->driver_ops->map_buffer(vdata->driver, surface_buffer)) {
|
||||
_ERR_PRINTF ("NEWGAL>DRM: cannot map hardware buffer: %m\n");
|
||||
goto error;
|
||||
}
|
||||
@@ -1656,7 +1657,7 @@ static int DRM_VideoInit(_THIS, GAL_PixelFormat *vformat)
|
||||
#endif
|
||||
|
||||
if (this->hidden->driver) {
|
||||
if (this->hidden->driver_ops->clear_buffer) {
|
||||
if (this->hidden->driver_ops->fill_rect) {
|
||||
this->info.blit_fill = 1;
|
||||
this->FillHWRect = DRM_FillHWRect_Accl;
|
||||
}
|
||||
@@ -1669,10 +1670,8 @@ static int DRM_VideoInit(_THIS, GAL_PixelFormat *vformat)
|
||||
this->SetHWAlpha = DRM_SetHWAlpha_Accl;
|
||||
|
||||
this->info.blit_hw = 1;
|
||||
if (this->hidden->driver_ops->alpha_blit)
|
||||
this->info.blit_hw_A = 1;
|
||||
if (this->hidden->driver_ops->key_blit)
|
||||
this->info.blit_hw_CC = 1;
|
||||
this->info.blit_hw_A = 1;
|
||||
this->info.blit_hw_CC = 1;
|
||||
}
|
||||
else {
|
||||
this->CheckHWBlit = NULL;
|
||||
@@ -2725,11 +2724,12 @@ static GAL_Surface *DRM_SetVideoMode(_THIS, GAL_Surface *current,
|
||||
if (vdata->driver) {
|
||||
assert (vdata->driver_ops->create_buffer);
|
||||
real_buffer = vdata->driver_ops->create_buffer(vdata->driver,
|
||||
drm_format, 0, info->width, info->height);
|
||||
drm_format, 0, info->width, info->height,
|
||||
DRM_SURBUF_TYPE_SCANOUT);
|
||||
if (vdata->dbl_buff) {
|
||||
if (drm_map_buffer_via_dmabuf(vdata, real_buffer)) {
|
||||
_WRN_PRINTF("Cannot map real screen buffer via DMA-BUF\n");
|
||||
vdata->driver_ops->map_buffer(vdata->driver, real_buffer, 1);
|
||||
vdata->driver_ops->map_buffer(vdata->driver, real_buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2772,8 +2772,8 @@ static GAL_Surface *DRM_SetVideoMode(_THIS, GAL_Surface *current,
|
||||
assert (vdata->driver_ops->create_buffer);
|
||||
shadow_buffer = vdata->driver_ops->create_buffer(vdata->driver,
|
||||
drm_format, hdr_size,
|
||||
info->width, info->height);
|
||||
vdata->driver_ops->map_buffer(vdata->driver, shadow_buffer, 0);
|
||||
info->width, info->height, DRM_SURBUF_TYPE_OFFSCREEN);
|
||||
vdata->driver_ops->map_buffer(vdata->driver, shadow_buffer);
|
||||
}
|
||||
|
||||
if (shadow_buffer == NULL || shadow_buffer->buff == NULL) {
|
||||
@@ -2963,8 +2963,9 @@ static int DRM_AllocSharedHWSurface(_THIS, GAL_Surface *surface,
|
||||
hdr_size = sizeof (GAL_SharedSurfaceHeader);
|
||||
if (vdata->driver_ops) {
|
||||
surface_buffer = vdata->driver_ops->create_buffer(vdata->driver,
|
||||
drm_format, hdr_size, surface->w, surface->h);
|
||||
vdata->driver_ops->map_buffer(vdata->driver, surface_buffer, 0);
|
||||
drm_format, hdr_size, surface->w, surface->h,
|
||||
DRM_SURBUF_TYPE_OFFSCREEN);
|
||||
vdata->driver_ops->map_buffer(vdata->driver, surface_buffer);
|
||||
}
|
||||
else {
|
||||
surface_buffer = drm_create_dumb_buffer(vdata,
|
||||
@@ -2978,7 +2979,8 @@ static int DRM_AllocSharedHWSurface(_THIS, GAL_Surface *surface,
|
||||
}
|
||||
|
||||
/* get the prime fd */
|
||||
if (drmPrimeHandleToFD (vdata->dev_fd, surface_buffer->handle,
|
||||
if (surface_buffer->prime_fd < 0 &&
|
||||
drmPrimeHandleToFD (vdata->dev_fd, surface_buffer->handle,
|
||||
DRM_RDWR | DRM_CLOEXEC, &surface_buffer->prime_fd)) {
|
||||
_ERR_PRINTF ("NEWGAL>DRM: cannot get prime fd: %m\n");
|
||||
goto error;
|
||||
@@ -3049,7 +3051,7 @@ static int DRM_AttachSharedHWSurface(_THIS, GAL_Surface *surface,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!vdata->driver_ops->map_buffer(vdata->driver, surface_buffer, 0)) {
|
||||
if (!vdata->driver_ops->map_buffer(vdata->driver, surface_buffer)) {
|
||||
_ERR_PRINTF ("NEWGAL>DRM: cannot map hardware buffer: %m\n");
|
||||
goto error;
|
||||
}
|
||||
@@ -3532,12 +3534,12 @@ static int DRM_AllocHWSurface_Accl(_THIS, GAL_Surface *surface)
|
||||
}
|
||||
|
||||
surface_buffer = vdata->driver_ops->create_buffer(vdata->driver, drm_format,
|
||||
0, surface->w, surface->h);
|
||||
0, surface->w, surface->h, DRM_SURBUF_TYPE_OFFSCREEN);
|
||||
if (surface_buffer == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!vdata->driver_ops->map_buffer(vdata->driver, surface_buffer, 0)) {
|
||||
if (!vdata->driver_ops->map_buffer(vdata->driver, surface_buffer)) {
|
||||
_ERR_PRINTF ("NEWGAL>DRM: cannot map hardware buffer: %m\n");
|
||||
goto error;
|
||||
}
|
||||
@@ -3590,40 +3592,36 @@ static int DRM_HWBlit(GAL_Surface *src, GAL_Rect *src_rc,
|
||||
src_buf = (DrmSurfaceBuffer*)src->hwdata;
|
||||
dst_buf = (DrmSurfaceBuffer*)dst->hwdata;
|
||||
|
||||
if ((src->flags & GAL_SRCPIXELALPHA) == GAL_SRCPIXELALPHA) {
|
||||
return vdata->driver_ops->alpha_pixel_blit(vdata->driver,
|
||||
src_buf, src_rc, dst_buf, dst_rc,
|
||||
COLOR_BLEND_PD_SRC_OVER);
|
||||
}
|
||||
else if ((src->flags & GAL_SRCALPHA) == GAL_SRCALPHA &&
|
||||
(src->flags & GAL_SRCCOLORKEY) == GAL_SRCCOLORKEY) {
|
||||
return vdata->driver_ops->alpha_key_blit(vdata->driver,
|
||||
src_buf, src_rc, dst_buf, dst_rc,
|
||||
src->format->alpha, src->format->colorkey);
|
||||
}
|
||||
else if ((src->flags & GAL_SRCALPHA) == GAL_SRCALPHA) {
|
||||
return vdata->driver_ops->alpha_blit(vdata->driver,
|
||||
src_buf, src_rc, dst_buf, dst_rc,
|
||||
src->format->alpha);
|
||||
}
|
||||
else if ((src->flags & GAL_SRCCOLORKEY) == GAL_SRCCOLORKEY) {
|
||||
return vdata->driver_ops->key_blit(vdata->driver,
|
||||
src_buf, src_rc, dst_buf, dst_rc,
|
||||
src->format->colorkey);
|
||||
}
|
||||
else {
|
||||
return vdata->driver_ops->copy_blit(vdata->driver,
|
||||
src_buf, src_rc, dst_buf, dst_rc, COLOR_LOGICOP_COPY);
|
||||
CB_DRM_BLIT blitor = src->map->hw_void;
|
||||
assert(blitor);
|
||||
|
||||
DrmBlitOperations blit_ops = { };
|
||||
blit_ops.cpy = BLIT_COPY_NORMAL;
|
||||
|
||||
if ((src->flags & GAL_SRCCOLORKEY) == GAL_SRCCOLORKEY) {
|
||||
blit_ops.key = BLIT_COLORKEY_NORMAL;
|
||||
blit_ops.key_max = blit_ops.key_min = src->format->colorkey;
|
||||
}
|
||||
|
||||
return 0;
|
||||
if ((src->flags & GAL_SRCALPHA) == GAL_SRCALPHA) {
|
||||
blit_ops.alf = BLIT_ALPHA_BYTE;
|
||||
blit_ops.alpha_byte = src->format->alpha;
|
||||
}
|
||||
|
||||
if ((src->flags & GAL_SRCPIXELALPHA) == GAL_SRCPIXELALPHA) {
|
||||
blit_ops.bld = COLOR_BLEND_PD_SRC_OVER;
|
||||
}
|
||||
|
||||
blit_ops.rop = COLOR_LOGICOP_COPY;
|
||||
|
||||
return blitor(vdata->driver, src_buf, src_rc, dst_buf, dst_rc, &blit_ops);
|
||||
}
|
||||
|
||||
static int DRM_CheckHWBlit_Accl(_THIS, GAL_Surface *src, GAL_Surface *dst)
|
||||
static int DRM_CheckHWBlit_Accl(_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
|
||||
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op)
|
||||
{
|
||||
DrmVideoData* vdata = this->hidden;
|
||||
DrmSurfaceBuffer *src_buf, *dst_buf;
|
||||
int accelerated;
|
||||
|
||||
src_buf = (DrmSurfaceBuffer*)src->hwdata;
|
||||
dst_buf = (DrmSurfaceBuffer*)dst->hwdata;
|
||||
@@ -3631,41 +3629,42 @@ static int DRM_CheckHWBlit_Accl(_THIS, GAL_Surface *src, GAL_Surface *dst)
|
||||
/* Set initial acceleration on */
|
||||
src->flags |= GAL_HWACCEL;
|
||||
|
||||
/* Set the surface attributes */
|
||||
if ((src->flags & GAL_SRCPIXELALPHA) == GAL_SRCPIXELALPHA &&
|
||||
(vdata->driver_ops->alpha_pixel_blit == NULL)) {
|
||||
src->flags &= ~GAL_HWACCEL;
|
||||
}
|
||||
else if ((src->flags & GAL_SRCALPHA) == GAL_SRCALPHA &&
|
||||
(src->flags & GAL_SRCCOLORKEY) == GAL_SRCCOLORKEY &&
|
||||
(vdata->driver_ops->alpha_key_blit == NULL)) {
|
||||
src->flags &= ~GAL_HWACCEL;
|
||||
}
|
||||
else if ((src->flags & GAL_SRCALPHA) == GAL_SRCALPHA &&
|
||||
(vdata->driver_ops->alpha_blit == NULL)) {
|
||||
src->flags &= ~GAL_HWACCEL;
|
||||
}
|
||||
else if ((src->flags & GAL_SRCCOLORKEY) == GAL_SRCCOLORKEY &&
|
||||
(vdata->driver_ops->key_blit == NULL)) {
|
||||
src->flags &= ~GAL_HWACCEL;
|
||||
}
|
||||
else if (vdata->driver_ops->copy_blit == NULL) {
|
||||
src->flags &= ~GAL_HWACCEL;
|
||||
DrmBlitOperations blit_ops = { };
|
||||
blit_ops.cpy = BLIT_COPY_NORMAL;
|
||||
|
||||
if ((src->flags & GAL_SRCCOLORKEY) == GAL_SRCCOLORKEY) {
|
||||
blit_ops.key = BLIT_COLORKEY_NORMAL;
|
||||
}
|
||||
|
||||
if ((src->flags & GAL_SRCPIXELALPHA) == GAL_SRCPIXELALPHA) {
|
||||
blit_ops.bld = op & COLOR_BLEND_MASK;
|
||||
}
|
||||
|
||||
if ((src->flags & GAL_SRCALPHA) == GAL_SRCALPHA) {
|
||||
blit_ops.alf = BLIT_ALPHA_BYTE;
|
||||
}
|
||||
|
||||
if (srcrc->w != dstrc->w || srcrc->h != dstrc->h) {
|
||||
blit_ops.scl = op & SCALING_FILTER_MASK;
|
||||
}
|
||||
|
||||
blit_ops.rop = op & COLOR_LOGICOP_MASK;
|
||||
|
||||
/* Check to see if final surface blit is accelerated */
|
||||
accelerated = !!(src->flags & GAL_HWACCEL);
|
||||
if (accelerated &&
|
||||
vdata->driver_ops->check_blit(vdata->driver, src_buf, dst_buf) == 0) {
|
||||
CB_DRM_BLIT blitor;
|
||||
blitor = vdata->driver_ops->check_blit(vdata->driver, src_buf, srcrc,
|
||||
dst_buf, dstrc, &blit_ops);
|
||||
|
||||
if (blitor) {
|
||||
src->map->hw_blit = DRM_HWBlit;
|
||||
src->map->hw_void = blitor;
|
||||
}
|
||||
else {
|
||||
src->map->hw_blit = NULL;
|
||||
src->flags &= ~GAL_HWACCEL;
|
||||
accelerated = 0;
|
||||
}
|
||||
|
||||
return accelerated;
|
||||
return !!(src->flags & GAL_HWACCEL);
|
||||
}
|
||||
|
||||
static int DRM_FillHWRect_Accl(_THIS, GAL_Surface *dst, GAL_Rect *rect,
|
||||
@@ -3675,7 +3674,7 @@ static int DRM_FillHWRect_Accl(_THIS, GAL_Surface *dst, GAL_Rect *rect,
|
||||
DrmSurfaceBuffer *dst_buf;
|
||||
|
||||
dst_buf = (DrmSurfaceBuffer*)dst->hwdata;
|
||||
return vdata->driver_ops->clear_buffer(vdata->driver, dst_buf, rect, color);
|
||||
return vdata->driver_ops->fill_rect(vdata->driver, dst_buf, rect, color);
|
||||
}
|
||||
|
||||
static void DRM_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
|
||||
@@ -4004,7 +4003,8 @@ GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
|
||||
}
|
||||
else {
|
||||
surface_buffer = vdata->driver_ops->create_buffer_from_name(
|
||||
vdata->driver, name);
|
||||
vdata->driver, name, drm_format, pixels_off, width, height,
|
||||
pitch);
|
||||
if (surface_buffer == NULL) {
|
||||
_ERR_PRINTF ("NEWGAL>DRM: faile to create buffer from name: %u!\n",
|
||||
name);
|
||||
@@ -4059,7 +4059,8 @@ GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, uint32_t handle,
|
||||
}
|
||||
else {
|
||||
surface_buffer = vdata->driver_ops->create_buffer_from_handle (
|
||||
vdata->driver, handle, size);
|
||||
vdata->driver, handle, size, drm_format, pixels_off,
|
||||
width, height, pitch);
|
||||
if (surface_buffer == NULL) {
|
||||
_ERR_PRINTF ("NEWGAL>DRM: failed to create buffer from handle (%u): "
|
||||
"%m!\n", handle);
|
||||
@@ -4114,7 +4115,8 @@ GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video,
|
||||
}
|
||||
else {
|
||||
surface_buffer = vdata->driver_ops->create_buffer_from_prime_fd (
|
||||
vdata->driver, prime_fd, size);
|
||||
vdata->driver, prime_fd, size, drm_format, pixels_off,
|
||||
width, height, pitch);
|
||||
if (surface_buffer == NULL) {
|
||||
_ERR_PRINTF ("NEWGAL>DRM: failed to create buffer from prime "
|
||||
"fd: %d!\n", prime_fd);
|
||||
|
||||
@@ -175,8 +175,11 @@ static int HWAccelBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
||||
return(0);
|
||||
}
|
||||
|
||||
static int CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst)
|
||||
static int CheckHWBlit(_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
|
||||
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op)
|
||||
{
|
||||
(void)srcrc;
|
||||
(void)dstrc;
|
||||
int accelerated;
|
||||
|
||||
/* Set initial acceleration on */
|
||||
@@ -194,6 +197,13 @@ static int CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst)
|
||||
}
|
||||
}
|
||||
|
||||
/* color blend, logical operation, and scaling filter are not supported */
|
||||
if ((op & COLOR_BLEND_MASK) ||
|
||||
((op & COLOR_LOGICOP_MASK) != COLOR_LOGICOP_COPY) ||
|
||||
(op & SCALING_FILTER_MASK)) {
|
||||
src->flags &= ~GAL_HWACCEL;
|
||||
}
|
||||
|
||||
/* Check to see if final surface blit is accelerated */
|
||||
accelerated = !!(src->flags & GAL_HWACCEL);
|
||||
if ( accelerated ) {
|
||||
|
||||
@@ -224,8 +224,11 @@ static int HWAccelBlit(GAL_Surface *src, GAL_Rect *srcrect,
|
||||
return(0);
|
||||
}
|
||||
|
||||
static int CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst)
|
||||
static int CheckHWBlit(_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
|
||||
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op)
|
||||
{
|
||||
(void)srcrc;
|
||||
(void)dstrc;
|
||||
int accelerated;
|
||||
|
||||
/* Set initial acceleration on */
|
||||
@@ -243,6 +246,13 @@ static int CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst)
|
||||
}
|
||||
}
|
||||
|
||||
/* color blend, logical operation, and scaling filter are not supported */
|
||||
if ((op & COLOR_BLEND_MASK) ||
|
||||
((op & COLOR_LOGICOP_MASK) != COLOR_LOGICOP_COPY) ||
|
||||
(op & SCALING_FILTER_MASK)) {
|
||||
src->flags &= ~GAL_HWACCEL;
|
||||
}
|
||||
|
||||
/* Check to see if final surface blit is accelerated */
|
||||
accelerated = !!(src->flags & GAL_HWACCEL);
|
||||
if ( accelerated ) {
|
||||
|
||||
@@ -241,8 +241,11 @@ static int HWAccelBlit (GAL_Surface *src, GAL_Rect *srcrect,
|
||||
return(0);
|
||||
}
|
||||
|
||||
static int CheckHWBlit (_THIS, GAL_Surface *src, GAL_Surface *dst)
|
||||
static int CheckHWBlit(_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
|
||||
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op)
|
||||
{
|
||||
(void)srcrc;
|
||||
(void)dstrc;
|
||||
int accelerated;
|
||||
|
||||
/* Set initial acceleration on */
|
||||
@@ -260,6 +263,13 @@ static int CheckHWBlit (_THIS, GAL_Surface *src, GAL_Surface *dst)
|
||||
}
|
||||
}
|
||||
|
||||
/* color blend, logical operation, and scaling filter are not supported */
|
||||
if ((op & COLOR_BLEND_MASK) ||
|
||||
((op & COLOR_LOGICOP_MASK) != COLOR_LOGICOP_COPY) ||
|
||||
(op & SCALING_FILTER_MASK)) {
|
||||
src->flags &= ~GAL_HWACCEL;
|
||||
}
|
||||
|
||||
if (src->format->BitsPerPixel > 16)
|
||||
src->flags &= ~GAL_HWACCEL;
|
||||
|
||||
|
||||
@@ -831,8 +831,11 @@ static int SMI_SetHWColorKey (_THIS, GAL_Surface *surface, Uint32 key)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int SMI_CheckHWBlit (_THIS, GAL_Surface *src, GAL_Surface *dst)
|
||||
static int SMI_CheckHWBlit (_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
|
||||
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op)
|
||||
{
|
||||
(void)srcrc;
|
||||
(void)dstrc;
|
||||
int accelerated;
|
||||
|
||||
/* Set initial acceleration on */
|
||||
@@ -851,6 +854,13 @@ static int SMI_CheckHWBlit (_THIS, GAL_Surface *src, GAL_Surface *dst)
|
||||
src->flags &= ~GAL_HWACCEL;
|
||||
}
|
||||
|
||||
/* color blend, logical operation, and scaling filter are not supported */
|
||||
if ((op & COLOR_BLEND_MASK) ||
|
||||
((op & COLOR_LOGICOP_MASK) != COLOR_LOGICOP_COPY) ||
|
||||
(op & SCALING_FILTER_MASK)) {
|
||||
src->flags &= ~GAL_HWACCEL;
|
||||
}
|
||||
|
||||
/* Check to see if final surface blit is accelerated */
|
||||
accelerated = !!(src->flags & GAL_HWACCEL);
|
||||
if (accelerated) {
|
||||
|
||||
@@ -617,7 +617,8 @@ void GAL_InvalidateMap(GAL_BlitMap *map)
|
||||
}
|
||||
}
|
||||
|
||||
int GAL_MapSurface (GAL_Surface *src, GAL_Surface *dst)
|
||||
int GAL_MapSurface (GAL_Surface *src, const GAL_Rect *srcrc,
|
||||
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op)
|
||||
{
|
||||
GAL_PixelFormat *srcfmt;
|
||||
GAL_PixelFormat *dstfmt;
|
||||
@@ -698,7 +699,7 @@ int GAL_MapSurface (GAL_Surface *src, GAL_Surface *dst)
|
||||
map->format_version = (++dst->format_version);
|
||||
|
||||
/* Choose your blitters wisely */
|
||||
return(GAL_CalculateBlit(src));
|
||||
return(GAL_CalculateBlit(src, srcrc, dstrc, op));
|
||||
}
|
||||
|
||||
void GAL_FreeBlitMap(GAL_BlitMap *map)
|
||||
|
||||
@@ -59,11 +59,14 @@ extern void GAL_FreeFormat(GAL_PixelFormat *format);
|
||||
/* Blit mapping functions */
|
||||
extern GAL_BlitMap *GAL_AllocBlitMap(void);
|
||||
extern void GAL_InvalidateMap(GAL_BlitMap *map);
|
||||
extern int GAL_MapSurface (GAL_Surface *src, GAL_Surface *dst);
|
||||
extern int GAL_MapSurface (GAL_Surface *src, const GAL_Rect *srcrc,
|
||||
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op);
|
||||
extern void GAL_FreeBlitMap(GAL_BlitMap *map);
|
||||
|
||||
/* Miscellaneous functions */
|
||||
extern Uint32 GAL_CalculatePitch(GAL_Surface *surface);
|
||||
extern void GAL_DitherColors(GAL_Color *colors, int bpp);
|
||||
extern Uint8 GAL_FindColor(GAL_Palette *pal, Uint8 r, Uint8 g, Uint8 b);
|
||||
extern void GAL_ApplyGamma(Uint16 *gamma, GAL_Color *colors, GAL_Color *output, int ncolors);
|
||||
extern void GAL_ApplyGamma(Uint16 *gamma, GAL_Color *colors, GAL_Color *output,
|
||||
int ncolors);
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ int GAL_SetupStretchBlit (GAL_Surface *src, GAL_Rect *srcrect,
|
||||
src->pix_filter = PIXMAN_FILTER_FAST;
|
||||
}
|
||||
|
||||
ops &= COLOR_BLEND_FLAGS_MASK;
|
||||
ops &= COLOR_BLEND_PIXMAN_MASK;
|
||||
if (ops == COLOR_BLEND_LEGACY) {
|
||||
if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) {
|
||||
src->pix_op = PIXMAN_OP_OVER;
|
||||
@@ -376,7 +376,7 @@ int GAL_StretchBlt (GAL_Surface *src, GAL_Rect *srcrect,
|
||||
|
||||
if (src_img == NULL || dst_img == NULL || (src->flags & GAL_SRCCOLORKEY))
|
||||
return GAL_StretchBltLegacy (src, srcrect, dst, dstrect,
|
||||
ops & COLOR_BLEND_FLAGS_MASK);
|
||||
ops & COLOR_BLEND_PIXMAN_MASK);
|
||||
|
||||
msk_img = src->msk_img;
|
||||
op = (pixman_op_t)src->pix_op;
|
||||
|
||||
@@ -513,7 +513,7 @@ int GAL_LowerBlit (GAL_Surface *src, GAL_Rect *srcrect,
|
||||
/* Check to make sure the blit mapping is valid */
|
||||
if ((src->map->dst != dst) ||
|
||||
(src->map->dst->format_version != src->map->format_version)) {
|
||||
if (GAL_MapSurface(src, dst) < 0) {
|
||||
if (GAL_MapSurface(src, srcrect, dst, dstrect, op) < 0) {
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +201,8 @@ struct GAL_VideoDevice {
|
||||
/* Set the hardware accelerated blit function, if any, based
|
||||
on the current flags of the surface (colorkey, alpha, etc.)
|
||||
*/
|
||||
int (*CheckHWBlit)(_THIS, GAL_Surface *src, GAL_Surface *dst);
|
||||
int (*CheckHWBlit)(_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
|
||||
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op);
|
||||
|
||||
/* Fills a surface rectangle with the given color */
|
||||
int (*FillHWRect)(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color);
|
||||
|
||||
Reference in New Issue
Block a user