* evas: remove gradient and gradient2.
SVN revision: 51219
This commit is contained in:
parent
c45c36bd80
commit
05e8154f8b
|
@ -342,7 +342,7 @@ struct _Evas_Native_Surface
|
|||
#define EVAS_COLOR_SPACE_ARGB 0 /**< ARGB color space */
|
||||
#define EVAS_COLOR_SPACE_AHSV 1 /**< AHSV color space */
|
||||
|
||||
#define EVAS_TEXTURE_REFLECT 0 /**< Gradient and image fill tiling mode - tiling reflects */
|
||||
#define EVAS_TEXTURE_REFLECT 0 /**< image fill tiling mode - tiling reflects */
|
||||
#define EVAS_TEXTURE_REPEAT 1 /**< tiling repeats */
|
||||
#define EVAS_TEXTURE_RESTRICT 2 /**< tiling clamps - range offset ignored */
|
||||
#define EVAS_TEXTURE_RESTRICT_REFLECT 3 /**< tiling clamps and any range offset reflects */
|
||||
|
@ -1440,58 +1440,6 @@ typedef void (*Evas_Object_Event_Cb) (void *data, Evas *e, Evas_Object *obj
|
|||
EAPI void evas_object_polygon_point_add (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
|
||||
EAPI void evas_object_polygon_points_clear (Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @defgroup Evas_Object_Gradient_Group Gradient Object Functions
|
||||
*
|
||||
* Functions that work on evas gradient objects.
|
||||
*
|
||||
* @ingroup Evas_Object_Specific
|
||||
*/
|
||||
EINA_DEPRECATED EAPI Evas_Object *evas_object_gradient_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_color_stop_add (Evas_Object *obj, int r, int g, int b, int a, int delta) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_alpha_stop_add (Evas_Object *obj, int a, int delta) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_color_data_set (Evas_Object *obj, void *color_data, int len, Eina_Bool has_alpha) EINA_ARG_NONNULL(1, 2);
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_alpha_data_set (Evas_Object *obj, void *alpha_data, int len) EINA_ARG_NONNULL(1, 2);
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_clear (Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_type_set (Evas_Object *obj, const char *type, const char *instance_params) EINA_ARG_NONNULL(1, 2);
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_type_get (const Evas_Object *obj, char **type, char **instance_params) EINA_ARG_NONNULL(1, 2);
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_fill_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_fill_get (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_fill_angle_set (Evas_Object *obj, Evas_Angle angle) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Angle evas_object_gradient_fill_angle_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_fill_spread_set(Evas_Object *obj, int tile_mode) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI int evas_object_gradient_fill_spread_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_angle_set (Evas_Object *obj, Evas_Angle angle) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Angle evas_object_gradient_angle_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_direction_set (Evas_Object *obj, int direction) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI int evas_object_gradient_direction_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient_offset_set (Evas_Object *obj, float offset) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI float evas_object_gradient_offset_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
|
||||
|
||||
/**
|
||||
* @defgroup Evas_Object_Gradient2_Group Gradient2 Object Functions
|
||||
*
|
||||
* Functions that work on evas gradient2 objects.
|
||||
*
|
||||
* @ingroup Evas_Object_Specific
|
||||
*/
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient2_color_np_stop_insert (Evas_Object *obj, int r, int g, int b, int a, float pos) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient2_fill_spread_set (Evas_Object *obj, int tile_mode) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI int evas_object_gradient2_fill_spread_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient2_fill_transform_set (Evas_Object *obj, Evas_Transform *t) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient2_fill_transform_get (const Evas_Object *obj, Evas_Transform *t) EINA_ARG_NONNULL(1);
|
||||
|
||||
/* linear gradient2 objects */
|
||||
EINA_DEPRECATED EAPI Evas_Object *evas_object_gradient2_linear_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient2_linear_fill_set (Evas_Object *obj, float x0, float y0, float x1, float y1) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient2_linear_fill_get (const Evas_Object *obj, float *x0, float *y0, float *x1, float *y1) EINA_ARG_NONNULL(1);
|
||||
|
||||
/* radial gradient2 objects */
|
||||
EINA_DEPRECATED EAPI Evas_Object *evas_object_gradient2_radial_add (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient2_radial_fill_set (Evas_Object *obj, float cx, float cy, float rx, float ry) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void evas_object_gradient2_radial_fill_get (const Evas_Object *obj, float *cx, float *cy, float *rx, float *ry) EINA_ARG_NONNULL(1);
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup Evas_Smart_Group Smart Functions
|
||||
*
|
||||
|
|
|
@ -27,8 +27,6 @@ evas_key_grab.c \
|
|||
evas_layer.c \
|
||||
evas_main.c \
|
||||
evas_name.c \
|
||||
evas_object_gradient.c \
|
||||
evas_object_gradient2.c \
|
||||
evas_object_image.c \
|
||||
evas_object_main.c \
|
||||
evas_object_inform.c \
|
||||
|
@ -54,6 +52,3 @@ evas_map.c
|
|||
|
||||
libevas_canvas_la_LIBADD = @EVIL_LIBS@
|
||||
|
||||
EXTRA_DIST = \
|
||||
evas_object_gradient2_linear.c \
|
||||
evas_object_gradient2_radial.c
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,233 +0,0 @@
|
|||
#include "evas_common.h"
|
||||
#include "evas_private.h"
|
||||
|
||||
typedef struct _Evas_Object_Gradient2 Evas_Object_Gradient2;
|
||||
|
||||
struct _Evas_Object_Gradient2
|
||||
{
|
||||
DATA32 magic;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
Evas_Common_Transform transform;
|
||||
int spread;
|
||||
} fill;
|
||||
unsigned char gradient_opaque : 1;
|
||||
} cur, prev;
|
||||
|
||||
unsigned char gradient_changed : 1;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @addtogroup Evas_Object_Gradient2_Group
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Inserts a color stop to the given evas gradient object.
|
||||
*
|
||||
* The @p pos parameter determines where along the unit interval
|
||||
* [0,1] the color is to be inserted. The r,g,b,a data are assumed
|
||||
* input as being NON-PREMULTIPLIED.
|
||||
*
|
||||
* @param obj The given evas gradient object.
|
||||
* @param r Red component of the given color.
|
||||
* @param g Green component of the given color.
|
||||
* @param b Blue component of the given color.
|
||||
* @param a Alpha component of the given color.
|
||||
* @param pos The pos in [0,1] of this stop.
|
||||
*/
|
||||
EAPI void
|
||||
evas_object_gradient2_color_np_stop_insert(Evas_Object *obj, int r, int g, int b, int a, float pos)
|
||||
{
|
||||
Evas_Object_Gradient2 *og;
|
||||
void *engine_data;
|
||||
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
og = (Evas_Object_Gradient2 *)(obj->object_data);
|
||||
MAGIC_CHECK(og, Evas_Object_Gradient2, MAGIC_OBJ_GRADIENT);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
engine_data = obj->func->engine_data_get(obj);
|
||||
if (engine_data)
|
||||
{
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
evas_common_pipe_op_grad2_flush(engine_data);
|
||||
#endif
|
||||
|
||||
obj->layer->evas->engine.func->gradient2_color_np_stop_insert(obj->layer->evas->engine.data.output,
|
||||
engine_data,
|
||||
r, g, b, a, pos);
|
||||
}
|
||||
og->gradient_changed = 1;
|
||||
evas_object_change(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all stops set for the given evas gradient object or any set data.
|
||||
* @param obj The given evas gradient object.
|
||||
*/
|
||||
EAPI void
|
||||
evas_object_gradient2_clear(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2 *og;
|
||||
void *engine_data;
|
||||
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
og = (Evas_Object_Gradient2 *)(obj->object_data);
|
||||
MAGIC_CHECK(og, Evas_Object_Gradient2, MAGIC_OBJ_GRADIENT);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
engine_data = obj->func->engine_data_get(obj);
|
||||
if (engine_data)
|
||||
{
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
evas_common_pipe_op_grad2_flush(engine_data);
|
||||
#endif
|
||||
obj->layer->evas->engine.func->gradient2_clear(obj->layer->evas->engine.data.output,
|
||||
engine_data);
|
||||
}
|
||||
og->gradient_changed = 1;
|
||||
og->cur.gradient_opaque = 0;
|
||||
evas_object_change(obj);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the tiling mode for the given evas gradient object's fill.
|
||||
* @param obj The given evas gradient object.
|
||||
* @param spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,
|
||||
* EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.
|
||||
*/
|
||||
EAPI void
|
||||
evas_object_gradient2_fill_spread_set(Evas_Object *obj, int spread)
|
||||
{
|
||||
Evas_Object_Gradient2 *og;
|
||||
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
og = (Evas_Object_Gradient2 *)(obj->object_data);
|
||||
MAGIC_CHECK(og, Evas_Object_Gradient2, MAGIC_OBJ_GRADIENT);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
if (spread == og->cur.fill.spread) return;
|
||||
og->cur.fill.spread = spread;
|
||||
og->gradient_changed = 1;
|
||||
evas_object_change(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the spread (tiling mode) for the given gradient object's fill.
|
||||
* @param obj The given evas gradient object.
|
||||
* @return The current spread mode of the gradient object.
|
||||
*/
|
||||
EAPI int
|
||||
evas_object_gradient2_fill_spread_get(const Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2 *og;
|
||||
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return EVAS_TEXTURE_REPEAT;
|
||||
MAGIC_CHECK_END();
|
||||
og = (Evas_Object_Gradient2 *)(obj->object_data);
|
||||
MAGIC_CHECK(og, Evas_Object_Gradient2, MAGIC_OBJ_GRADIENT);
|
||||
return EVAS_TEXTURE_REPEAT;
|
||||
MAGIC_CHECK_END();
|
||||
return og->cur.fill.spread;
|
||||
}
|
||||
|
||||
/* FIXME: To be documented*/
|
||||
EAPI void
|
||||
evas_object_gradient2_fill_transform_set (Evas_Object *obj, Evas_Transform *t)
|
||||
{
|
||||
Evas_Object_Gradient2 *og;
|
||||
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
og = (Evas_Object_Gradient2 *)(obj->object_data);
|
||||
MAGIC_CHECK(og, Evas_Object_Gradient2, MAGIC_OBJ_GRADIENT);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
if (!t)
|
||||
{
|
||||
og->cur.fill.transform.mxx = 1;
|
||||
og->cur.fill.transform.mxy = 0;
|
||||
og->cur.fill.transform.mxz = 0;
|
||||
og->cur.fill.transform.myx = 0;
|
||||
og->cur.fill.transform.myy = 1;
|
||||
og->cur.fill.transform.myz = 0;
|
||||
og->cur.fill.transform.mzx = 0;
|
||||
og->cur.fill.transform.mzy = 0;
|
||||
og->cur.fill.transform.mzz = 1;
|
||||
|
||||
og->gradient_changed = 1;
|
||||
evas_object_change(obj);
|
||||
return;
|
||||
}
|
||||
if ( (og->cur.fill.transform.mxx == t->mxx) ||
|
||||
(og->cur.fill.transform.mxy == t->mxy) ||
|
||||
(og->cur.fill.transform.mxy == t->mxy) ||
|
||||
(og->cur.fill.transform.mxy == t->mxy) ||
|
||||
(og->cur.fill.transform.mxy == t->mxy) ||
|
||||
(og->cur.fill.transform.mxy == t->mxy) ||
|
||||
(og->cur.fill.transform.mxy == t->mxy) ||
|
||||
(og->cur.fill.transform.mxy == t->mxy) ||
|
||||
(og->cur.fill.transform.mxy == t->mxy) )
|
||||
return;
|
||||
|
||||
og->cur.fill.transform.mxx = t->mxx;
|
||||
og->cur.fill.transform.mxy = t->mxy;
|
||||
og->cur.fill.transform.mxz = t->mxz;
|
||||
og->cur.fill.transform.myx = t->myx;
|
||||
og->cur.fill.transform.myy = t->myy;
|
||||
og->cur.fill.transform.myz = t->myz;
|
||||
og->cur.fill.transform.mzx = t->mzx;
|
||||
og->cur.fill.transform.mzy = t->mzy;
|
||||
og->cur.fill.transform.mzz = t->mzz;
|
||||
|
||||
og->gradient_changed = 1;
|
||||
evas_object_change(obj);
|
||||
}
|
||||
|
||||
/* FIXME: To be documented*/
|
||||
EAPI void
|
||||
evas_object_gradient2_fill_transform_get (const Evas_Object *obj, Evas_Transform *t)
|
||||
{
|
||||
Evas_Object_Gradient2 *og;
|
||||
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
og = (Evas_Object_Gradient2 *)(obj->object_data);
|
||||
MAGIC_CHECK(og, Evas_Object_Gradient2, MAGIC_OBJ_GRADIENT);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
if (t)
|
||||
{
|
||||
t->mxx = og->cur.fill.transform.mxx;
|
||||
t->mxy = og->cur.fill.transform.mxy;
|
||||
t->mxz = og->cur.fill.transform.mxz;
|
||||
t->myx = og->cur.fill.transform.myx;
|
||||
t->myy = og->cur.fill.transform.myy;
|
||||
t->myz = og->cur.fill.transform.myz;
|
||||
t->mzx = og->cur.fill.transform.mzx;
|
||||
t->mzy = og->cur.fill.transform.mzy;
|
||||
t->mzz = og->cur.fill.transform.mzz;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "evas_object_gradient2_linear.c"
|
||||
#include "evas_object_gradient2_radial.c"
|
|
@ -1,474 +0,0 @@
|
|||
#include "evas_common.h"
|
||||
#include "evas_private.h"
|
||||
|
||||
/* private magic number for linear gradient objects */
|
||||
static const char lg_type[] = "linear_gradient";
|
||||
|
||||
/* private struct for gradient object internal data */
|
||||
typedef struct _Evas_Object_Gradient2_Linear Evas_Object_Gradient2_Linear;
|
||||
|
||||
struct _Evas_Object_Gradient2_Linear
|
||||
{
|
||||
Evas_Object_Gradient2 base;
|
||||
|
||||
DATA32 magic;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
float x0, y0, x1, y1;
|
||||
} fill;
|
||||
} cur, prev;
|
||||
|
||||
void *engine_data;
|
||||
|
||||
unsigned char gradient_changed : 1;
|
||||
unsigned char changed : 1;
|
||||
};
|
||||
|
||||
/* private methods for linear gradient objects */
|
||||
static void evas_object_gradient2_linear_init(Evas_Object *obj);
|
||||
static void *evas_object_gradient2_linear_new(void);
|
||||
|
||||
static void evas_object_gradient2_linear_free(Evas_Object *obj);
|
||||
static void evas_object_gradient2_linear_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
|
||||
static void evas_object_gradient2_linear_render_pre(Evas_Object *obj);
|
||||
static void evas_object_gradient2_linear_render_post(Evas_Object *obj);
|
||||
|
||||
static unsigned int evas_object_gradient2_linear_id_get(Evas_Object *obj);
|
||||
static unsigned int evas_object_gradient2_linear_visual_id_get(Evas_Object *obj);
|
||||
static void *evas_object_gradient2_linear_engine_data_get(Evas_Object *obj);
|
||||
|
||||
static int evas_object_gradient2_linear_is_opaque(Evas_Object *obj);
|
||||
static int evas_object_gradient2_linear_was_opaque(Evas_Object *obj);
|
||||
|
||||
static const Evas_Object_Func object_func =
|
||||
{
|
||||
/* methods (compulsory) */
|
||||
evas_object_gradient2_linear_free,
|
||||
evas_object_gradient2_linear_render,
|
||||
evas_object_gradient2_linear_render_pre,
|
||||
evas_object_gradient2_linear_render_post,
|
||||
evas_object_gradient2_linear_id_get,
|
||||
evas_object_gradient2_linear_visual_id_get,
|
||||
evas_object_gradient2_linear_engine_data_get,
|
||||
/* these are optional. NULL = nothing */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
evas_object_gradient2_linear_is_opaque,
|
||||
evas_object_gradient2_linear_was_opaque,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
/* the actual api call to add a gradient */
|
||||
|
||||
/**
|
||||
* @addtogroup Evas_Object_Gradient2_Group
|
||||
* @{
|
||||
* @ingroup Evas_Object_Specific
|
||||
*/
|
||||
|
||||
/**
|
||||
* Adds a gradient object to the given evas.
|
||||
* @param e The given evas.
|
||||
* @return A new evas gradient object if successful. Otherwise, @c NULL.
|
||||
*/
|
||||
EAPI Evas_Object *
|
||||
evas_object_gradient2_linear_add(Evas *e)
|
||||
{
|
||||
Evas_Object *obj;
|
||||
|
||||
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||
return NULL;
|
||||
MAGIC_CHECK_END();
|
||||
obj = evas_object_new(e);
|
||||
evas_object_gradient2_linear_init(obj);
|
||||
evas_object_inject(obj, e);
|
||||
if (obj->object_data)
|
||||
{
|
||||
Evas_Object_Gradient2_Linear *o = (Evas_Object_Gradient2_Linear *)(obj->object_data);
|
||||
|
||||
o->engine_data = e->engine.func->gradient2_linear_new(e->engine.data.output);
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the start and end points of the linear gradient geometry for the object.
|
||||
*
|
||||
* Note that the gradient may extend beyond these,
|
||||
* according to its spread value - restrict, repeat, or reflect. To have
|
||||
* only one 'cycle' of the gradient drawn, the spread value must be set
|
||||
* to restrict.
|
||||
* The default values for the fill parameters is @p x0 = 0, @p y0 = 0,
|
||||
* @p x1 = 0 and @p y1 = 0.
|
||||
*
|
||||
* @param obj The given evas linear gradient object.
|
||||
* @param x0 The X coordinate of the start point.
|
||||
* @param y0 The Y coordinate of the start point.
|
||||
* @param x1 The X coordinate of the end point.
|
||||
* @param y1 The Y coordinate of the end point
|
||||
*/
|
||||
EAPI void
|
||||
evas_object_gradient2_linear_fill_set(Evas_Object *obj, float x0, float y0, float x1, float y1)
|
||||
{
|
||||
Evas_Object_Gradient2_Linear *o;
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
o = (Evas_Object_Gradient2_Linear *)(obj->object_data);
|
||||
MAGIC_CHECK(o, Evas_Object_Gradient2_Linear, MAGIC_OBJ_GRADIENT_LINEAR);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
if ((o->cur.fill.x0 == x0) &&
|
||||
(o->cur.fill.y0 == y0) &&
|
||||
(o->cur.fill.x1 == x1) &&
|
||||
(o->cur.fill.y1 == y1)) return;
|
||||
o->cur.fill.x0 = x0;
|
||||
o->cur.fill.y0 = y0;
|
||||
o->cur.fill.x1 = x1;
|
||||
o->cur.fill.y1 = y1;
|
||||
o->gradient_changed = 1;
|
||||
o->changed = 1;
|
||||
evas_object_change(obj);
|
||||
}
|
||||
|
||||
/*FIXME: To be documented*/
|
||||
EAPI void
|
||||
evas_object_gradient2_linear_fill_get(const Evas_Object *obj, float *x0, float *y0, float *x1, float *y1)
|
||||
{
|
||||
Evas_Object_Gradient2_Linear *o;
|
||||
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
if (x0) *x0 = 0;
|
||||
if (y0) *y0 = 0;
|
||||
if (x1) *x1 = 0;
|
||||
if (y1) *y1 = 0;
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
o = (Evas_Object_Gradient2_Linear *)(obj->object_data);
|
||||
MAGIC_CHECK(o, Evas_Object_Gradient2_Linear, MAGIC_OBJ_GRADIENT_LINEAR);
|
||||
if (x0) *x0 = 0;
|
||||
if (y0) *y0 = 0;
|
||||
if (x1) *x1 = 0;
|
||||
if (y1) *y1 = 0;
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
if (x0) *x0 = o->cur.fill.x0;
|
||||
if (y0) *y0 = o->cur.fill.y0;
|
||||
if (x1) *x1 = o->cur.fill.x1;
|
||||
if (y1) *y1 = o->cur.fill.y1;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* all nice and private */
|
||||
static void
|
||||
evas_object_gradient2_linear_init(Evas_Object *obj)
|
||||
{
|
||||
/* alloc grad ob, setup methods and default values */
|
||||
obj->object_data = evas_object_gradient2_linear_new();
|
||||
/* set up default settings for this kind of object */
|
||||
obj->cur.color.r = 255;
|
||||
obj->cur.color.g = 255;
|
||||
obj->cur.color.b = 255;
|
||||
obj->cur.color.a = 255;
|
||||
obj->cur.geometry.x = 0;
|
||||
obj->cur.geometry.y = 0;
|
||||
obj->cur.geometry.w = 0;
|
||||
obj->cur.geometry.h = 0;
|
||||
obj->cur.layer = 0;
|
||||
obj->cur.anti_alias = 1;
|
||||
obj->cur.interpolation_color_space = EVAS_COLOR_SPACE_ARGB;
|
||||
obj->cur.render_op = EVAS_RENDER_BLEND;
|
||||
/* set up object-specific settings */
|
||||
obj->prev = obj->cur;
|
||||
/* set up methods (compulsory) */
|
||||
obj->func = &object_func;
|
||||
obj->type = lg_type;
|
||||
obj->changed = 1;
|
||||
}
|
||||
|
||||
static void *
|
||||
evas_object_gradient2_linear_new(void)
|
||||
{
|
||||
Evas_Object_Gradient2_Linear *o;
|
||||
Evas_Object_Gradient2 *og;
|
||||
|
||||
/* alloc obj private data */
|
||||
o = calloc(1, sizeof(Evas_Object_Gradient2_Linear));
|
||||
if (!o) return NULL;
|
||||
o->magic = MAGIC_OBJ_GRADIENT_LINEAR;
|
||||
o->cur.fill.x0 = 0;
|
||||
o->cur.fill.y0 = 0;
|
||||
o->cur.fill.x1 = 1;
|
||||
o->cur.fill.y1 = 1;
|
||||
og = (Evas_Object_Gradient2 *)o;
|
||||
og->magic = MAGIC_OBJ_GRADIENT;
|
||||
og->cur.fill.transform.mxx = og->cur.fill.transform.myy = og->cur.fill.transform.mzz = 1;
|
||||
og->cur.fill.spread = EVAS_TEXTURE_REPEAT;
|
||||
og->cur.gradient_opaque = 0;
|
||||
og->prev = og->cur;
|
||||
og->gradient_changed = 1;
|
||||
o->prev = o->cur;
|
||||
o->changed = 1;
|
||||
o->gradient_changed = 1;
|
||||
return o;
|
||||
}
|
||||
|
||||
static void
|
||||
evas_object_gradient2_linear_free(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Linear *o;
|
||||
|
||||
/* frees private object data. very simple here */
|
||||
o = (Evas_Object_Gradient2_Linear *)(obj->object_data);
|
||||
MAGIC_CHECK(o, Evas_Object_Gradient2_Linear, MAGIC_OBJ_GRADIENT_LINEAR);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
/* free obj */
|
||||
if (o->engine_data)
|
||||
obj->layer->evas->engine.func->gradient2_linear_free(obj->layer->evas->engine.data.output,
|
||||
o->engine_data);
|
||||
free(o);
|
||||
obj->object_data = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
evas_object_gradient2_linear_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
|
||||
{
|
||||
Evas_Object_Gradient2_Linear *o;
|
||||
|
||||
/* render object to surface with context, and offxet by x,y */
|
||||
o = (Evas_Object_Gradient2_Linear *)(obj->object_data);
|
||||
obj->layer->evas->engine.func->context_multiplier_unset(output, context);
|
||||
obj->layer->evas->engine.func->context_anti_alias_set(output, context, obj->cur.anti_alias);
|
||||
obj->layer->evas->engine.func->context_render_op_set(output, context, obj->cur.render_op);
|
||||
if (o->engine_data)
|
||||
{
|
||||
obj->layer->evas->engine.func->gradient2_linear_draw(output, context, surface,
|
||||
o->engine_data,
|
||||
obj->cur.geometry.x + x,
|
||||
obj->cur.geometry.y + y,
|
||||
obj->cur.geometry.w,
|
||||
obj->cur.geometry.h);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
evas_object_gradient2_linear_render_pre(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Linear *o;
|
||||
Evas_Object_Gradient2 *og;
|
||||
int is_v, was_v;
|
||||
|
||||
/* dont pre-render the obj twice! */
|
||||
if (obj->pre_render_done) return;
|
||||
obj->pre_render_done = 1;
|
||||
/* pre-render phase. this does anything an object needs to do just before */
|
||||
/* rendering. this could mean loading the image data, retrieving it from */
|
||||
/* elsewhere, decoding video etc. */
|
||||
/* then when this is done the object needs to figure if it changed and */
|
||||
/* if so what and where and add the appropriate redraw rectangles */
|
||||
o = (Evas_Object_Gradient2_Linear *)(obj->object_data);
|
||||
og = (Evas_Object_Gradient2 *)(o);
|
||||
/* if someone is clipping this obj - go calculate the clipper */
|
||||
if (obj->cur.clipper)
|
||||
{
|
||||
if (obj->cur.cache.clip.dirty)
|
||||
evas_object_clip_recalc(obj->cur.clipper);
|
||||
obj->cur.clipper->func->render_pre(obj->cur.clipper);
|
||||
}
|
||||
/* if it changed color */
|
||||
if ((obj->cur.color.r != obj->prev.color.r) ||
|
||||
(obj->cur.color.g != obj->prev.color.g) ||
|
||||
(obj->cur.color.b != obj->prev.color.b) ||
|
||||
(obj->cur.color.a != obj->prev.color.a))
|
||||
{ o->gradient_changed = 1; o->changed = 1; }
|
||||
if ((!o->gradient_changed) && ((obj->cur.cache.clip.r != obj->prev.cache.clip.r) ||
|
||||
(obj->cur.cache.clip.g != obj->prev.cache.clip.g) ||
|
||||
(obj->cur.cache.clip.b != obj->prev.cache.clip.b) ||
|
||||
(obj->cur.cache.clip.a != obj->prev.cache.clip.a)))
|
||||
{ o->gradient_changed = 1; o->changed = 1; }
|
||||
if (!o->gradient_changed && (obj->cur.interpolation_color_space != obj->prev.interpolation_color_space))
|
||||
{ o->gradient_changed = 1; o->changed = 1; }
|
||||
if (!o->changed && (obj->cur.render_op != obj->prev.render_op))
|
||||
o->changed = 1;
|
||||
// if (!o->changed && (obj->cur.anti_alias != obj->prev.anti_alias))
|
||||
// o->changed = 1;
|
||||
if (og->gradient_changed)
|
||||
{ o->gradient_changed = 1; o->changed = 1; }
|
||||
if (o->changed && o->engine_data)
|
||||
{
|
||||
obj->layer->evas->engine.func->context_render_op_set(obj->layer->evas->engine.data.output,
|
||||
obj->layer->evas->engine.data.context, obj->cur.render_op);
|
||||
obj->layer->evas->engine.func->context_multiplier_set(obj->layer->evas->engine.data.output,
|
||||
obj->layer->evas->engine.data.context,
|
||||
obj->cur.cache.clip.r, obj->cur.cache.clip.g,
|
||||
obj->cur.cache.clip.b, obj->cur.cache.clip.a);
|
||||
obj->layer->evas->engine.func->context_color_interpolation_set(obj->layer->evas->engine.data.output,
|
||||
obj->layer->evas->engine.data.context,
|
||||
obj->cur.interpolation_color_space);
|
||||
if (o->gradient_changed)
|
||||
{
|
||||
obj->layer->evas->engine.func->gradient2_linear_fill_set(obj->layer->evas->engine.data.output, o->engine_data, o->cur.fill.x0, o->cur.fill.y0, o->cur.fill.x1, o->cur.fill.y1);
|
||||
obj->layer->evas->engine.func->gradient2_fill_transform_set(obj->layer->evas->engine.data.output, o->engine_data,
|
||||
&og->cur.fill.transform);
|
||||
obj->layer->evas->engine.func->gradient2_fill_spread_set(obj->layer->evas->engine.data.output, o->engine_data,
|
||||
og->cur.fill.spread);
|
||||
obj->layer->evas->engine.func->gradient2_linear_render_pre(obj->layer->evas->engine.data.output,
|
||||
obj->layer->evas->engine.data.context,
|
||||
o->engine_data);
|
||||
}
|
||||
og->cur.gradient_opaque = obj->layer->evas->engine.func->gradient2_linear_is_opaque(obj->layer->evas->engine.data.output,
|
||||
obj->layer->evas->engine.data.context,
|
||||
o->engine_data,
|
||||
obj->cur.cache.clip.x, obj->cur.cache.clip.y,
|
||||
obj->cur.cache.clip.w, obj->cur.cache.clip.h);
|
||||
|
||||
if (obj->cur.cache.clip.a != 255)
|
||||
og->cur.gradient_opaque = 0;
|
||||
}
|
||||
|
||||
/* now figure what changed and add draw rects */
|
||||
/* if it just became visible or invisible */
|
||||
is_v = evas_object_is_visible(obj);
|
||||
was_v = evas_object_was_visible(obj);
|
||||
if (is_v != was_v)
|
||||
{
|
||||
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v);
|
||||
goto done;
|
||||
}
|
||||
if ((obj->cur.map != obj->prev.map) ||
|
||||
(obj->cur.usemap != obj->prev.usemap))
|
||||
{
|
||||
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
|
||||
goto done;
|
||||
}
|
||||
/* its not visible - we accounted for it appearing or not so just abort */
|
||||
if (!is_v) goto done;
|
||||
/* clipper changed this is in addition to anything else for obj */
|
||||
evas_object_render_pre_clipper_change(&obj->layer->evas->clip_changes, obj);
|
||||
/* gradient changed */
|
||||
if (o->changed || obj->restack)
|
||||
{
|
||||
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
|
||||
goto done;
|
||||
}
|
||||
/* if it changed geometry */
|
||||
if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
|
||||
(obj->cur.geometry.y != obj->prev.geometry.y) ||
|
||||
(obj->cur.geometry.w != obj->prev.geometry.w) ||
|
||||
(obj->cur.geometry.h != obj->prev.geometry.h))
|
||||
{
|
||||
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
|
||||
goto done;
|
||||
}
|
||||
/* it obviously didn't change - add a NO obscure - this "unupdates" this */
|
||||
/* area so if there were updates for it they get wiped. don't do it if we */
|
||||
/* arent fully opaque and we are visible */
|
||||
|
||||
if (evas_object_is_visible(obj) &&
|
||||
evas_object_is_opaque(obj))
|
||||
obj->layer->evas->engine.func->output_redraws_rect_del(obj->layer->evas->engine.data.output,
|
||||
obj->cur.cache.clip.x,
|
||||
obj->cur.cache.clip.y,
|
||||
obj->cur.cache.clip.w,
|
||||
obj->cur.cache.clip.h);
|
||||
|
||||
done:
|
||||
evas_object_render_pre_effect_updates(&obj->layer->evas->clip_changes, obj, is_v, was_v);
|
||||
}
|
||||
|
||||
static void
|
||||
evas_object_gradient2_linear_render_post(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Linear *o;
|
||||
Evas_Object_Gradient2 *og;
|
||||
|
||||
/* this moves the current data to the previous state parts of the object */
|
||||
/* in whatever way is safest for the object. also if we don't need object */
|
||||
/* data anymore we can free it if the object deems this is a good idea */
|
||||
o = (Evas_Object_Gradient2_Linear *)(obj->object_data);
|
||||
og = (Evas_Object_Gradient2 *)(o);
|
||||
/* remove those pesky changes */
|
||||
evas_object_clip_changes_clean(obj);
|
||||
/* move cur to prev safely for object data */
|
||||
obj->prev = obj->cur;
|
||||
obj->changed = 0;
|
||||
o->prev = o->cur;
|
||||
o->changed = 0;
|
||||
o->gradient_changed = 0;
|
||||
og->prev = og->cur;
|
||||
og->gradient_changed = 0;
|
||||
}
|
||||
|
||||
static unsigned int evas_object_gradient2_linear_id_get(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Linear *o;
|
||||
|
||||
o = (Evas_Object_Gradient2_Linear *)(obj->object_data);
|
||||
if (!o) return 0;
|
||||
return MAGIC_OBJ_GRADIENT_LINEAR;
|
||||
}
|
||||
|
||||
static unsigned int evas_object_gradient2_linear_visual_id_get(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Linear *o;
|
||||
|
||||
o = (Evas_Object_Gradient2_Linear *)(obj->object_data);
|
||||
if (!o) return 0;
|
||||
return MAGIC_OBJ_GRADIENT;
|
||||
}
|
||||
|
||||
static void *evas_object_gradient2_linear_engine_data_get(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Linear *o;
|
||||
|
||||
o = (Evas_Object_Gradient2_Linear *)(obj->object_data);
|
||||
if (!o) return NULL;
|
||||
return o->engine_data;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
evas_object_gradient2_linear_is_opaque(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Linear *o;
|
||||
Evas_Object_Gradient2 *og;
|
||||
|
||||
/* this returns 1 if the internal object data implies that the object is */
|
||||
/* currently fully opaque over the entire region it occupies */
|
||||
if ((obj->cur.map) && (obj->cur.usemap)) return 0;
|
||||
o = (Evas_Object_Gradient2_Linear *)(obj->object_data);
|
||||
if (!o->engine_data) return 0;
|
||||
og = (Evas_Object_Gradient2 *)(o);
|
||||
return og->cur.gradient_opaque;
|
||||
}
|
||||
|
||||
static int
|
||||
evas_object_gradient2_linear_was_opaque(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Linear *o;
|
||||
Evas_Object_Gradient2 *og;
|
||||
|
||||
/* this returns 1 if the internal object data implies that the object was */
|
||||
/* currently fully opaque over the entire region it occupies */
|
||||
o = (Evas_Object_Gradient2_Linear *)(obj->object_data);
|
||||
if (!o->engine_data) return 0;
|
||||
og = (Evas_Object_Gradient2 *)(o);
|
||||
return og->prev.gradient_opaque;
|
||||
}
|
|
@ -1,471 +0,0 @@
|
|||
#include "evas_common.h"
|
||||
#include "evas_private.h"
|
||||
|
||||
/* private magic number for radial gradient objects */
|
||||
static const char rg_type[] = "radial_gradient";
|
||||
|
||||
/* private struct for gradient object internal data */
|
||||
typedef struct _Evas_Object_Gradient2_Radial Evas_Object_Gradient2_Radial;
|
||||
|
||||
struct _Evas_Object_Gradient2_Radial
|
||||
{
|
||||
Evas_Object_Gradient2 base;
|
||||
|
||||
DATA32 magic;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
float cx, cy, rx, ry;
|
||||
} fill;
|
||||
} cur, prev;
|
||||
|
||||
void *engine_data;
|
||||
|
||||
unsigned char gradient_changed : 1;
|
||||
unsigned char changed : 1;
|
||||
};
|
||||
|
||||
/* private methods for radial gradient objects */
|
||||
static void evas_object_gradient2_radial_init(Evas_Object *obj);
|
||||
static void *evas_object_gradient2_radial_new(void);
|
||||
|
||||
static void evas_object_gradient2_radial_free(Evas_Object *obj);
|
||||
static void evas_object_gradient2_radial_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
|
||||
static void evas_object_gradient2_radial_render_pre(Evas_Object *obj);
|
||||
static void evas_object_gradient2_radial_render_post(Evas_Object *obj);
|
||||
|
||||
static unsigned int evas_object_gradient2_radial_id_get(Evas_Object *obj);
|
||||
static unsigned int evas_object_gradient2_radial_visual_id_get(Evas_Object *obj);
|
||||
static void *evas_object_gradient2_radial_engine_data_get(Evas_Object *obj);
|
||||
|
||||
static int evas_object_gradient2_radial_is_opaque(Evas_Object *obj);
|
||||
static int evas_object_gradient2_radial_was_opaque(Evas_Object *obj);
|
||||
|
||||
static const Evas_Object_Func rg_object_func =
|
||||
{
|
||||
/* methods (compulsory) */
|
||||
evas_object_gradient2_radial_free,
|
||||
evas_object_gradient2_radial_render,
|
||||
evas_object_gradient2_radial_render_pre,
|
||||
evas_object_gradient2_radial_render_post,
|
||||
evas_object_gradient2_radial_id_get,
|
||||
evas_object_gradient2_radial_visual_id_get,
|
||||
evas_object_gradient2_radial_engine_data_get,
|
||||
/* these are optional. NULL = nothing */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
evas_object_gradient2_radial_is_opaque,
|
||||
evas_object_gradient2_radial_was_opaque,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
/* the actual api call to add a gradient */
|
||||
|
||||
/**
|
||||
* @addtogroup Evas_Object_Gradient2_Group
|
||||
* @{
|
||||
* @ingroup Evas_Object_Specific
|
||||
*/
|
||||
|
||||
/**
|
||||
* Adds a gradient object to the given evas.
|
||||
* @param e The given evas.
|
||||
* @return A new evas gradient object if successful. Otherwise, @c NULL.
|
||||
*/
|
||||
EAPI Evas_Object *
|
||||
evas_object_gradient2_radial_add(Evas *e)
|
||||
{
|
||||
Evas_Object *obj;
|
||||
|
||||
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
||||
return NULL;
|
||||
MAGIC_CHECK_END();
|
||||
obj = evas_object_new(e);
|
||||
evas_object_gradient2_radial_init(obj);
|
||||
evas_object_inject(obj, e);
|
||||
if (obj->object_data)
|
||||
{
|
||||
Evas_Object_Gradient2_Radial *o = (Evas_Object_Gradient2_Radial *)(obj->object_data);
|
||||
|
||||
o->engine_data = e->engine.func->gradient2_radial_new(e->engine.data.output);
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the center and radii of the radial gradient geometry for the object.
|
||||
*
|
||||
* Note that the gradient may extend beyond these,
|
||||
* according to its spread value - restrict, repeat, or reflect. To have
|
||||
* only one 'cycle' of the gradient drawn, the spread value must be set
|
||||
* to restrict.
|
||||
* The default values for the fill parameters is @p cx = 0, @p cy = 0,
|
||||
* @p rx = 0 and @p ry = 0.
|
||||
*
|
||||
* @param obj The given evas radial gradient object.
|
||||
* @param cx The X coordinate of the start point.
|
||||
* @param cy The Y coordinate of the start point.
|
||||
* @param rx The length of the x-cordinate radius.
|
||||
* @param ry The length of the y-coordinate radius.
|
||||
*/
|
||||
EAPI void
|
||||
evas_object_gradient2_radial_fill_set(Evas_Object *obj, float cx, float cy, float rx, float ry)
|
||||
{
|
||||
Evas_Object_Gradient2_Radial *o;
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
o = (Evas_Object_Gradient2_Radial *)(obj->object_data);
|
||||
MAGIC_CHECK(o, Evas_Object_Gradient2_Radial, MAGIC_OBJ_GRADIENT_RADIAL);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
if ((o->cur.fill.cx == cx) &&
|
||||
(o->cur.fill.cy == cy) &&
|
||||
(o->cur.fill.rx == rx) &&
|
||||
(o->cur.fill.ry == ry)) return;
|
||||
o->cur.fill.cx = cx;
|
||||
o->cur.fill.cy = cy;
|
||||
o->cur.fill.rx = rx;
|
||||
o->cur.fill.ry = ry;
|
||||
o->gradient_changed = 1;
|
||||
o->changed = 1;
|
||||
evas_object_change(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_object_gradient2_radial_fill_get(const Evas_Object *obj, float *cx, float *cy, float *rx, float *ry)
|
||||
{
|
||||
Evas_Object_Gradient2_Radial *o;
|
||||
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
if (cx) *cx = 0;
|
||||
if (cy) *cy = 0;
|
||||
if (rx) *rx = 0;
|
||||
if (ry) *ry = 0;
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
o = (Evas_Object_Gradient2_Radial *)(obj->object_data);
|
||||
MAGIC_CHECK(o, Evas_Object_Gradient2_Radial, MAGIC_OBJ_GRADIENT_RADIAL);
|
||||
if (cx) *cx = 0;
|
||||
if (cy) *cy = 0;
|
||||
if (rx) *rx = 0;
|
||||
if (ry) *ry = 0;
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
if (cx) *cx = o->cur.fill.cx;
|
||||
if (cy) *cy = o->cur.fill.cy;
|
||||
if (rx) *rx = o->cur.fill.rx;
|
||||
if (ry) *ry = o->cur.fill.ry;
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* all nice and private */
|
||||
static void
|
||||
evas_object_gradient2_radial_init(Evas_Object *obj)
|
||||
{
|
||||
/* alloc grad ob, setup methods and default values */
|
||||
obj->object_data = evas_object_gradient2_radial_new();
|
||||
/* set up default settings for this kind of object */
|
||||
obj->cur.color.r = 255;
|
||||
obj->cur.color.g = 255;
|
||||
obj->cur.color.b = 255;
|
||||
obj->cur.color.a = 255;
|
||||
obj->cur.geometry.x = 0;
|
||||
obj->cur.geometry.y = 0;
|
||||
obj->cur.geometry.w = 0;
|
||||
obj->cur.geometry.h = 0;
|
||||
obj->cur.layer = 0;
|
||||
obj->cur.anti_alias = 1;
|
||||
obj->cur.interpolation_color_space = EVAS_COLOR_SPACE_ARGB;
|
||||
obj->cur.render_op = EVAS_RENDER_BLEND;
|
||||
/* set up object-specific settings */
|
||||
obj->prev = obj->cur;
|
||||
/* set up methods (compulsory) */
|
||||
obj->func = &rg_object_func;
|
||||
obj->type = rg_type;
|
||||
obj->changed = 1;
|
||||
}
|
||||
|
||||
static void *
|
||||
evas_object_gradient2_radial_new(void)
|
||||
{
|
||||
Evas_Object_Gradient2_Radial *o;
|
||||
Evas_Object_Gradient2 *og;
|
||||
|
||||
/* alloc obj private data */
|
||||
o = calloc(1, sizeof(Evas_Object_Gradient2_Radial));
|
||||
if (!o) return NULL;
|
||||
o->magic = MAGIC_OBJ_GRADIENT_RADIAL;
|
||||
o->cur.fill.cx = 0;
|
||||
o->cur.fill.cy = 0;
|
||||
o->cur.fill.rx = 1;
|
||||
o->cur.fill.ry = 1;
|
||||
og = (Evas_Object_Gradient2 *)o;
|
||||
og->magic = MAGIC_OBJ_GRADIENT;
|
||||
og->cur.fill.transform.mxx = og->cur.fill.transform.myy = og->cur.fill.transform.mzz = 1;
|
||||
og->cur.fill.spread = EVAS_TEXTURE_REPEAT;
|
||||
og->cur.gradient_opaque = 0;
|
||||
og->prev = og->cur;
|
||||
og->gradient_changed = 1;
|
||||
o->prev = o->cur;
|
||||
o->changed = 1;
|
||||
o->gradient_changed = 1;
|
||||
return o;
|
||||
}
|
||||
|
||||
static void
|
||||
evas_object_gradient2_radial_free(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Radial *o;
|
||||
|
||||
/* frees private object data. very simple here */
|
||||
o = (Evas_Object_Gradient2_Radial *)(obj->object_data);
|
||||
MAGIC_CHECK(o, Evas_Object_Gradient2_Radial, MAGIC_OBJ_GRADIENT_RADIAL);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
/* free obj */
|
||||
if (o->engine_data)
|
||||
obj->layer->evas->engine.func->gradient2_radial_free(obj->layer->evas->engine.data.output,
|
||||
o->engine_data);
|
||||
free(o);
|
||||
obj->object_data = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
evas_object_gradient2_radial_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y)
|
||||
{
|
||||
Evas_Object_Gradient2_Radial *o;
|
||||
|
||||
/* render object to surface with context, and offxet by x,y */
|
||||
o = (Evas_Object_Gradient2_Radial *)(obj->object_data);
|
||||
obj->layer->evas->engine.func->context_multiplier_unset(output, context);
|
||||
obj->layer->evas->engine.func->context_anti_alias_set(output, context, obj->cur.anti_alias);
|
||||
obj->layer->evas->engine.func->context_render_op_set(output, context, obj->cur.render_op);
|
||||
if (o->engine_data)
|
||||
{
|
||||
obj->layer->evas->engine.func->gradient2_radial_draw(output, context, surface,
|
||||
o->engine_data,
|
||||
obj->cur.geometry.x + x,
|
||||
obj->cur.geometry.y + y,
|
||||
obj->cur.geometry.w,
|
||||
obj->cur.geometry.h);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
evas_object_gradient2_radial_render_pre(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Radial *o;
|
||||
Evas_Object_Gradient2 *og;
|
||||
int is_v, was_v;
|
||||
|
||||
/* dont pre-render the obj twice! */
|
||||
if (obj->pre_render_done) return;
|
||||
obj->pre_render_done = 1;
|
||||
/* pre-render phase. this does anything an object needs to do just before */
|
||||
/* rendering. this could mean loading the image data, retrieving it from */
|
||||
/* elsewhere, decoding video etc. */
|
||||
/* then when this is done the object needs to figure if it changed and */
|
||||
/* if so what and where and add the appropriate redraw rectangles */
|
||||
o = (Evas_Object_Gradient2_Radial *)(obj->object_data);
|
||||
og = (Evas_Object_Gradient2 *)(o);
|
||||
/* if someone is clipping this obj - go calculate the clipper */
|
||||
if (obj->cur.clipper)
|
||||
{
|
||||
if (obj->cur.cache.clip.dirty)
|
||||
evas_object_clip_recalc(obj->cur.clipper);
|
||||
obj->cur.clipper->func->render_pre(obj->cur.clipper);
|
||||
}
|
||||
/* if it changed color */
|
||||
if ((obj->cur.color.r != obj->prev.color.r) ||
|
||||
(obj->cur.color.g != obj->prev.color.g) ||
|
||||
(obj->cur.color.b != obj->prev.color.b) ||
|
||||
(obj->cur.color.a != obj->prev.color.a))
|
||||
{ o->gradient_changed = 1; o->changed = 1; }
|
||||
if ((!o->gradient_changed) && ((obj->cur.cache.clip.r != obj->prev.cache.clip.r) ||
|
||||
(obj->cur.cache.clip.g != obj->prev.cache.clip.g) ||
|
||||
(obj->cur.cache.clip.b != obj->prev.cache.clip.b) ||
|
||||
(obj->cur.cache.clip.a != obj->prev.cache.clip.a)))
|
||||
{ o->gradient_changed = 1; o->changed = 1; }
|
||||
if (!o->gradient_changed && (obj->cur.interpolation_color_space != obj->prev.interpolation_color_space))
|
||||
{ o->gradient_changed = 1; o->changed = 1; }
|
||||
if (!o->changed && (obj->cur.render_op != obj->prev.render_op))
|
||||
o->changed = 1;
|
||||
// if (!o->changed && (obj->cur.anti_alias != obj->prev.anti_alias))
|
||||
// o->changed = 1;
|
||||
if (og->gradient_changed)
|
||||
{ o->gradient_changed = 1; o->changed = 1; }
|
||||
if (o->changed && o->engine_data)
|
||||
{
|
||||
obj->layer->evas->engine.func->context_render_op_set(obj->layer->evas->engine.data.output,
|
||||
obj->layer->evas->engine.data.context, obj->cur.render_op);
|
||||
obj->layer->evas->engine.func->context_multiplier_set(obj->layer->evas->engine.data.output,
|
||||
obj->layer->evas->engine.data.context,
|
||||
obj->cur.cache.clip.r, obj->cur.cache.clip.g,
|
||||
obj->cur.cache.clip.b, obj->cur.cache.clip.a);
|
||||
obj->layer->evas->engine.func->context_color_interpolation_set(obj->layer->evas->engine.data.output,
|
||||
obj->layer->evas->engine.data.context,
|
||||
obj->cur.interpolation_color_space);
|
||||
if (o->gradient_changed)
|
||||
{
|
||||
obj->layer->evas->engine.func->gradient2_radial_fill_set(obj->layer->evas->engine.data.output, o->engine_data, o->cur.fill.cx, o->cur.fill.cy, o->cur.fill.rx, o->cur.fill.ry);
|
||||
obj->layer->evas->engine.func->gradient2_fill_transform_set(obj->layer->evas->engine.data.output, o->engine_data,
|
||||
&og->cur.fill.transform);
|
||||
obj->layer->evas->engine.func->gradient2_fill_spread_set(obj->layer->evas->engine.data.output, o->engine_data,
|
||||
og->cur.fill.spread);
|
||||
obj->layer->evas->engine.func->gradient2_radial_render_pre(obj->layer->evas->engine.data.output,
|
||||
obj->layer->evas->engine.data.context,
|
||||
o->engine_data);
|
||||
}
|
||||
og->cur.gradient_opaque = obj->layer->evas->engine.func->gradient2_radial_is_opaque(obj->layer->evas->engine.data.output,
|
||||
obj->layer->evas->engine.data.context,
|
||||
o->engine_data,
|
||||
obj->cur.cache.clip.x, obj->cur.cache.clip.y,
|
||||
obj->cur.cache.clip.w, obj->cur.cache.clip.h);
|
||||
|
||||
if (obj->cur.cache.clip.a != 255)
|
||||
og->cur.gradient_opaque = 0;
|
||||
}
|
||||
/* now figure what changed and add draw rects */
|
||||
/* if it just became visible or invisible */
|
||||
is_v = evas_object_is_visible(obj);
|
||||
was_v = evas_object_was_visible(obj);
|
||||
if (is_v != was_v)
|
||||
{
|
||||
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, obj, is_v, was_v);
|
||||
goto done;
|
||||
}
|
||||
if ((obj->cur.map != obj->prev.map) ||
|
||||
(obj->cur.usemap != obj->prev.usemap))
|
||||
{
|
||||
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
|
||||
goto done;
|
||||
}
|
||||
/* its not visible - we accounted for it appearing or not so just abort */
|
||||
if (!is_v) goto done;
|
||||
/* clipper changed this is in addition to anything else for obj */
|
||||
evas_object_render_pre_clipper_change(&obj->layer->evas->clip_changes, obj);
|
||||
/* gradient changed */
|
||||
if (o->changed || obj->restack)
|
||||
{
|
||||
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
|
||||
goto done;
|
||||
}
|
||||
/* if it changed geometry */
|
||||
if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
|
||||
(obj->cur.geometry.y != obj->prev.geometry.y) ||
|
||||
(obj->cur.geometry.w != obj->prev.geometry.w) ||
|
||||
(obj->cur.geometry.h != obj->prev.geometry.h))
|
||||
{
|
||||
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
|
||||
goto done;
|
||||
}
|
||||
/* it obviously didn't change - add a NO obscure - this "unupdates" this */
|
||||
/* area so if there were updates for it they get wiped. don't do it if we */
|
||||
/* arent fully opaque and we are visible */
|
||||
|
||||
if (evas_object_is_visible(obj) &&
|
||||
evas_object_is_opaque(obj))
|
||||
obj->layer->evas->engine.func->output_redraws_rect_del(obj->layer->evas->engine.data.output,
|
||||
obj->cur.cache.clip.x,
|
||||
obj->cur.cache.clip.y,
|
||||
obj->cur.cache.clip.w,
|
||||
obj->cur.cache.clip.h);
|
||||
|
||||
done:
|
||||
evas_object_render_pre_effect_updates(&obj->layer->evas->clip_changes, obj, is_v, was_v);
|
||||
}
|
||||
|
||||
static void
|
||||
evas_object_gradient2_radial_render_post(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Radial *o;
|
||||
Evas_Object_Gradient2 *og;
|
||||
|
||||
/* this moves the current data to the previous state parts of the object */
|
||||
/* in whatever way is safest for the object. also if we don't need object */
|
||||
/* data anymore we can free it if the object deems this is a good idea */
|
||||
o = (Evas_Object_Gradient2_Radial *)(obj->object_data);
|
||||
og = (Evas_Object_Gradient2 *)(o);
|
||||
/* remove those pesky changes */
|
||||
evas_object_clip_changes_clean(obj);
|
||||
/* move cur to prev safely for object data */
|
||||
obj->prev = obj->cur;
|
||||
obj->changed = 0;
|
||||
o->prev = o->cur;
|
||||
o->changed = 0;
|
||||
o->gradient_changed = 0;
|
||||
og->prev = og->cur;
|
||||
og->gradient_changed = 0;
|
||||
}
|
||||
|
||||
static unsigned int evas_object_gradient2_radial_id_get(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Radial *o;
|
||||
|
||||
o = (Evas_Object_Gradient2_Radial *)(obj->object_data);
|
||||
if (!o) return 0;
|
||||
return MAGIC_OBJ_GRADIENT_RADIAL;
|
||||
}
|
||||
|
||||
static unsigned int evas_object_gradient2_radial_visual_id_get(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Radial *o;
|
||||
|
||||
o = (Evas_Object_Gradient2_Radial *)(obj->object_data);
|
||||
if (!o) return 0;
|
||||
return MAGIC_OBJ_GRADIENT;
|
||||
}
|
||||
|
||||
static void *evas_object_gradient2_radial_engine_data_get(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Radial *o;
|
||||
|
||||
o = (Evas_Object_Gradient2_Radial *)(obj->object_data);
|
||||
if (!o) return NULL;
|
||||
return o->engine_data;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
evas_object_gradient2_radial_is_opaque(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Radial *o;
|
||||
Evas_Object_Gradient2 *og;
|
||||
|
||||
/* this returns 1 if the internal object data implies that the object is */
|
||||
/* currently fully opaque over the entire region it occupies */
|
||||
if ((obj->cur.map) && (obj->cur.usemap)) return 0;
|
||||
o = (Evas_Object_Gradient2_Radial *)(obj->object_data);
|
||||
if (!o->engine_data) return 0;
|
||||
og = (Evas_Object_Gradient2 *)(o);
|
||||
return og->cur.gradient_opaque;
|
||||
}
|
||||
|
||||
static int
|
||||
evas_object_gradient2_radial_was_opaque(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object_Gradient2_Radial *o;
|
||||
Evas_Object_Gradient2 *og;
|
||||
|
||||
/* this returns 1 if the internal object data implies that the object was */
|
||||
/* currently fully opaque over the entire region it occupies */
|
||||
o = (Evas_Object_Gradient2_Radial *)(obj->object_data);
|
||||
if (!o->engine_data) return 0;
|
||||
og = (Evas_Object_Gradient2 *)(o);
|
||||
return og->prev.gradient_opaque;
|
||||
}
|
|
@ -44,15 +44,6 @@ evas_font_draw.c \
|
|||
evas_font_load.c \
|
||||
evas_font_main.c \
|
||||
evas_font_query.c \
|
||||
evas_gradient_main.c \
|
||||
evas_gradient_linear.c \
|
||||
evas_gradient_radial.c \
|
||||
evas_gradient_angular.c \
|
||||
evas_gradient_rectangular.c \
|
||||
evas_gradient_sinusoidal.c \
|
||||
evas_gradient2_main.c \
|
||||
evas_gradient2_linear.c \
|
||||
evas_gradient2_radial.c \
|
||||
evas_image_load.c \
|
||||
evas_image_save.c \
|
||||
evas_image_main.c \
|
||||
|
@ -91,8 +82,6 @@ evas_draw.h \
|
|||
evas_encoding.h \
|
||||
evas_font.h \
|
||||
evas_font_private.h \
|
||||
evas_gradient.h \
|
||||
evas_gradient_private.h \
|
||||
evas_image.h \
|
||||
evas_image_private.h \
|
||||
evas_line.h \
|
||||
|
|
|
@ -42,7 +42,6 @@ evas_common_init(void)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
#ifndef _EVAS_GRADIENT_H
|
||||
#define _EVAS_GRADIENT_H
|
||||
|
||||
|
||||
EAPI void evas_common_gradient_init (void);
|
||||
|
||||
EAPI RGBA_Gradient *evas_common_gradient_new (void);
|
||||
EAPI void evas_common_gradient_free (RGBA_Gradient *gr);
|
||||
EAPI void evas_common_gradient_clear (RGBA_Gradient *gr);
|
||||
EAPI void evas_common_gradient_color_stop_add (RGBA_Gradient *gr, int r, int g, int b, int a, int dist);
|
||||
EAPI void evas_common_gradient_alpha_stop_add (RGBA_Gradient *gr, int a, int dist);
|
||||
EAPI void evas_common_gradient_color_data_set (RGBA_Gradient *gr, DATA32 *data, int len, int alpha_flags);
|
||||
EAPI void evas_common_gradient_alpha_data_set (RGBA_Gradient *gr, DATA8 *adata, int len);
|
||||
EAPI void evas_common_gradient_type_set (RGBA_Gradient *gr, const char *name, char *params);
|
||||
EAPI void evas_common_gradient_fill_set (RGBA_Gradient *gr, int x, int y, int w, int h);
|
||||
EAPI void evas_common_gradient_fill_angle_set (RGBA_Gradient *gr, float angle);
|
||||
EAPI void evas_common_gradient_fill_spread_set (RGBA_Gradient *gr, int spread);
|
||||
EAPI void evas_common_gradient_map_angle_set (RGBA_Gradient *gr, float angle);
|
||||
EAPI void evas_common_gradient_map_offset_set (RGBA_Gradient *gr, float offset);
|
||||
EAPI void evas_common_gradient_map_direction_set (RGBA_Gradient *gr, int direction);
|
||||
EAPI void evas_common_gradient_map (RGBA_Draw_Context *dc, RGBA_Gradient *gr, int len);
|
||||
EAPI void evas_common_gradient_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h, RGBA_Gradient *gr);
|
||||
|
||||
EAPI RGBA_Gradient_Type *evas_common_gradient_geometer_get (const char *name);
|
||||
|
||||
|
||||
|
||||
EAPI void evas_common_gradient2_free (RGBA_Gradient2 *gr);
|
||||
EAPI RGBA_Gradient2 *evas_common_gradient2_linear_new (void);
|
||||
EAPI void evas_common_gradient2_linear_fill_set (RGBA_Gradient2 *gr, float x0, float y0, float x1, float y1);
|
||||
EAPI RGBA_Gradient2 *evas_common_gradient2_radial_new (void);
|
||||
EAPI void evas_common_gradient2_radial_fill_set (RGBA_Gradient2 *gr, float cx, float cy, float rx, float ry);
|
||||
EAPI void evas_common_gradient2_clear (RGBA_Gradient2 *gr);
|
||||
EAPI void evas_common_gradient2_color_np_stop_insert (RGBA_Gradient2 *gr, int r, int g, int b, int a, float pos);
|
||||
EAPI void evas_common_gradient2_fill_spread_set (RGBA_Gradient2 *gr, int spread);
|
||||
EAPI void evas_common_gradient2_fill_transform_set (RGBA_Gradient2 *gr, Evas_Common_Transform *t);
|
||||
EAPI void evas_common_gradient2_map (RGBA_Draw_Context *dc, RGBA_Gradient2 *gr, int len);
|
||||
EAPI void evas_common_gradient2_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h, RGBA_Gradient2 *gr);
|
||||
|
||||
EAPI RGBA_Gradient2_Type *evas_common_gradient2_type_linear_get (void);
|
||||
EAPI RGBA_Gradient2_Type *evas_common_gradient2_type_radial_get (void);
|
||||
//EAPI RGBA_Gradient2_Type *evas_common_gradient2_type_angular_get (void);
|
||||
//EAPI RGBA_Gradient2_Type *evas_common_gradient2_type_rectangular_get (void);
|
||||
//EAPI RGBA_Gradient2_Type *evas_common_gradient2_type_sinusoidal_get (void);
|
||||
|
||||
#endif /* _EVAS_GRADIENT_H */
|
|
@ -1,728 +0,0 @@
|
|||
#include "evas_common.h"
|
||||
#include "evas_private.h"
|
||||
#include <math.h>
|
||||
|
||||
#define LINEAR_EPSILON 0.000030517578125
|
||||
#define LINEAR_INT_TOLERANCE 0.001953125
|
||||
// 1/512 = 0.001953125 <-- will use this one as our subpixel pos tolerance.
|
||||
// 1/256 = 0.00390625 <-- though this one would be ok too for our uses.
|
||||
|
||||
typedef struct _Linear_Data Linear_Data;
|
||||
|
||||
struct _Linear_Data
|
||||
{
|
||||
float x0, y0, x1, y1;
|
||||
float fx0, fy0;
|
||||
int ayx, ayy;
|
||||
int len;
|
||||
unsigned char int_axis_aligned : 1;
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
linear_init(void);
|
||||
|
||||
static void
|
||||
linear_shutdown(void);
|
||||
|
||||
static void
|
||||
linear_init_geom(RGBA_Gradient2 *gr);
|
||||
|
||||
static void
|
||||
linear_update_geom(RGBA_Gradient2 *gr);
|
||||
|
||||
static void
|
||||
linear_free_geom(void *gdata);
|
||||
|
||||
static int
|
||||
linear_has_alpha(RGBA_Gradient2 *gr, int op);
|
||||
|
||||
static int
|
||||
linear_has_mask(RGBA_Gradient2 *gr, int op);
|
||||
|
||||
static int
|
||||
linear_get_map_len(RGBA_Gradient2 *gr);
|
||||
|
||||
static Gfx_Func_Gradient2_Fill
|
||||
linear_get_fill_func(RGBA_Gradient2 *gr, int op);
|
||||
|
||||
static RGBA_Gradient2_Type linear = {"linear", linear_init, linear_shutdown,
|
||||
linear_init_geom,
|
||||
linear_update_geom, linear_free_geom,
|
||||
linear_has_alpha, linear_has_mask,
|
||||
linear_get_map_len, linear_get_fill_func};
|
||||
|
||||
|
||||
EAPI RGBA_Gradient2_Type *
|
||||
evas_common_gradient2_type_linear_get(void)
|
||||
{
|
||||
return &linear;
|
||||
}
|
||||
|
||||
EAPI RGBA_Gradient2 *
|
||||
evas_common_gradient2_linear_new(void)
|
||||
{
|
||||
RGBA_Gradient2 *gr;
|
||||
|
||||
gr = calloc(1, sizeof(RGBA_Gradient2));
|
||||
if (!gr) return NULL;
|
||||
gr->references = 1;
|
||||
gr->type.id = MAGIC_OBJ_GRADIENT_LINEAR;
|
||||
gr->type.geometer = &linear;
|
||||
linear_init_geom(gr);
|
||||
return gr;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient2_linear_fill_set(RGBA_Gradient2 *gr, float x0, float y0, float x1, float y1)
|
||||
{
|
||||
Linear_Data *linear_data;
|
||||
|
||||
if (!gr) return;
|
||||
if (gr->type.id != MAGIC_OBJ_GRADIENT_LINEAR) return;
|
||||
if (gr->type.geometer != &linear) return;
|
||||
linear_data = (Linear_Data *)gr->type.gdata;
|
||||
if (!linear_data) return;
|
||||
linear_data->x0 = x0; linear_data->y0 = y0;
|
||||
linear_data->x1 = x1; linear_data->y1 = y1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** internal functions **/
|
||||
|
||||
static void
|
||||
linear_reflect_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, void *params_data);
|
||||
|
||||
static void
|
||||
linear_repeat_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, void *params_data);
|
||||
|
||||
static void
|
||||
linear_restrict_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, void *params_data);
|
||||
|
||||
static void
|
||||
linear_restrict_masked_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, void *params_data);
|
||||
|
||||
static void
|
||||
linear_pad_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, void *params_data);
|
||||
|
||||
|
||||
|
||||
static void
|
||||
linear_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
linear_shutdown(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
linear_free_geom(void *gdata)
|
||||
{
|
||||
Linear_Data *data = (Linear_Data *)gdata;
|
||||
if (data) free(data);
|
||||
}
|
||||
|
||||
static void
|
||||
linear_init_geom(RGBA_Gradient2 *gr)
|
||||
{
|
||||
Linear_Data *linear_data;
|
||||
|
||||
if (!gr || (gr->type.geometer != &linear)) return;
|
||||
linear_data = (Linear_Data *)gr->type.gdata;
|
||||
if (!linear_data)
|
||||
{
|
||||
linear_data = calloc(1, sizeof(Linear_Data));
|
||||
if (!linear_data) return;
|
||||
linear_data->ayy = 65536; linear_data->ayx = 0;
|
||||
}
|
||||
gr->type.gdata = linear_data;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
linear_update_geom(RGBA_Gradient2 *gr)
|
||||
{
|
||||
Linear_Data *linear_data;
|
||||
double f;
|
||||
double fx0, fy0, fx1, fy1;
|
||||
int len;
|
||||
|
||||
if (!gr || (gr->type.geometer != &linear)) return;
|
||||
linear_data = (Linear_Data *)gr->type.gdata;
|
||||
if (!linear_data) return;
|
||||
|
||||
linear_data->int_axis_aligned = 0;
|
||||
linear_data->len = 0;
|
||||
f = (gr->fill.transform.mxx * (double)gr->fill.transform.myy) - (gr->fill.transform.mxy * (double)gr->fill.transform.myx);
|
||||
if (fabs(f) < LINEAR_EPSILON) return;
|
||||
|
||||
f = 1.0 / f;
|
||||
fx0 = (((gr->fill.transform.myy * (double)linear_data->x0) - (gr->fill.transform.mxy * (double)linear_data->y0)) * f) - gr->fill.transform.mxz;
|
||||
fy0 = ((-(gr->fill.transform.myx * (double)linear_data->x0) + (gr->fill.transform.mxx * (double)linear_data->y0)) * f) - gr->fill.transform.myz;
|
||||
|
||||
fx1 = (((gr->fill.transform.myy * (double)linear_data->x1) - (gr->fill.transform.mxy * (double)linear_data->y1)) * f) - gr->fill.transform.mxz;
|
||||
fy1 = ((-(gr->fill.transform.myx * (double)linear_data->x1) + (gr->fill.transform.mxx * (double)linear_data->y1)) * f) - gr->fill.transform.myz;
|
||||
|
||||
f = hypot(fx1 - fx0, fy1 - fy0);
|
||||
linear_data->len = len = f + 0.5;
|
||||
if (!len) return;
|
||||
|
||||
linear_data->ayx = ((fx1 - fx0) / f) * 65536;
|
||||
linear_data->ayy = ((fy1 - fy0) / f) * 65536;
|
||||
|
||||
if (fabs(fy0 - fy1) < LINEAR_INT_TOLERANCE)
|
||||
{
|
||||
if ( (fabs(((int)fy0) - fy0) < LINEAR_INT_TOLERANCE) &&
|
||||
(fabs(((int)fy1) - fy1) < LINEAR_INT_TOLERANCE) )
|
||||
{ linear_data->int_axis_aligned = 1; linear_data->ayy = 0; }
|
||||
}
|
||||
else if (fabs(fx0 - fx1) < LINEAR_INT_TOLERANCE)
|
||||
{
|
||||
if ( (fabs(((int)fx0) - fx0) < LINEAR_INT_TOLERANCE) &&
|
||||
(fabs(((int)fx1) - fx1) < LINEAR_INT_TOLERANCE) )
|
||||
{ linear_data->int_axis_aligned = 1; linear_data->ayx = 0; }
|
||||
}
|
||||
linear_data->fx0 = fx0;
|
||||
linear_data->fy0 = fy0;
|
||||
}
|
||||
|
||||
static int
|
||||
linear_has_alpha(RGBA_Gradient2 *gr, int op)
|
||||
{
|
||||
if (!gr || (gr->type.geometer != &linear)) return 0;
|
||||
if (gr->has_alpha | gr->map.has_alpha)
|
||||
return 1;
|
||||
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
|
||||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
|
||||
return 0;
|
||||
if (gr->fill.spread == _EVAS_TEXTURE_RESTRICT)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
linear_has_mask(RGBA_Gradient2 *gr, int op)
|
||||
{
|
||||
if (!gr || (gr->type.geometer != &linear)) return 0;
|
||||
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
|
||||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
|
||||
{
|
||||
if (gr->fill.spread == _EVAS_TEXTURE_RESTRICT)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
linear_get_map_len(RGBA_Gradient2 *gr)
|
||||
{
|
||||
Linear_Data *linear_data;
|
||||
|
||||
if (!gr || (gr->type.geometer != &linear)) return 0;
|
||||
linear_data = (Linear_Data *)gr->type.gdata;
|
||||
if (!linear_data) return 0;
|
||||
return linear_data->len;
|
||||
}
|
||||
|
||||
static Gfx_Func_Gradient2_Fill
|
||||
linear_get_fill_func(RGBA_Gradient2 *gr, int op)
|
||||
{
|
||||
Linear_Data *linear_data;
|
||||
Gfx_Func_Gradient2_Fill sfunc = NULL;
|
||||
int masked_op = 0;
|
||||
|
||||
if (!gr || (gr->type.geometer != &linear))
|
||||
return sfunc;
|
||||
linear_data = (Linear_Data *)gr->type.gdata;
|
||||
if (!linear_data) return sfunc;
|
||||
|
||||
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
|
||||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
|
||||
masked_op = 1;
|
||||
|
||||
switch (gr->fill.spread)
|
||||
{
|
||||
case _EVAS_TEXTURE_REPEAT:
|
||||
sfunc = linear_repeat_aa;
|
||||
break;
|
||||
case _EVAS_TEXTURE_REFLECT:
|
||||
sfunc = linear_reflect_aa;
|
||||
break;
|
||||
case _EVAS_TEXTURE_RESTRICT:
|
||||
if (masked_op)
|
||||
sfunc = linear_restrict_masked_aa;
|
||||
else
|
||||
sfunc = linear_restrict_aa;
|
||||
break;
|
||||
case _EVAS_TEXTURE_PAD:
|
||||
sfunc = linear_pad_aa;
|
||||
break;
|
||||
default:
|
||||
sfunc = linear_repeat_aa;
|
||||
break;
|
||||
}
|
||||
return sfunc;
|
||||
}
|
||||
|
||||
|
||||
/* the fill functions */
|
||||
|
||||
#ifdef BUILD_MMX
|
||||
#define INTERP_256_P2R(a, s, mma, mms, mmd, mmz) \
|
||||
MOV_A2R(a, mma) \
|
||||
MOV_P2R(s, mms, mmz) \
|
||||
INTERP_256_R2R(mma, mms, mmd, mm5)
|
||||
|
||||
#define MUL_256_A2R(a, mma, mmd, mmz) \
|
||||
MOV_A2R(a, mma) \
|
||||
MUL4_256_R2R(mma, mmd)
|
||||
#endif
|
||||
|
||||
static void
|
||||
linear_repeat_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Linear_Data *gdata = (Linear_Data *)params_data;
|
||||
int yy;
|
||||
|
||||
evas_common_cpu_end_opt();
|
||||
yy = (gdata->ayx * (x - gdata->fx0 + 0.5)) + (gdata->ayy * (y - gdata->fy0 + 0.5)) - 32768;
|
||||
|
||||
if (gdata->int_axis_aligned && (gdata->ayx == 0))
|
||||
{
|
||||
DATA32 c;
|
||||
|
||||
y = (yy >> 16);
|
||||
y = y % src_len;
|
||||
if (y < 0)
|
||||
y += src_len;
|
||||
c = src[y];
|
||||
while (dst < dst_end)
|
||||
*dst++ = c;
|
||||
return;
|
||||
}
|
||||
|
||||
if (gdata->int_axis_aligned && (gdata->ayy == 0))
|
||||
{
|
||||
Gfx_Func_Copy func;
|
||||
int l;
|
||||
|
||||
x = (yy >> 16);
|
||||
x = x % src_len;
|
||||
if (x < 0)
|
||||
x += src_len;
|
||||
if (gdata->ayx < 0)
|
||||
{
|
||||
l = x + 1; x = 0;
|
||||
}
|
||||
else
|
||||
l = src_len - x;
|
||||
if (l > dst_len) l = dst_len;
|
||||
func = evas_common_draw_func_copy_get(1, (gdata->ayx < 0 ? -1 : 0));
|
||||
func(src + x, dst, l);
|
||||
if (l == dst_len) return;
|
||||
dst += l; dst_len -= l;
|
||||
l = dst_len / src_len;
|
||||
while (l--)
|
||||
{
|
||||
func(src, dst, src_len);
|
||||
dst += src_len;
|
||||
}
|
||||
l = dst_len % src_len;
|
||||
if (gdata->ayx < 0)
|
||||
src += src_len - l;
|
||||
func(src, dst, l);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef BUILD_MMX
|
||||
pxor_r2r(mm0, mm0);
|
||||
MOV_A2R(ALPHA_255, mm5)
|
||||
#endif
|
||||
while (dst < dst_end)
|
||||
{
|
||||
int l = (yy >> 16);
|
||||
int a = 1 + ((yy & 0xffff) >> 8);
|
||||
|
||||
if ((l >= src_len) || (l < 0))
|
||||
{ l = l % src_len; if (l < 0) l += src_len; }
|
||||
|
||||
#ifdef BUILD_MMX
|
||||
MOV_P2R(src[l], mm1, mm0)
|
||||
#else
|
||||
*dst = src[l];
|
||||
#endif
|
||||
if (l + 1 < src_len)
|
||||
{
|
||||
#ifdef BUILD_MMX
|
||||
INTERP_256_P2R(a, src[l + 1], mm3, mm2, mm1, mm0)
|
||||
#else
|
||||
*dst = INTERP_256(a, src[l + 1], *dst);
|
||||
#endif
|
||||
}
|
||||
if (l == (src_len - 1))
|
||||
{
|
||||
#ifdef BUILD_MMX
|
||||
INTERP_256_P2R(a, src[0], mm3, mm2, mm1, mm0)
|
||||
#else
|
||||
*dst = INTERP_256(a, src[0], *dst);
|
||||
#endif
|
||||
}
|
||||
#ifdef BUILD_MMX
|
||||
MOV_R2P(mm1, *dst, mm0)
|
||||
#endif
|
||||
dst++; yy += gdata->ayx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
linear_reflect_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Linear_Data *gdata = (Linear_Data *)params_data;
|
||||
int yy;
|
||||
|
||||
evas_common_cpu_end_opt();
|
||||
yy = (gdata->ayx * (x - gdata->fx0 + 0.5)) + (gdata->ayy * (y - gdata->fy0 + 0.5)) - 32768;
|
||||
|
||||
if (gdata->int_axis_aligned && (gdata->ayx == 0))
|
||||
{
|
||||
DATA32 c;
|
||||
|
||||
y = (yy >> 16);
|
||||
if (y < 0) y = -y;
|
||||
if (y >= src_len)
|
||||
{
|
||||
int m = (y % (2 * src_len));
|
||||
|
||||
y = (y % src_len);
|
||||
if (m >= src_len)
|
||||
y = src_len - y - 1;
|
||||
}
|
||||
c = src[y];
|
||||
while (dst < dst_end)
|
||||
*dst++ = c;
|
||||
return;
|
||||
}
|
||||
|
||||
if (gdata->int_axis_aligned && (gdata->ayy == 0))
|
||||
{
|
||||
Gfx_Func_Copy func, ofunc;
|
||||
int l, sgn;
|
||||
|
||||
x = (yy >> 16);
|
||||
sgn = (gdata->ayx < 0 ? -1 : 1);
|
||||
if (x < 0)
|
||||
{
|
||||
x = -x; sgn *= -1;
|
||||
}
|
||||
if (x >= src_len)
|
||||
{
|
||||
int m = (x % (2 * src_len));
|
||||
|
||||
x = (x % src_len);
|
||||
if (m >= src_len)
|
||||
{ x = src_len - x - 1; sgn *= -1; }
|
||||
}
|
||||
|
||||
if (sgn < 0)
|
||||
{
|
||||
l = x + 1; x = 0;
|
||||
}
|
||||
else
|
||||
l = src_len - x;
|
||||
|
||||
if (l > dst_len) l = dst_len;
|
||||
func = evas_common_draw_func_copy_get(1, 0);
|
||||
ofunc = evas_common_draw_func_copy_get(1, -1);
|
||||
|
||||
if (sgn > 0)
|
||||
func(src + x, dst, l);
|
||||
else
|
||||
ofunc(src + x, dst, l);
|
||||
if (l == dst_len) return;
|
||||
|
||||
dst += l; dst_len -= l;
|
||||
l = dst_len / src_len;
|
||||
sgn *= -1;
|
||||
while (l--)
|
||||
{
|
||||
if (sgn > 0)
|
||||
func(src, dst, src_len);
|
||||
else
|
||||
ofunc(src, dst, src_len);
|
||||
sgn *= -1;
|
||||
dst += src_len;
|
||||
}
|
||||
l = dst_len % src_len;
|
||||
if (sgn < 0)
|
||||
{
|
||||
src += src_len - l;
|
||||
ofunc(src, dst, l);
|
||||
}
|
||||
else
|
||||
func(src, dst, l);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef BUILD_MMX
|
||||
pxor_r2r(mm0, mm0);
|
||||
MOV_A2R(ALPHA_255, mm5)
|
||||
#endif
|
||||
while (dst < dst_end)
|
||||
{
|
||||
int l = (yy >> 16);
|
||||
int a = 1 + ((yy & 0xffff) >> 8);
|
||||
|
||||
if (l < 0) { l = -l; a = 257 - a; }
|
||||
if (l >= src_len)
|
||||
{
|
||||
int m = (l % (2 * src_len));
|
||||
|
||||
l = (l % src_len);
|
||||
if (m >= src_len)
|
||||
{ l = src_len - l - 1; a = 257 - a; }
|
||||
}
|
||||
#ifdef BUILD_MMX
|
||||
MOV_P2R(src[l], mm1, mm0)
|
||||
#else
|
||||
*dst = src[l];
|
||||
#endif
|
||||
if (l + 1 < src_len)
|
||||
{
|
||||
#ifdef BUILD_MMX
|
||||
INTERP_256_P2R(a, src[l + 1], mm3, mm2, mm1, mm0)
|
||||
#else
|
||||
*dst = INTERP_256(a, src[l + 1], *dst);
|
||||
#endif
|
||||
}
|
||||
#ifdef BUILD_MMX
|
||||
MOV_R2P(mm1, *dst, mm0)
|
||||
#endif
|
||||
dst++; yy += gdata->ayx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
linear_restrict_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Linear_Data *gdata = (Linear_Data *)params_data;
|
||||
int yy;
|
||||
|
||||
evas_common_cpu_end_opt();
|
||||
yy = (gdata->ayx * (x - gdata->fx0 + 0.5)) + (gdata->ayy * (y - gdata->fy0 + 0.5)) - 32768;
|
||||
|
||||
if (gdata->int_axis_aligned && (gdata->ayx == 0))
|
||||
{
|
||||
DATA32 c;
|
||||
|
||||
y = (yy >> 16);
|
||||
if ((y < 0) || (y >= src_len))
|
||||
{
|
||||
memset(dst, 0, sizeof(DATA32) * dst_len);
|
||||
return;
|
||||
}
|
||||
c = src[y];
|
||||
while (dst < dst_end)
|
||||
*dst++ = c;
|
||||
return;
|
||||
}
|
||||
|
||||
if (gdata->int_axis_aligned && (gdata->ayy == 0))
|
||||
{
|
||||
Gfx_Func_Copy func;
|
||||
int sgn;
|
||||
|
||||
x = yy >> 16;
|
||||
sgn = (gdata->ayx < 0 ? -1 : 1);
|
||||
if ((unsigned)x < src_len)
|
||||
{
|
||||
if ((sgn > 0) && ((src_len - x) >= dst_len))
|
||||
{
|
||||
func = evas_common_draw_func_copy_get(dst_len, 0);
|
||||
func(src + x, dst, dst_len);
|
||||
return;
|
||||
}
|
||||
if ((sgn < 0) && (x >= (dst_len - 1)))
|
||||
{
|
||||
func = evas_common_draw_func_copy_get(dst_len, -1);
|
||||
func(src + x - (dst_len - 1), dst, dst_len);
|
||||
return;
|
||||
}
|
||||
}
|
||||
while (dst < dst_end)
|
||||
{
|
||||
*dst = 0;
|
||||
if ((unsigned)x < src_len)
|
||||
*dst = src[x];
|
||||
dst++; x += sgn;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef BUILD_MMX
|
||||
pxor_r2r(mm0, mm0);
|
||||
MOV_A2R(ALPHA_255, mm5)
|
||||
#endif
|
||||
while (dst < dst_end)
|
||||
{
|
||||
int l = (yy >> 16);
|
||||
|
||||
*dst = 0;
|
||||
if ((unsigned)(l + 1) < (src_len + 1))
|
||||
{
|
||||
int a = 1 + ((yy & 0xffff) >> 8);
|
||||
int lp = l;
|
||||
|
||||
if (l == -1) lp = 0;
|
||||
#ifdef BUILD_MMX
|
||||
MOV_P2R(src[lp], mm1, mm0)
|
||||
#else
|
||||
*dst = src[lp];
|
||||
#endif
|
||||
if (lp + 1 < src_len)
|
||||
{
|
||||
#ifdef BUILD_MMX
|
||||
INTERP_256_P2R(a, src[lp + 1], mm3, mm2, mm1, mm0)
|
||||
#else
|
||||
*dst = INTERP_256(a, src[lp + 1], *dst);
|
||||
#endif
|
||||
}
|
||||
if (l == -1)
|
||||
{
|
||||
#ifdef BUILD_MMX
|
||||
MUL_256_A2R(a, mm3, mm1, mm0)
|
||||
#else
|
||||
*dst = MUL_256(a, *dst);
|
||||
#endif
|
||||
}
|
||||
if (l == (src_len - 1))
|
||||
{
|
||||
#ifdef BUILD_MMX
|
||||
a = 257 - a;
|
||||
MUL_256_A2R(a, mm3, mm1, mm0)
|
||||
#else
|
||||
*dst = MUL_256(257 - a, *dst);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef BUILD_MMX
|
||||
MOV_R2P(mm1, *dst, mm0)
|
||||
#endif
|
||||
dst++; yy += gdata->ayx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
linear_restrict_masked_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Linear_Data *gdata = (Linear_Data *)params_data;
|
||||
int yy;
|
||||
|
||||
evas_common_cpu_end_opt();
|
||||
yy = (gdata->ayx * (x - gdata->fx0 + 0.5)) + (gdata->ayy * (y - gdata->fy0 + 0.5)) - 32768;
|
||||
|
||||
#ifdef BUILD_MMX
|
||||
pxor_r2r(mm0, mm0);
|
||||
MOV_A2R(ALPHA_255, mm5)
|
||||
#endif
|
||||
while (dst < dst_end)
|
||||
{
|
||||
int l = (yy >> 16);
|
||||
|
||||
*dst = 0; *mask = 0;
|
||||
if ((unsigned)(l + 1) < (src_len + 1))
|
||||
{
|
||||
int a = 1 + ((yy & 0xffff) >> 8);
|
||||
int lp = l;
|
||||
|
||||
if (l == -1) lp = 0;
|
||||
|
||||
#ifdef BUILD_MMX
|
||||
MOV_P2R(src[lp], mm1, mm0)
|
||||
#else
|
||||
*dst = src[lp]; *mask = 255;
|
||||
#endif
|
||||
if (lp + 1 < src_len)
|
||||
{
|
||||
#ifdef BUILD_MMX
|
||||
INTERP_256_P2R(a, src[lp + 1], mm3, mm2, mm1, mm0)
|
||||
#else
|
||||
*dst = INTERP_256(a, src[lp + 1], *dst);
|
||||
#endif
|
||||
}
|
||||
#ifdef BUILD_MMX
|
||||
MOV_R2P(mm1, *dst, mm0)
|
||||
#endif
|
||||
if (l == -1)
|
||||
*mask = a - 1;
|
||||
if (l == (src_len - 1))
|
||||
*mask = 256 - a;
|
||||
}
|
||||
dst++; mask++; yy += gdata->ayx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
linear_pad_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Linear_Data *gdata = (Linear_Data *)params_data;
|
||||
int yy;
|
||||
|
||||
evas_common_cpu_end_opt();
|
||||
yy = (gdata->ayx * (x - gdata->fx0 + 0.5)) + (gdata->ayy * (y - gdata->fy0 + 0.5)) - 32768;
|
||||
|
||||
#ifdef BUILD_MMX
|
||||
pxor_r2r(mm0, mm0);
|
||||
MOV_A2R(ALPHA_255, mm5)
|
||||
#endif
|
||||
while (dst < dst_end)
|
||||
{
|
||||
int l = (yy >> 16);
|
||||
|
||||
if (l < 0) *dst = src[0];
|
||||
if (l >= src_len) *dst = src[src_len - 1];
|
||||
if ((unsigned)l < src_len)
|
||||
{
|
||||
int a = 1 + ((yy & 0xffff) >> 8);
|
||||
|
||||
#ifdef BUILD_MMX
|
||||
MOV_P2R(src[l], mm1, mm0)
|
||||
#else
|
||||
*dst = src[l];
|
||||
#endif
|
||||
if (l && (l + 1 < src_len))
|
||||
{
|
||||
#ifdef BUILD_MMX
|
||||
INTERP_256_P2R(a, src[l + 1], mm3, mm2, mm1, mm0)
|
||||
#else
|
||||
*dst = INTERP_256(a, src[l + 1], *dst);
|
||||
#endif
|
||||
}
|
||||
#ifdef BUILD_MMX
|
||||
MOV_R2P(mm1, *dst, mm0)
|
||||
#endif
|
||||
}
|
||||
dst++; yy += gdata->ayx;
|
||||
}
|
||||
}
|
|
@ -1,587 +0,0 @@
|
|||
#include "evas_common.h"
|
||||
#include "evas_blend_private.h"
|
||||
#include "evas_private.h"
|
||||
#include <math.h>
|
||||
|
||||
static void _evas_common_gradient2_stops_free(RGBA_Gradient2 *gr);
|
||||
static void _evas_common_gradient2_stops_scale(RGBA_Gradient2 *gr);
|
||||
|
||||
static void _evas_common_gradient2_map_argb(RGBA_Draw_Context *dc, RGBA_Gradient2 *gr, int len);
|
||||
static void _evas_common_gradient2_map_ahsv(RGBA_Draw_Context *dc, RGBA_Gradient2 *gr, int len);
|
||||
|
||||
static int grad_initialised = 0;
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient2_init(void)
|
||||
{
|
||||
RGBA_Gradient2_Type *geom;
|
||||
|
||||
if (grad_initialised)
|
||||
return;
|
||||
geom = evas_common_gradient2_type_linear_get();
|
||||
if (geom)
|
||||
geom->init();
|
||||
geom = evas_common_gradient2_type_radial_get();
|
||||
if (geom)
|
||||
geom->init();
|
||||
grad_initialised = 1;
|
||||
}
|
||||
|
||||
void
|
||||
evas_common_gradient2_shutdown(void)
|
||||
{
|
||||
RGBA_Gradient2_Type *geom;
|
||||
|
||||
if (!grad_initialised)
|
||||
return;
|
||||
geom = evas_common_gradient2_type_linear_get();
|
||||
if (geom)
|
||||
geom->shutdown();
|
||||
geom = evas_common_gradient2_type_radial_get();
|
||||
if (geom)
|
||||
geom->shutdown();
|
||||
grad_initialised = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
_evas_common_gradient2_stops_free(RGBA_Gradient2 *gr)
|
||||
{
|
||||
if (!gr) return;
|
||||
if (gr->stops.stops)
|
||||
{
|
||||
Eina_Inlist *l;
|
||||
|
||||
while (gr->stops.stops)
|
||||
{
|
||||
l = gr->stops.stops;
|
||||
gr->stops.stops = eina_inlist_remove(gr->stops.stops, gr->stops.stops);
|
||||
free(l);
|
||||
}
|
||||
gr->stops.stops = NULL;
|
||||
gr->stops.nstops = 0;
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient2_free(RGBA_Gradient2 *gr)
|
||||
{
|
||||
if (!gr) return;
|
||||
gr->references--;
|
||||
if (gr->references > 0) return;
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
LKL(gr->ref_fq_add); LKL(gr->ref_fq_del);
|
||||
if (gr->ref_fq[0] != gr->ref_fq[1])
|
||||
{
|
||||
LKU(gr->ref_fq_add); LKU(gr->ref_fq_del);
|
||||
return;
|
||||
}
|
||||
LKU(gr->ref_fq_add); LKU(gr->ref_fq_del);
|
||||
#endif
|
||||
evas_common_gradient2_clear(gr);
|
||||
if (gr->stops.cdata) free(gr->stops.cdata);
|
||||
if (gr->stops.adata) free(gr->stops.adata);
|
||||
if (gr->type.geometer && gr->type.gdata)
|
||||
gr->type.geometer->geom_free(gr->type.gdata);
|
||||
if (gr->map.data) free(gr->map.data);
|
||||
free(gr);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient2_clear(RGBA_Gradient2 *gr)
|
||||
{
|
||||
if (!gr) return;
|
||||
|
||||
_evas_common_gradient2_stops_free(gr);
|
||||
gr->has_alpha = 0;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient2_color_np_stop_insert(RGBA_Gradient2 *gr, int r, int g, int b, int a, float pos)
|
||||
{
|
||||
RGBA_Gradient2_Color_Np_Stop *gc;
|
||||
Eina_Inlist *l;
|
||||
|
||||
if (!gr) return;
|
||||
if (!gr->stops.stops)
|
||||
{
|
||||
RGBA_Gradient2_Color_Np_Stop *gc1;
|
||||
|
||||
gc = malloc(sizeof(RGBA_Gradient2_Color_Np_Stop));
|
||||
if (!gc) return;
|
||||
gc1 = malloc(sizeof(RGBA_Gradient2_Color_Np_Stop));
|
||||
if (!gc1) { free(gc); return; }
|
||||
gc->r = gc->g = gc->b = gc->a = 255; gc->pos = 0.0; gc->dist = 0;
|
||||
gc1->r = gc1->g = gc1->b = gc1->a = 255; gc1->pos = 1.0; gc1->dist = 0;
|
||||
|
||||
gr->stops.stops = eina_inlist_append(gr->stops.stops, EINA_INLIST_GET(gc));
|
||||
gr->stops.stops = eina_inlist_append(gr->stops.stops, EINA_INLIST_GET(gc1));
|
||||
gr->stops.nstops = 2;
|
||||
gr->stops.len = 0;
|
||||
}
|
||||
|
||||
if (r < 0) r = 0; if (r > 255) r = 255;
|
||||
if (g < 0) g = 0; if (g > 255) g = 255;
|
||||
if (b < 0) b = 0; if (b > 255) b = 255;
|
||||
if (a < 0) a = 0; if (a > 255) a = 255;
|
||||
if (pos < 0.0) pos = 0.0;
|
||||
if (pos > 1.0) pos = 1.0;
|
||||
|
||||
if (pos == 0.0)
|
||||
{
|
||||
gc = (RGBA_Gradient2_Color_Np_Stop *)gr->stops.stops;
|
||||
gc->r = r; gc->g = g; gc->b = b; gc->a = a; gc->dist = 0;
|
||||
if (a < 255) gr->has_alpha = 1;
|
||||
return;
|
||||
}
|
||||
if (pos == 1.0)
|
||||
{
|
||||
gc = (RGBA_Gradient2_Color_Np_Stop *)(gr->stops.stops->last);
|
||||
gc->r = r; gc->g = g; gc->b = b; gc->a = a; gc->dist = 0;
|
||||
if (a < 255) gr->has_alpha = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
l = gr->stops.stops->next;
|
||||
while (l)
|
||||
{
|
||||
gc = (RGBA_Gradient2_Color_Np_Stop *)l;
|
||||
if (pos <= gc->pos)
|
||||
{
|
||||
if (pos == gc->pos)
|
||||
{
|
||||
gc->r = r; gc->g = g; gc->b = b; gc->a = a; gc->dist = 0;
|
||||
if (a < 255) gr->has_alpha = 1;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
l = l->next;
|
||||
}
|
||||
|
||||
gc = malloc(sizeof(RGBA_Gradient2_Color_Np_Stop));
|
||||
if (!gc) return;
|
||||
gc->r = r;
|
||||
gc->g = g;
|
||||
gc->b = b;
|
||||
gc->a = a;
|
||||
gc->pos = pos;
|
||||
gc->dist = 0;
|
||||
|
||||
gr->stops.stops = eina_inlist_prepend_relative(gr->stops.stops, EINA_INLIST_GET(gc), l);
|
||||
gr->stops.nstops++;
|
||||
if (a < 255)
|
||||
gr->has_alpha = 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient2_fill_transform_set(RGBA_Gradient2 *gr, Evas_Common_Transform *t)
|
||||
{
|
||||
if (!gr) return;
|
||||
if (!t)
|
||||
{
|
||||
gr->fill.transform.mxx = 1; gr->fill.transform.mxy = 0; gr->fill.transform.mxz = 0;
|
||||
gr->fill.transform.myx = 0; gr->fill.transform.myy = 1; gr->fill.transform.myz = 0;
|
||||
gr->fill.transform.mzx = 1; gr->fill.transform.mzy = 0; gr->fill.transform.mzz = 1;
|
||||
return;
|
||||
}
|
||||
gr->fill.transform.mxx = t->mxx; gr->fill.transform.mxy = t->mxy; gr->fill.transform.mxz = t->mxz;
|
||||
gr->fill.transform.myx = t->myx; gr->fill.transform.myy = t->myy; gr->fill.transform.myz = t->myz;
|
||||
gr->fill.transform.mzx = t->mzx; gr->fill.transform.mzy = t->mzy; gr->fill.transform.mzz = t->mzz;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient2_fill_spread_set(RGBA_Gradient2 *gr, int spread)
|
||||
{
|
||||
if (!gr) return;
|
||||
gr->fill.spread = spread;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient2_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
|
||||
int x, int y, int w, int h, RGBA_Gradient2 *gr)
|
||||
{
|
||||
Gfx_Func_Gradient2_Fill gfunc;
|
||||
RGBA_Gfx_Func bfunc = NULL;
|
||||
int len;
|
||||
int xin, yin, xoff, yoff;
|
||||
int clx, cly, clw, clh;
|
||||
DATA32 *pdst, *dst_end, *buf, *map;
|
||||
RGBA_Image *argb_buf = NULL, *alpha_buf = NULL;
|
||||
DATA8 *mask = NULL;
|
||||
void *gdata;
|
||||
int direct_copy = 0, buf_step = 0;
|
||||
|
||||
if (!dst || !dc || !gr || !dst || !dst->image.data)
|
||||
return;
|
||||
if (!gr->map.data || !gr->type.geometer)
|
||||
return;
|
||||
if ((w < 1) || (h < 1))
|
||||
return;
|
||||
clx = 0; cly = 0; clw = dst->cache_entry.w; clh = dst->cache_entry.h;
|
||||
if ((clw < 1) || (clh < 1)) return;
|
||||
|
||||
if (dc->clip.use)
|
||||
RECTS_CLIP_TO_RECT(clx,cly,clw,clh, dc->clip.x,dc->clip.y,dc->clip.w,dc->clip.h);
|
||||
if ((clw < 1) || (clh < 1)) return;
|
||||
|
||||
xin = x; yin = y;
|
||||
RECTS_CLIP_TO_RECT(x,y,w,h, clx,cly,clw,clh);
|
||||
if ((w < 1) || (h < 1)) return;
|
||||
|
||||
xoff = (x - xin);
|
||||
yoff = (y - yin);
|
||||
|
||||
if (!gr->type.geometer->has_mask(gr, dc->render_op))
|
||||
{
|
||||
if ((dc->render_op == _EVAS_RENDER_FILL) ||
|
||||
(dc->render_op == _EVAS_RENDER_COPY))
|
||||
{
|
||||
direct_copy = 1; buf_step = dst->cache_entry.w;
|
||||
if (gr->type.geometer->has_alpha(gr, dc->render_op))
|
||||
dst->cache_entry.flags.alpha = 1;
|
||||
}
|
||||
else if ((dc->render_op == _EVAS_RENDER_BLEND) &&
|
||||
!gr->type.geometer->has_alpha(gr, dc->render_op))
|
||||
{
|
||||
direct_copy = 1; buf_step = dst->cache_entry.w;
|
||||
}
|
||||
}
|
||||
if (!direct_copy)
|
||||
{
|
||||
argb_buf = evas_common_image_line_buffer_obtain(w);
|
||||
if (!argb_buf)
|
||||
return;
|
||||
argb_buf->cache_entry.flags.alpha = gr->type.geometer->has_alpha(gr, dc->render_op) ? 1 : 0;
|
||||
|
||||
if (gr->type.geometer->has_mask(gr, dc->render_op))
|
||||
{
|
||||
alpha_buf = evas_common_image_alpha_line_buffer_obtain(w);
|
||||
if (!alpha_buf)
|
||||
{
|
||||
evas_common_image_line_buffer_release(argb_buf);
|
||||
return;
|
||||
}
|
||||
bfunc = evas_common_gfx_func_composite_pixel_mask_span_get(argb_buf, dst, w, dc->render_op);
|
||||
}
|
||||
else
|
||||
bfunc = evas_common_gfx_func_composite_pixel_span_get(argb_buf, dst, w, dc->render_op);
|
||||
}
|
||||
|
||||
gfunc = gr->type.geometer->get_fill_func(gr, dc->render_op);
|
||||
gdata = gr->type.gdata;
|
||||
if (!gdata)
|
||||
{
|
||||
if (!direct_copy)
|
||||
{
|
||||
evas_common_image_line_buffer_release(argb_buf);
|
||||
if (alpha_buf)
|
||||
evas_common_image_alpha_line_buffer_release(alpha_buf);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
map = gr->map.data;
|
||||
len = gr->map.len;
|
||||
pdst = dst->image.data + (y * dst->cache_entry.w) + x;
|
||||
dst_end = pdst + (h * dst->cache_entry.w);
|
||||
if (!direct_copy)
|
||||
{
|
||||
buf = argb_buf->image.data;
|
||||
if (alpha_buf)
|
||||
mask = (DATA8 *)alpha_buf->image.data;
|
||||
}
|
||||
else
|
||||
buf = pdst;
|
||||
|
||||
while (pdst < dst_end)
|
||||
{
|
||||
#ifdef EVAS_SLI
|
||||
if ((y % dc->sli.h) == dc->sli.y)
|
||||
#endif
|
||||
{
|
||||
gfunc(map, len, buf, mask, w, xoff, yoff, gdata);
|
||||
if (!direct_copy)
|
||||
bfunc(buf, mask, 0, pdst, w);
|
||||
}
|
||||
buf += buf_step;
|
||||
pdst += dst->cache_entry.w;
|
||||
yoff++;
|
||||
#ifdef EVAS_SLI
|
||||
y++;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!direct_copy)
|
||||
{
|
||||
evas_common_image_line_buffer_release(argb_buf);
|
||||
if (alpha_buf)
|
||||
evas_common_image_alpha_line_buffer_release(alpha_buf);
|
||||
}
|
||||
evas_common_cpu_end_opt();
|
||||
}
|
||||
|
||||
static void
|
||||
_evas_common_gradient2_stops_scale(RGBA_Gradient2 *gr)
|
||||
{
|
||||
Eina_Inlist *l;
|
||||
RGBA_Gradient2_Color_Np_Stop *gc, *gc_next;
|
||||
double scale;
|
||||
int len;
|
||||
|
||||
if (!gr || !gr->stops.stops) return;
|
||||
|
||||
scale = 1.0;
|
||||
gc = (RGBA_Gradient2_Color_Np_Stop *)gr->stops.stops;
|
||||
l = gr->stops.stops->next;
|
||||
while (l)
|
||||
{
|
||||
double dp;
|
||||
|
||||
gc_next = (RGBA_Gradient2_Color_Np_Stop *)l;
|
||||
dp = gc_next->pos - gc->pos;
|
||||
if (dp > 0.000030517)
|
||||
scale = MIN(scale, dp);
|
||||
gc = gc_next;
|
||||
l = l->next;
|
||||
}
|
||||
|
||||
scale = 2.0 / scale;
|
||||
len = 1;
|
||||
gc = (RGBA_Gradient2_Color_Np_Stop *)gr->stops.stops;
|
||||
l = gr->stops.stops->next;
|
||||
while (l)
|
||||
{
|
||||
int dist;
|
||||
|
||||
gc_next = (RGBA_Gradient2_Color_Np_Stop *)l;
|
||||
dist = 0.5 + (scale * (gc_next->pos - gc->pos));
|
||||
if (dist < 1)
|
||||
dist = 1;
|
||||
len += dist;
|
||||
gc->dist = dist;
|
||||
gc = gc_next;
|
||||
l = l->next;
|
||||
}
|
||||
|
||||
if (len > 65535)
|
||||
len = 65535;
|
||||
gr->stops.len = len;
|
||||
}
|
||||
|
||||
static void
|
||||
_evas_common_gradient2_map_argb(RGBA_Draw_Context *dc, RGBA_Gradient2 *gr, int len)
|
||||
{
|
||||
if (!gr || !dc)
|
||||
return;
|
||||
if ((len < 1) || (len > 65535))
|
||||
{
|
||||
if (gr->map.data)
|
||||
free(gr->map.data);
|
||||
gr->map.data = NULL;
|
||||
gr->map.len = 0;
|
||||
return;
|
||||
}
|
||||
if ((len != gr->map.len) || (!gr->map.data))
|
||||
gr->map.data = realloc(gr->map.data, len * sizeof(DATA32));
|
||||
if (!gr->map.data)
|
||||
{ gr->map.len = 0; return; }
|
||||
gr->map.len = len;
|
||||
gr->map.has_alpha = gr->has_alpha;
|
||||
|
||||
if (!gr->stops.stops) return;
|
||||
|
||||
_evas_common_gradient2_stops_scale(gr);
|
||||
|
||||
{
|
||||
Eina_Inlist *lc;
|
||||
RGBA_Gradient2_Color_Np_Stop *gc, *gc_next;
|
||||
DATA32 *pmap, *map_end;
|
||||
DATA8 *pamap = NULL;
|
||||
int i, dii;
|
||||
int r, g, b, a;
|
||||
int next_r, next_g, next_b, next_a;
|
||||
int rr, drr, gg, dgg, bb, dbb, aa, daa;
|
||||
|
||||
gr->stops.cdata = realloc(gr->stops.cdata, gr->stops.len * sizeof(DATA32));
|
||||
if (!gr->stops.cdata) return;
|
||||
pmap = gr->stops.cdata; map_end = pmap + gr->stops.len;
|
||||
|
||||
if (gr->has_alpha)
|
||||
{
|
||||
gr->stops.adata = realloc(gr->stops.adata, gr->stops.len * sizeof(DATA8));
|
||||
if (!gr->stops.adata)
|
||||
{ free(gr->stops.cdata); gr->stops.cdata = NULL; return; }
|
||||
pamap = gr->stops.adata;
|
||||
}
|
||||
|
||||
gc = (RGBA_Gradient2_Color_Np_Stop *)gr->stops.stops;
|
||||
r = gc->r; g = gc->g; b = gc->b; a = gc->a;
|
||||
lc = gr->stops.stops->next;
|
||||
|
||||
while (pmap < map_end)
|
||||
{
|
||||
if (lc)
|
||||
{
|
||||
i = gc->dist;
|
||||
dii = 65536 / i;
|
||||
gc_next = (RGBA_Gradient2_Color_Np_Stop *)lc;
|
||||
next_r = gc_next->r; next_g = gc_next->g; next_b = gc_next->b; next_a = gc_next->a;
|
||||
rr = r << 16; drr = ((next_r - r) * dii);
|
||||
gg = g << 16; dgg = ((next_g - g) * dii);
|
||||
bb = b << 16; dbb = ((next_b - b) * dii);
|
||||
aa = a << 16; daa = ((next_a - a) * dii);
|
||||
while (i--)
|
||||
{
|
||||
r = rr >> 16; r += (rr - (r << 16)) >> 15;
|
||||
g = gg >> 16; g += (gg - (g << 16)) >> 15;
|
||||
b = bb >> 16; b += (bb - (b << 16)) >> 15;
|
||||
*pmap++ = 0xff000000 + RGB_JOIN(r,g,b);
|
||||
if (pamap)
|
||||
{
|
||||
a = aa >> 16; a += (aa - (a << 16)) >> 15;
|
||||
*pamap++ = a;
|
||||
aa += daa;
|
||||
}
|
||||
rr += drr; gg += dgg; bb += dbb;
|
||||
}
|
||||
gc = gc_next;
|
||||
r = next_r; g = next_g; b = next_b; a = next_a;
|
||||
lc = lc->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pmap++ = 0xff000000 + RGB_JOIN(gc->r,gc->g,gc->b);
|
||||
if (pamap) *pamap++ = gc->a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gr->stops.cdata && gr->stops.adata)
|
||||
{
|
||||
evas_common_scale_rgba_a8_span(gr->stops.cdata, gr->stops.adata, gr->stops.len,
|
||||
dc->mul.col, gr->map.data, gr->map.len, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
evas_common_scale_rgba_span(gr->stops.cdata, NULL, gr->stops.len,
|
||||
dc->mul.col, gr->map.data, gr->map.len, 1);
|
||||
gr->map.has_alpha |= (!!(255 - (dc->mul.col >> 24)));
|
||||
}
|
||||
|
||||
static void
|
||||
_evas_common_gradient2_map_ahsv(RGBA_Draw_Context *dc, RGBA_Gradient2 *gr, int len)
|
||||
{
|
||||
if (!gr || !dc)
|
||||
return;
|
||||
if ((len < 1) || (len > 65535))
|
||||
{
|
||||
if (gr->map.data)
|
||||
free(gr->map.data);
|
||||
gr->map.data = NULL;
|
||||
gr->map.len = 0;
|
||||
return;
|
||||
}
|
||||
if ((len != gr->map.len) || (!gr->map.data))
|
||||
gr->map.data = realloc(gr->map.data, len * sizeof(DATA32));
|
||||
if (!gr->map.data)
|
||||
{ gr->map.len = 0; return; }
|
||||
gr->map.len = len;
|
||||
gr->map.has_alpha = gr->has_alpha;
|
||||
|
||||
if (!gr->stops.stops) return;
|
||||
|
||||
_evas_common_gradient2_stops_scale(gr);
|
||||
|
||||
{
|
||||
Eina_Inlist *lc;
|
||||
RGBA_Gradient2_Color_Np_Stop *gc, *gc_next;
|
||||
DATA32 *pmap, *map_end;
|
||||
DATA8 *pamap = NULL;
|
||||
int i, dii;
|
||||
int h, s, v;
|
||||
int next_h, next_s, next_v;
|
||||
int hh, dhh, ss, dss, vv, dvv, aa, daa;
|
||||
int r, g, b, a;
|
||||
int next_r, next_g, next_b, next_a;
|
||||
|
||||
gr->stops.cdata = realloc(gr->stops.cdata, gr->stops.len * sizeof(DATA32));
|
||||
if (!gr->stops.cdata) return;
|
||||
pmap = gr->stops.cdata; map_end = pmap + gr->stops.len;
|
||||
|
||||
if (gr->has_alpha)
|
||||
{
|
||||
gr->stops.adata = realloc(gr->stops.adata, gr->stops.len * sizeof(DATA8));
|
||||
if (!gr->stops.adata)
|
||||
{ free(gr->stops.cdata); gr->stops.cdata = NULL; return; }
|
||||
pamap = gr->stops.adata;
|
||||
}
|
||||
|
||||
gc = (RGBA_Gradient2_Color_Np_Stop *)gr->stops.stops;
|
||||
r = gc->r; g = gc->g; b = gc->b; a = gc->a;
|
||||
evas_common_convert_color_rgb_to_hsv_int(r, g, b, &h, &s, &v);
|
||||
lc = gr->stops.stops->next;
|
||||
|
||||
while (pmap < map_end)
|
||||
{
|
||||
if (lc)
|
||||
{
|
||||
i = gc->dist;
|
||||
dii = 65536 / i;
|
||||
gc_next = (RGBA_Gradient2_Color_Np_Stop *)lc;
|
||||
|
||||
next_r = gc_next->r; next_g = gc_next->g; next_b = gc_next->b; next_a = gc_next->a;
|
||||
evas_common_convert_color_rgb_to_hsv_int(next_r, next_g, next_b,
|
||||
&next_h, &next_s, &next_v);
|
||||
hh = h << 16; dhh = ((next_h - h) * dii);
|
||||
ss = s << 16; dss = ((next_s - s) * dii);
|
||||
vv = v << 16; dvv = ((next_v - v) * dii);
|
||||
aa = a << 16; daa = ((next_a - a) * dii);
|
||||
while (i--)
|
||||
{
|
||||
h = hh >> 16; h += (hh - (h << 16)) >> 15;
|
||||
s = ss >> 16; s += (ss - (s << 16)) >> 15;
|
||||
v = vv >> 16; v += (vv - (v << 16)) >> 15;
|
||||
evas_common_convert_color_hsv_to_rgb_int(h, s, v, &r, &g, &b);
|
||||
*pmap++ = 0xff000000 + RGB_JOIN(r,g,b);
|
||||
if (pamap)
|
||||
{
|
||||
a = aa >> 16; a += (aa - (a << 16)) >> 15;
|
||||
*pamap++ = a;
|
||||
aa += daa;
|
||||
}
|
||||
hh += dhh; ss += dss; vv += dvv;
|
||||
}
|
||||
gc = gc_next;
|
||||
h = next_h; s = next_s; v = next_v; a = next_a;
|
||||
lc = lc->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pmap++ = 0xff000000 + RGB_JOIN(gc->r,gc->g,gc->b);
|
||||
if (pamap) *pamap++ = gc->a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gr->stops.cdata && gr->stops.adata)
|
||||
{
|
||||
evas_common_scale_hsva_a8_span(gr->stops.cdata, gr->stops.adata, gr->stops.len,
|
||||
dc->mul.col, gr->map.data, gr->map.len, 1);
|
||||
return;
|
||||
}
|
||||
evas_common_scale_hsva_span(gr->stops.cdata, NULL, gr->stops.len,
|
||||
dc->mul.col, gr->map.data, gr->map.len, 1);
|
||||
gr->map.has_alpha |= (!!(255 - (dc->mul.col >> 24)));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient2_map(RGBA_Draw_Context *dc, RGBA_Gradient2 *gr, int len)
|
||||
{
|
||||
if (!gr || !dc) return;
|
||||
if (dc->interpolation.color_space == _EVAS_COLOR_SPACE_AHSV)
|
||||
{
|
||||
_evas_common_gradient2_map_ahsv(dc, gr, len);
|
||||
return;
|
||||
}
|
||||
_evas_common_gradient2_map_argb(dc, gr, len);
|
||||
}
|
|
@ -1,456 +0,0 @@
|
|||
#include "evas_common.h"
|
||||
#include "evas_private.h"
|
||||
#include <math.h>
|
||||
|
||||
#define RADIAL_EPSILON 0.000030517578125
|
||||
|
||||
typedef struct _Radial_Data Radial_Data;
|
||||
|
||||
struct _Radial_Data
|
||||
{
|
||||
int axx, axy;
|
||||
int ayx, ayy;
|
||||
float cx, cy, rx, ry;
|
||||
float cx0, cy0;
|
||||
int len;
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
radial_init(void);
|
||||
|
||||
static void
|
||||
radial_shutdown(void);
|
||||
|
||||
static void
|
||||
radial_init_geom(RGBA_Gradient2 *gr);
|
||||
|
||||
static void
|
||||
radial_update_geom(RGBA_Gradient2 *gr);
|
||||
|
||||
static void
|
||||
radial_free_geom(void *gdata);
|
||||
|
||||
static int
|
||||
radial_has_alpha(RGBA_Gradient2 *gr, int op);
|
||||
|
||||
static int
|
||||
radial_has_mask(RGBA_Gradient2 *gr, int op);
|
||||
|
||||
static int
|
||||
radial_get_map_len(RGBA_Gradient2 *gr);
|
||||
|
||||
static Gfx_Func_Gradient2_Fill
|
||||
radial_get_fill_func(RGBA_Gradient2 *gr, int op);
|
||||
|
||||
static RGBA_Gradient2_Type radial = {"radial", radial_init, radial_shutdown,
|
||||
radial_init_geom,
|
||||
radial_update_geom, radial_free_geom,
|
||||
radial_has_alpha, radial_has_mask,
|
||||
radial_get_map_len, radial_get_fill_func};
|
||||
|
||||
|
||||
EAPI RGBA_Gradient2_Type *
|
||||
evas_common_gradient2_type_radial_get(void)
|
||||
{
|
||||
return &radial;
|
||||
}
|
||||
|
||||
EAPI RGBA_Gradient2 *
|
||||
evas_common_gradient2_radial_new(void)
|
||||
{
|
||||
RGBA_Gradient2 *gr;
|
||||
|
||||
gr = calloc(1, sizeof(RGBA_Gradient2));
|
||||
if (!gr) return NULL;
|
||||
gr->references = 1;
|
||||
gr->type.id = MAGIC_OBJ_GRADIENT_RADIAL;
|
||||
gr->type.geometer = &radial;
|
||||
radial_init_geom(gr);
|
||||
return gr;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient2_radial_fill_set(RGBA_Gradient2 *gr, float cx, float cy, float rx, float ry)
|
||||
{
|
||||
Radial_Data *radial_data;
|
||||
|
||||
if (!gr) return;
|
||||
if (gr->type.id != MAGIC_OBJ_GRADIENT_RADIAL) return;
|
||||
if (gr->type.geometer != &radial) return;
|
||||
radial_data = (Radial_Data *)gr->type.gdata;
|
||||
if (!radial_data) return;
|
||||
if (rx < 0) rx = -rx; if (ry < 0) ry = -ry;
|
||||
radial_data->cx = cx; radial_data->cy = cy;
|
||||
radial_data->rx = 1 + rx; radial_data->ry = 1 + ry;
|
||||
}
|
||||
|
||||
|
||||
/** internal functions **/
|
||||
|
||||
static void
|
||||
radial_reflect_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, void *params_data);
|
||||
|
||||
static void
|
||||
radial_repeat_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, void *params_data);
|
||||
|
||||
static void
|
||||
radial_restrict_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, void *params_data);
|
||||
|
||||
static void
|
||||
radial_restrict_masked_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, void *params_data);
|
||||
|
||||
static void
|
||||
radial_pad_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, void *params_data);
|
||||
|
||||
|
||||
static void
|
||||
radial_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
radial_shutdown(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
radial_free_geom(void *gdata)
|
||||
{
|
||||
Radial_Data *data = (Radial_Data *)gdata;
|
||||
if (data) free(data);
|
||||
}
|
||||
|
||||
static void
|
||||
radial_init_geom(RGBA_Gradient2 *gr)
|
||||
{
|
||||
Radial_Data *radial_data;
|
||||
|
||||
if (!gr || (gr->type.geometer != &radial)) return;
|
||||
|
||||
radial_data = (Radial_Data *)gr->type.gdata;
|
||||
if (!radial_data)
|
||||
{
|
||||
radial_data = calloc(1, sizeof(Radial_Data));
|
||||
if (!radial_data) return;
|
||||
radial_data->cx = radial_data->cy = 0;
|
||||
radial_data->rx = radial_data->ry = 0;
|
||||
radial_data->axx = 65536; radial_data->axy = 0;
|
||||
radial_data->ayx = 0; radial_data->ayy = 65536;
|
||||
radial_data->len = 0;
|
||||
}
|
||||
gr->type.gdata = radial_data;
|
||||
}
|
||||
|
||||
static void
|
||||
radial_update_geom(RGBA_Gradient2 *gr)
|
||||
{
|
||||
Radial_Data *radial_data;
|
||||
double f, flen;
|
||||
double fx1, fy1;
|
||||
int len;
|
||||
|
||||
if (!gr || (gr->type.geometer != &radial)) return;
|
||||
|
||||
radial_data = (Radial_Data *)gr->type.gdata;
|
||||
if (!radial_data) return;
|
||||
|
||||
if ((radial_data->rx < RADIAL_EPSILON) || (radial_data->ry < RADIAL_EPSILON)) return;
|
||||
|
||||
radial_data->len = 0;
|
||||
f = (gr->fill.transform.mxx * (double)gr->fill.transform.myy) - (gr->fill.transform.mxy * (double)gr->fill.transform.myx);
|
||||
if (fabs(f) < RADIAL_EPSILON) return;
|
||||
|
||||
f = 1.0 / f;
|
||||
radial_data->cx0 = (((gr->fill.transform.myy * (double)radial_data->cx) - (gr->fill.transform.mxy * (double)radial_data->cy)) * f) - gr->fill.transform.mxz;
|
||||
radial_data->cy0 = ((-(gr->fill.transform.myx * (double)radial_data->cx) + (gr->fill.transform.mxx * (double)radial_data->cy)) * f) - gr->fill.transform.myz;
|
||||
|
||||
fx1 = (gr->fill.transform.myy * (double)radial_data->rx) * f;
|
||||
fy1 = (gr->fill.transform.myx * (double)radial_data->rx) * f;
|
||||
|
||||
flen = hypot(fx1, fy1);
|
||||
|
||||
fx1 = (gr->fill.transform.mxy * (double)radial_data->ry) * f;
|
||||
fy1 = (gr->fill.transform.mxx * (double)radial_data->ry) * f;
|
||||
|
||||
flen = sqrt(flen * hypot(fx1, fy1));
|
||||
|
||||
radial_data->len = len = flen + 0.5;
|
||||
if (!len) return;
|
||||
|
||||
radial_data->axx = (((double)gr->fill.transform.mxx * 65536) * flen) / radial_data->rx;
|
||||
radial_data->axy = (((double)gr->fill.transform.mxy * 65536) * flen) / radial_data->rx;
|
||||
|
||||
radial_data->ayx = (((double)gr->fill.transform.myx * 65536) * flen) / radial_data->ry;
|
||||
radial_data->ayy = (((double)gr->fill.transform.myy * 65536) * flen) / radial_data->ry;
|
||||
}
|
||||
|
||||
static int
|
||||
radial_has_alpha(RGBA_Gradient2 *gr, int op)
|
||||
{
|
||||
Radial_Data *radial_data;
|
||||
|
||||
if (!gr || (gr->type.geometer != &radial)) return 0;
|
||||
if (gr->has_alpha | gr->map.has_alpha)
|
||||
return 1;
|
||||
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
|
||||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
|
||||
return 0;
|
||||
radial_data = (Radial_Data *)gr->type.gdata;
|
||||
if (!radial_data) return 0;
|
||||
if (gr->fill.spread == _EVAS_TEXTURE_RESTRICT)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
radial_has_mask(RGBA_Gradient2 *gr, int op)
|
||||
{
|
||||
Radial_Data *radial_data;
|
||||
|
||||
if (!gr || (gr->type.geometer != &radial)) return 0;
|
||||
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
|
||||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
|
||||
{
|
||||
radial_data = (Radial_Data *)gr->type.gdata;
|
||||
if (!radial_data) return 0;
|
||||
if (gr->fill.spread == _EVAS_TEXTURE_RESTRICT)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
radial_get_map_len(RGBA_Gradient2 *gr)
|
||||
{
|
||||
Radial_Data *radial_data;
|
||||
|
||||
if (!gr || (gr->type.geometer != &radial)) return 0;
|
||||
radial_data = (Radial_Data *)gr->type.gdata;
|
||||
if (!radial_data) return 0;
|
||||
return radial_data->len;
|
||||
}
|
||||
|
||||
static Gfx_Func_Gradient2_Fill
|
||||
radial_get_fill_func(RGBA_Gradient2 *gr, int op)
|
||||
{
|
||||
Radial_Data *radial_data;
|
||||
Gfx_Func_Gradient2_Fill sfunc = NULL;
|
||||
int masked_op = 0;
|
||||
|
||||
if (!gr || (gr->type.geometer != &radial)) return sfunc;
|
||||
radial_data = (Radial_Data *)gr->type.gdata;
|
||||
if (!radial_data) return sfunc;
|
||||
|
||||
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
|
||||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
|
||||
masked_op = 1;
|
||||
|
||||
switch (gr->fill.spread)
|
||||
{
|
||||
case _EVAS_TEXTURE_REPEAT:
|
||||
sfunc = radial_repeat_aa;
|
||||
break;
|
||||
case _EVAS_TEXTURE_REFLECT:
|
||||
sfunc = radial_reflect_aa;
|
||||
break;
|
||||
case _EVAS_TEXTURE_RESTRICT:
|
||||
if (masked_op)
|
||||
sfunc = radial_restrict_masked_aa;
|
||||
else
|
||||
sfunc = radial_restrict_aa;
|
||||
break;
|
||||
case _EVAS_TEXTURE_PAD:
|
||||
sfunc = radial_pad_aa;
|
||||
break;
|
||||
default:
|
||||
sfunc = radial_repeat_aa;
|
||||
break;
|
||||
}
|
||||
return sfunc;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
radial_repeat_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Radial_Data *gdata = (Radial_Data *)params_data;
|
||||
int xx, yy;
|
||||
|
||||
evas_common_cpu_end_opt();
|
||||
xx = (gdata->axx * (x - gdata->cx0 + 0.5)) + (gdata->axy * (y - gdata->cy0 + 0.5));
|
||||
yy = (gdata->ayx * (x - gdata->cx0 + 0.5)) + (gdata->ayy * (y - gdata->cy0 + 0.5));
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
unsigned int ll = hypot(xx, yy);
|
||||
unsigned int l = (ll >> 16);
|
||||
int a = 1 + ((ll & 0xffff) >> 8);
|
||||
|
||||
if (l >= src_len)
|
||||
l = l % src_len;
|
||||
*dst = src[l];
|
||||
if (l + 1 < src_len)
|
||||
{
|
||||
*dst = INTERP_256(a, src[l + 1], *dst);
|
||||
}
|
||||
if (l == (src_len - 1))
|
||||
{
|
||||
*dst = INTERP_256(a, src[0], *dst);
|
||||
}
|
||||
dst++; xx += gdata->axx; yy += gdata->ayx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
radial_reflect_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Radial_Data *gdata = (Radial_Data *)params_data;
|
||||
int xx, yy;
|
||||
|
||||
evas_common_cpu_end_opt();
|
||||
xx = (gdata->axx * (x - gdata->cx0 + 0.5)) + (gdata->axy * (y - gdata->cy0 + 0.5));
|
||||
yy = (gdata->ayx * (x - gdata->cx0 + 0.5)) + (gdata->ayy * (y - gdata->cy0 + 0.5));
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
unsigned int ll = hypot(xx, yy);
|
||||
unsigned int l = (ll >> 16);
|
||||
int a = 1 + ((ll & 0xffff) >> 8);
|
||||
|
||||
if (l >= src_len)
|
||||
{
|
||||
int m = (l % (2 * src_len));
|
||||
|
||||
l = (l % src_len);
|
||||
if (m >= src_len)
|
||||
{ l = src_len - l - 1; a = 257 - a; }
|
||||
}
|
||||
*dst = src[l];
|
||||
if (l + 1 < src_len)
|
||||
*dst = INTERP_256(a, src[l + 1], *dst);
|
||||
|
||||
dst++; xx += gdata->axx; yy += gdata->ayx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
radial_restrict_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Radial_Data *gdata = (Radial_Data *)params_data;
|
||||
int xx, yy;
|
||||
|
||||
evas_common_cpu_end_opt();
|
||||
xx = (gdata->axx * (x - gdata->cx0 + 0.5)) + (gdata->axy * (y - gdata->cy0 + 0.5));
|
||||
yy = (gdata->ayx * (x - gdata->cx0 + 0.5)) + (gdata->ayy * (y - gdata->cy0 + 0.5));
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
unsigned int ll = hypot(xx, yy);
|
||||
unsigned int l = (ll >> 16);
|
||||
|
||||
*dst = 0;
|
||||
if (l < src_len)
|
||||
{
|
||||
int a = 1 + ((ll & 0xffff) >> 8);
|
||||
|
||||
*dst = src[l];
|
||||
if (l + 1 < src_len)
|
||||
*dst = INTERP_256(a, src[l + 1], *dst);
|
||||
if (l == (src_len - 1))
|
||||
{
|
||||
*dst = INTERP_256(a, src[0], *dst);
|
||||
*dst = MUL_256(257 - a, *dst);
|
||||
}
|
||||
}
|
||||
dst++; xx += gdata->axx; yy += gdata->ayx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
radial_restrict_masked_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Radial_Data *gdata = (Radial_Data *)params_data;
|
||||
int xx, yy;
|
||||
|
||||
evas_common_cpu_end_opt();
|
||||
xx = (gdata->axx * (x - gdata->cx0 + 0.5)) + (gdata->axy * (y - gdata->cy0 + 0.5));
|
||||
yy = (gdata->ayx * (x - gdata->cx0 + 0.5)) + (gdata->ayy * (y - gdata->cy0 + 0.5));
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
unsigned int ll = hypot(xx, yy);
|
||||
unsigned int l = (ll >> 16);
|
||||
|
||||
*dst = 0; *mask = 0;
|
||||
if (l < src_len)
|
||||
{
|
||||
int a = 1 + ((ll & 0xffff) >> 8);
|
||||
|
||||
*dst = src[l]; *mask = 255;
|
||||
if (l + 1 < src_len)
|
||||
*dst = INTERP_256(a, src[l + 1], *dst);
|
||||
if (l == (src_len - 1))
|
||||
{
|
||||
*dst = INTERP_256(a, src[0], *dst);
|
||||
*mask = 256 - a;
|
||||
}
|
||||
}
|
||||
dst++; mask++; xx += gdata->axx; yy += gdata->ayx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
radial_pad_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Radial_Data *gdata = (Radial_Data *)params_data;
|
||||
int xx, yy;
|
||||
|
||||
evas_common_cpu_end_opt();
|
||||
xx = (gdata->axx * (x - gdata->cx0 + 0.5)) + (gdata->axy * (y - gdata->cy0 + 0.5));
|
||||
yy = (gdata->ayx * (x - gdata->cx0 + 0.5)) + (gdata->ayy * (y - gdata->cy0 + 0.5));
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
unsigned int ll = hypot(xx, yy);
|
||||
unsigned int l = (ll >> 16);
|
||||
|
||||
*dst = 0;
|
||||
if (l < src_len)
|
||||
{
|
||||
int a = 1 + ((ll & 0xffff) >> 8);
|
||||
|
||||
*dst = src[l];
|
||||
if (l + 1 < src_len)
|
||||
*dst = INTERP_256(a, src[l + 1], src[l]);
|
||||
}
|
||||
if (l == 0)
|
||||
{
|
||||
*dst = src[0];
|
||||
}
|
||||
if (l >= src_len)
|
||||
{
|
||||
*dst = src[src_len - 1];
|
||||
}
|
||||
dst++; xx += gdata->axx; yy += gdata->ayx;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,929 +0,0 @@
|
|||
#include <math.h>
|
||||
|
||||
#include "evas_common.h"
|
||||
#include "evas_blend_private.h"
|
||||
#include "evas_gradient_private.h"
|
||||
|
||||
|
||||
static void _get_word(char *in, char *key);
|
||||
static void evas_common_gradient_map_argb(RGBA_Draw_Context *dc, RGBA_Gradient *gr, int len);
|
||||
static void evas_common_gradient_map_ahsv(RGBA_Draw_Context *dc, RGBA_Gradient *gr, int len);
|
||||
|
||||
static int grad_initialised = 0;
|
||||
|
||||
static void
|
||||
_get_word(char *in, char *key)
|
||||
{
|
||||
char *p, *pp;
|
||||
int l;
|
||||
|
||||
if (!key) return;
|
||||
*key = 0;
|
||||
if (!in || !*in) return;
|
||||
|
||||
p = in;
|
||||
while (*p && isspace(*p))
|
||||
p++;
|
||||
if (!*p) return;
|
||||
pp = p;
|
||||
while (*pp && !isspace(*pp))
|
||||
pp++;
|
||||
l = pp - p;
|
||||
if (l >= 255) return;
|
||||
*(p + l) = 0;
|
||||
strncpy(key, p, l + 1);
|
||||
}
|
||||
|
||||
static void
|
||||
_evas_common_gradient_stops_free(RGBA_Gradient *gr)
|
||||
{
|
||||
if (!gr) return;
|
||||
if (gr->color.stops)
|
||||
{
|
||||
Eina_Inlist *l;
|
||||
|
||||
while (gr->color.stops)
|
||||
{
|
||||
l = gr->color.stops;
|
||||
gr->color.stops = eina_inlist_remove(gr->color.stops, gr->color.stops);
|
||||
free(l);
|
||||
}
|
||||
gr->color.stops = NULL;
|
||||
gr->color.nstops = 0;
|
||||
}
|
||||
if (gr->alpha.stops)
|
||||
{
|
||||
Eina_Inlist *l;
|
||||
|
||||
while (gr->alpha.stops)
|
||||
{
|
||||
l = gr->alpha.stops;
|
||||
gr->alpha.stops = eina_inlist_remove(gr->alpha.stops, gr->alpha.stops);
|
||||
free(l);
|
||||
}
|
||||
gr->alpha.stops = NULL;
|
||||
gr->alpha.nstops = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
evas_common_gradient_get_key_fval(char *in, char *key, float *val)
|
||||
{
|
||||
char *p, *pp, sval[256];
|
||||
|
||||
if (!key || !val) return NULL;
|
||||
*key = 0;
|
||||
if (!in || !*in) return NULL;
|
||||
p = strchr(in, '=');
|
||||
if (!p || !*p) return NULL;
|
||||
*p = 0; p++;
|
||||
if (!*p) return NULL;
|
||||
pp = strchr(p, ';');
|
||||
if (!pp || !*pp) return NULL;
|
||||
_get_word(in, key);
|
||||
if (!*key) return NULL;
|
||||
*pp = 0;
|
||||
_get_word(p, sval);
|
||||
if (!sval[0]) return NULL;
|
||||
*val = atof(sval);
|
||||
return (pp + 1);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_init(void)
|
||||
{
|
||||
RGBA_Gradient_Type *geom;
|
||||
|
||||
if (grad_initialised)
|
||||
return;
|
||||
geom = evas_common_gradient_geometer_get("linear");
|
||||
if (geom)
|
||||
geom->init();
|
||||
geom = evas_common_gradient_geometer_get("radial");
|
||||
if (geom)
|
||||
geom->init();
|
||||
geom = evas_common_gradient_geometer_get("rectangular");
|
||||
if (geom)
|
||||
geom->init();
|
||||
geom = evas_common_gradient_geometer_get("angular");
|
||||
if (geom)
|
||||
geom->init();
|
||||
geom = evas_common_gradient_geometer_get("sinusoidal");
|
||||
if (geom)
|
||||
geom->init();
|
||||
grad_initialised = 1;
|
||||
}
|
||||
|
||||
void
|
||||
evas_common_gradient_shutdown(void)
|
||||
{
|
||||
RGBA_Gradient_Type *geom;
|
||||
|
||||
if (!grad_initialised)
|
||||
return;
|
||||
geom = evas_common_gradient_geometer_get("linear");
|
||||
if (geom)
|
||||
geom->shutdown();
|
||||
geom = evas_common_gradient_geometer_get("radial");
|
||||
if (geom)
|
||||
geom->shutdown();
|
||||
geom = evas_common_gradient_geometer_get("rectangular");
|
||||
if (geom)
|
||||
geom->shutdown();
|
||||
geom = evas_common_gradient_geometer_get("angular");
|
||||
if (geom)
|
||||
geom->shutdown();
|
||||
geom = evas_common_gradient_geometer_get("sinusoidal");
|
||||
if (geom)
|
||||
geom->shutdown();
|
||||
grad_initialised = 0;
|
||||
}
|
||||
|
||||
EAPI RGBA_Gradient *
|
||||
evas_common_gradient_new(void)
|
||||
{
|
||||
RGBA_Gradient *gr;
|
||||
|
||||
gr = calloc(1, sizeof(RGBA_Gradient));
|
||||
gr->references = 1;
|
||||
return gr;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_free(RGBA_Gradient *gr)
|
||||
{
|
||||
if (!gr) return;
|
||||
gr->references--;
|
||||
if (gr->references > 0) return;
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
LKL(gr->ref_fq_add); LKL(gr->ref_fq_del);
|
||||
if (gr->ref_fq[0] != gr->ref_fq[1])
|
||||
{
|
||||
LKU(gr->ref_fq_add); LKU(gr->ref_fq_del);
|
||||
return;
|
||||
}
|
||||
LKU(gr->ref_fq_add); LKU(gr->ref_fq_del);
|
||||
#endif
|
||||
evas_common_gradient_clear(gr);
|
||||
if (gr->type.name) free(gr->type.name);
|
||||
if (gr->type.params) free(gr->type.params);
|
||||
if (gr->type.geometer && gr->type.gdata)
|
||||
gr->type.geometer->geom_free(gr->type.gdata);
|
||||
if (gr->map.data) free(gr->map.data);
|
||||
free(gr);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_clear(RGBA_Gradient *gr)
|
||||
{
|
||||
if (!gr) return;
|
||||
|
||||
_evas_common_gradient_stops_free(gr);
|
||||
|
||||
if (gr->color.data && !gr->imported_data)
|
||||
free(gr->color.data);
|
||||
gr->color.data = NULL;
|
||||
gr->color.len = 0;
|
||||
if (gr->alpha.data && !gr->imported_data)
|
||||
free(gr->alpha.data);
|
||||
gr->alpha.data = NULL;
|
||||
gr->alpha.len = 0;
|
||||
|
||||
gr->imported_data = 0;
|
||||
gr->has_alpha = 0;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_color_stop_add(RGBA_Gradient *gr, int r, int g, int b, int a, int dist)
|
||||
{
|
||||
RGBA_Gradient_Color_Stop *gc, *gcm, *gc_last;
|
||||
|
||||
if (!gr) return;
|
||||
if (gr->imported_data)
|
||||
{
|
||||
gr->color.data = NULL;
|
||||
gr->color.len = 0;
|
||||
gr->alpha.data = NULL;
|
||||
gr->alpha.len = 0;
|
||||
gr->imported_data = 0;
|
||||
gr->has_alpha = 0;
|
||||
}
|
||||
gc = malloc(sizeof(RGBA_Gradient_Color_Stop));
|
||||
if (!gc) return;
|
||||
if (dist < 1) dist = 1;
|
||||
if (dist > 32768) dist = 32768;
|
||||
if (r < 0) r = 0; if (r > 255) r = 255;
|
||||
if (g < 0) g = 0; if (g > 255) g = 255;
|
||||
if (b < 0) b = 0; if (b > 255) b = 255;
|
||||
if (a < 0) a = 0; if (a > 255) a = 255;
|
||||
gc->r = r;
|
||||
gc->g = g;
|
||||
gc->b = b;
|
||||
gc->a = a;
|
||||
gc->dist = dist;
|
||||
|
||||
if (!gr->color.stops)
|
||||
{
|
||||
gr->color.stops = eina_inlist_append(gr->color.stops, EINA_INLIST_GET(gc));
|
||||
gr->color.nstops = 1;
|
||||
gr->color.len = 1;
|
||||
if (a < 255)
|
||||
gr->has_alpha = 1;
|
||||
return;
|
||||
}
|
||||
gcm = malloc(sizeof(RGBA_Gradient_Color_Stop));
|
||||
if (!gcm) { free(gc); return; }
|
||||
gc_last = (RGBA_Gradient_Color_Stop *)(gr->color.stops->last);
|
||||
if ((dist + gc_last->dist + gr->color.len) > 65535)
|
||||
{ free(gc); free(gcm); return; }
|
||||
gcm->r = (gc_last->r + r) / 2;
|
||||
gcm->g = (gc_last->g + g) / 2;
|
||||
gcm->b = (gc_last->b + b) / 2;
|
||||
gcm->a = (gc_last->a + a) / 2;
|
||||
gcm->dist = dist;
|
||||
gr->color.stops = eina_inlist_append(gr->color.stops, EINA_INLIST_GET(gcm));
|
||||
gr->color.len += gc_last->dist;
|
||||
gr->color.stops = eina_inlist_append(gr->color.stops, EINA_INLIST_GET(gc));
|
||||
gr->color.len += dist;
|
||||
gr->color.nstops += 2;
|
||||
if (a < 255)
|
||||
gr->has_alpha = 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_alpha_stop_add(RGBA_Gradient *gr, int a, int dist)
|
||||
{
|
||||
RGBA_Gradient_Alpha_Stop *ga, *gam, *ga_last;
|
||||
|
||||
if (!gr) return;
|
||||
if (gr->imported_data)
|
||||
{
|
||||
gr->color.data = NULL;
|
||||
gr->color.len = 0;
|
||||
gr->alpha.data = NULL;
|
||||
gr->alpha.len = 0;
|
||||
gr->imported_data = 0;
|
||||
gr->has_alpha = 0;
|
||||
}
|
||||
ga = malloc(sizeof(RGBA_Gradient_Alpha_Stop));
|
||||
if (!ga) return;
|
||||
if (dist < 1) dist = 1;
|
||||
if (dist > 32768) dist = 32768;
|
||||
if (a < 0) a = 0; if (a > 255) a = 255;
|
||||
ga->a = a;
|
||||
ga->dist = dist;
|
||||
|
||||
if (!gr->alpha.stops)
|
||||
{
|
||||
gr->alpha.stops = eina_inlist_append(gr->alpha.stops, EINA_INLIST_GET(ga));
|
||||
gr->alpha.nstops = 1;
|
||||
gr->alpha.len = 1;
|
||||
if (a < 255)
|
||||
gr->has_alpha = 1;
|
||||
return;
|
||||
}
|
||||
gam = malloc(sizeof(RGBA_Gradient_Alpha_Stop));
|
||||
if (!gam) { free(ga); return; }
|
||||
ga_last = (RGBA_Gradient_Alpha_Stop *)(gr->alpha.stops->last);
|
||||
if ((dist + ga_last->dist + gr->alpha.len) > 65535)
|
||||
{ free(ga); free(gam); return; }
|
||||
gam->a = (ga_last->a + a) / 2;
|
||||
gam->dist = dist;
|
||||
gr->alpha.stops = eina_inlist_append(gr->alpha.stops, EINA_INLIST_GET(gam));
|
||||
gr->alpha.len += ga_last->dist;
|
||||
gr->alpha.stops = eina_inlist_append(gr->alpha.stops, EINA_INLIST_GET(ga));
|
||||
gr->alpha.len += dist;
|
||||
gr->alpha.nstops += 2;
|
||||
if (a < 255)
|
||||
gr->has_alpha = 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_color_data_set(RGBA_Gradient *gr, DATA32 *data, int len, int alpha_flags)
|
||||
{
|
||||
if (!gr) return;
|
||||
if (!gr->imported_data)
|
||||
evas_common_gradient_clear(gr);
|
||||
if (len < 1) data = NULL;
|
||||
if (!data) len = 0;
|
||||
gr->color.data = data;
|
||||
gr->color.len = len;
|
||||
gr->has_alpha = !!alpha_flags;
|
||||
gr->imported_data = 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_alpha_data_set(RGBA_Gradient *gr, DATA8 *data, int len)
|
||||
{
|
||||
if (!gr) return;
|
||||
if (!gr->imported_data)
|
||||
evas_common_gradient_clear(gr);
|
||||
if (len < 1) data = NULL;
|
||||
if (!data) len = 0;
|
||||
gr->alpha.data = data;
|
||||
gr->alpha.len = len;
|
||||
gr->has_alpha = 1;
|
||||
gr->imported_data = 1;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_type_set(RGBA_Gradient *gr, const char *name, char *params)
|
||||
{
|
||||
RGBA_Gradient_Type *geometer;
|
||||
|
||||
if (!gr) return;
|
||||
if (!name || !*name)
|
||||
name = "linear";
|
||||
|
||||
geometer = evas_common_gradient_geometer_get(name);
|
||||
if (!geometer) return;
|
||||
if (gr->type.gdata && (geometer != gr->type.geometer))
|
||||
{
|
||||
if (gr->type.geometer)
|
||||
gr->type.geometer->geom_free(gr->type.gdata);
|
||||
gr->type.gdata = NULL;
|
||||
}
|
||||
gr->type.geometer = geometer;
|
||||
|
||||
if (gr->type.name) free(gr->type.name);
|
||||
gr->type.name = strdup(name);
|
||||
|
||||
if (params && !*params)
|
||||
params = NULL;
|
||||
if (gr->type.params) free(gr->type.params);
|
||||
gr->type.params = NULL;
|
||||
if (params) gr->type.params = strdup(params);
|
||||
|
||||
gr->type.geometer->geom_init(gr);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_fill_set(RGBA_Gradient *gr, int x, int y, int w, int h)
|
||||
{
|
||||
if (!gr) return;
|
||||
gr->fill.x = x;
|
||||
gr->fill.y = y;
|
||||
if ((w < 1) && (h < 1))
|
||||
{ w = h = 1; }
|
||||
gr->fill.w = w;
|
||||
gr->fill.h = h;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_fill_angle_set(RGBA_Gradient *gr, float angle)
|
||||
{
|
||||
if (!gr) return;
|
||||
gr->fill.angle = angle;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_fill_spread_set(RGBA_Gradient *gr, int spread)
|
||||
{
|
||||
if (!gr) return;
|
||||
gr->fill.spread = spread;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_map_offset_set(RGBA_Gradient *gr, float offset)
|
||||
{
|
||||
if (!gr) return;
|
||||
gr->map.offset = offset;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_map_direction_set(RGBA_Gradient *gr, int direction)
|
||||
{
|
||||
if (!gr) return;
|
||||
gr->map.direction = (direction >= 0 ? 1 : -1);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_map_angle_set(RGBA_Gradient *gr, float angle)
|
||||
{
|
||||
if (!gr) return;
|
||||
gr->map.angle = angle;
|
||||
}
|
||||
|
||||
EAPI RGBA_Gradient_Type *
|
||||
evas_common_gradient_geometer_get(const char *name)
|
||||
{
|
||||
RGBA_Gradient_Type *geom = NULL;
|
||||
|
||||
if (!name || !*name)
|
||||
name = "linear";
|
||||
if (!strcmp(name,"linear") || !strcmp(name,"linear.diag") || !strcmp(name,"linear.codiag"))
|
||||
geom = evas_common_gradient_linear_get();
|
||||
else if (!strcmp(name,"radial"))
|
||||
geom = evas_common_gradient_radial_get();
|
||||
else if (!strcmp(name,"angular"))
|
||||
geom = evas_common_gradient_angular_get();
|
||||
else if (!strcmp(name,"sinusoidal"))
|
||||
geom = evas_common_gradient_sinusoidal_get();
|
||||
else if (!strcmp(name,"rectangular"))
|
||||
geom = evas_common_gradient_rectangular_get();
|
||||
if (!geom)
|
||||
geom = evas_common_gradient_linear_get();
|
||||
return geom;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
|
||||
int x, int y, int w, int h, RGBA_Gradient *gr)
|
||||
{
|
||||
Gfx_Func_Gradient_Fill gfunc;
|
||||
RGBA_Gfx_Func bfunc = NULL;
|
||||
int len;
|
||||
int xin, yin, xoff, yoff;
|
||||
int clx, cly, clw, clh;
|
||||
int axx, axy, ayx, ayy;
|
||||
DATA32 *pdst, *dst_end, *buf, *map;
|
||||
RGBA_Image *argb_buf = NULL, *alpha_buf = NULL;
|
||||
DATA8 *mask = NULL;
|
||||
void *gdata;
|
||||
float angle;
|
||||
int direct_copy = 0, buf_step = 0;
|
||||
|
||||
if (!dst || !dc || !gr || !dst || !dst->image.data)
|
||||
return;
|
||||
if (!gr->map.data || !gr->type.geometer)
|
||||
return;
|
||||
if ((gr->fill.w < 1) || (gr->fill.h < 1))
|
||||
return;
|
||||
if ((w < 1) || (h < 1))
|
||||
return;
|
||||
clx = 0; cly = 0; clw = dst->cache_entry.w; clh = dst->cache_entry.h;
|
||||
if ((clw < 1) || (clh < 1)) return;
|
||||
|
||||
if (dc->clip.use)
|
||||
RECTS_CLIP_TO_RECT(clx,cly,clw,clh, dc->clip.x,dc->clip.y,dc->clip.w,dc->clip.h);
|
||||
if ((clw < 1) || (clh < 1)) return;
|
||||
|
||||
xin = x; yin = y;
|
||||
RECTS_CLIP_TO_RECT(x,y,w,h, clx,cly,clw,clh);
|
||||
if ((w < 1) || (h < 1)) return;
|
||||
|
||||
xoff = (x - xin) - gr->fill.x;
|
||||
yoff = (y - yin) - gr->fill.y;
|
||||
|
||||
if (!gr->type.geometer->has_mask(gr, dc->render_op))
|
||||
{
|
||||
if ((dc->render_op == _EVAS_RENDER_FILL) ||
|
||||
(dc->render_op == _EVAS_RENDER_COPY))
|
||||
{
|
||||
direct_copy = 1; buf_step = dst->cache_entry.w;
|
||||
if (gr->type.geometer->has_alpha(gr, dc->render_op))
|
||||
dst->cache_entry.flags.alpha = 1;
|
||||
}
|
||||
else if ((dc->render_op == _EVAS_RENDER_BLEND) &&
|
||||
!gr->type.geometer->has_alpha(gr, dc->render_op))
|
||||
{
|
||||
direct_copy = 1; buf_step = dst->cache_entry.w;
|
||||
}
|
||||
}
|
||||
|
||||
if (!direct_copy)
|
||||
{
|
||||
argb_buf = evas_common_image_line_buffer_obtain(w);
|
||||
if (!argb_buf)
|
||||
return;
|
||||
argb_buf->cache_entry.flags.alpha = gr->type.geometer->has_alpha(gr, dc->render_op) ? 1 : 0;
|
||||
|
||||
if (gr->type.geometer->has_mask(gr, dc->render_op))
|
||||
{
|
||||
alpha_buf = evas_common_image_alpha_line_buffer_obtain(w);
|
||||
if (!alpha_buf)
|
||||
{
|
||||
evas_common_image_line_buffer_release(argb_buf);
|
||||
return;
|
||||
}
|
||||
bfunc = evas_common_gfx_func_composite_pixel_mask_span_get(argb_buf, dst, w, dc->render_op);
|
||||
}
|
||||
else
|
||||
bfunc = evas_common_gfx_func_composite_pixel_span_get(argb_buf, dst, w, dc->render_op);
|
||||
}
|
||||
|
||||
gfunc = gr->type.geometer->get_fill_func(gr, dc->render_op, dc->anti_alias);
|
||||
gdata = gr->type.gdata;
|
||||
if (!gdata)
|
||||
{
|
||||
if (!direct_copy)
|
||||
{
|
||||
evas_common_image_line_buffer_release(argb_buf);
|
||||
if (alpha_buf)
|
||||
evas_common_image_alpha_line_buffer_release(alpha_buf);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* I TOLD YOU! this here STOPS the gradeint bugs. it's a missing
|
||||
* emms() before doing floating point operations! the thread pipe code
|
||||
* just brought it out reliably. i swear i had seen this long before i
|
||||
* ever added the thread/pipe code.
|
||||
*
|
||||
* now here is why it happens. NO drawing function... EXCEPT
|
||||
* evas_common_polygon_draw() and evas_common_gradient_draw() use floating
|
||||
* point for drawing (the poly stuff should really lose it actually), but
|
||||
* nicely nestled in the poly draw code is a evas_common_cpu_end_opt()
|
||||
* before it does any operations that would use floating point. the fact
|
||||
* is the gradient code was LUCKY before without the thread pipes to almost
|
||||
* all the time have another func do a evas_common_cpu_end_opt() before it
|
||||
* was called. that was no longer the case with the thread renderer and
|
||||
* it suffered. that is why on amd systems it seemed to work as i beileve
|
||||
* on amd cpu's the amms done by evas_common_cpu_end_opt() is not needed
|
||||
* to do floatingpoint ops again.
|
||||
*
|
||||
* after a lot of futzing about - this was the culprit (well axx and axy
|
||||
* were garbage values eventually i found after much debugging and i traced
|
||||
* their garbageness back to here).
|
||||
*/
|
||||
evas_common_cpu_end_opt();
|
||||
|
||||
angle = (gr->fill.angle * M_PI) / 180.0;
|
||||
axx = (cos(angle) * 65536.0);
|
||||
ayy = axx;
|
||||
axy = (sin(angle) * 65536.0);
|
||||
ayx = -axy;
|
||||
|
||||
map = gr->map.data;
|
||||
len = gr->map.len;
|
||||
pdst = dst->image.data + (y * dst->cache_entry.w) + x;
|
||||
dst_end = pdst + (h * dst->cache_entry.w);
|
||||
if (!direct_copy)
|
||||
{
|
||||
buf = argb_buf->image.data;
|
||||
if (alpha_buf)
|
||||
mask = (DATA8 *)alpha_buf->image.data;
|
||||
}
|
||||
else
|
||||
buf = pdst;
|
||||
while (pdst < dst_end)
|
||||
{
|
||||
#ifdef EVAS_SLI
|
||||
if (((yoff + y) % dc->sli.h) == dc->sli.y)
|
||||
#endif
|
||||
{
|
||||
gfunc(map, len, buf, mask, w, xoff, yoff, axx, axy, ayx, ayy, gdata);
|
||||
evas_common_cpu_end_opt();
|
||||
if (!direct_copy)
|
||||
bfunc(buf, mask, 0, pdst, w);
|
||||
evas_common_cpu_end_opt();
|
||||
}
|
||||
buf += buf_step;
|
||||
pdst += dst->cache_entry.w;
|
||||
yoff++;
|
||||
}
|
||||
|
||||
if (!direct_copy)
|
||||
{
|
||||
evas_common_image_line_buffer_release(argb_buf);
|
||||
if (alpha_buf)
|
||||
evas_common_image_alpha_line_buffer_release(alpha_buf);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
evas_common_gradient_map_argb(RGBA_Draw_Context *dc, RGBA_Gradient *gr, int len)
|
||||
{
|
||||
DATA32 color;
|
||||
int mul_use;
|
||||
|
||||
if (!gr || !dc)
|
||||
return;
|
||||
if (len < 1)
|
||||
{
|
||||
if (gr->map.data)
|
||||
free(gr->map.data);
|
||||
gr->map.data = NULL;
|
||||
gr->map.len = 0;
|
||||
return;
|
||||
}
|
||||
if ((len != gr->map.len) || (!gr->map.data))
|
||||
gr->map.data = realloc(gr->map.data, len * sizeof(DATA32));
|
||||
if (!gr->map.data)
|
||||
{ gr->map.len = 0; return; }
|
||||
gr->map.len = len;
|
||||
gr->map.has_alpha = gr->has_alpha;
|
||||
|
||||
color = dc->mul.col;
|
||||
mul_use = dc->mul.use;
|
||||
if (dc->mul.col == 0xffffffff)
|
||||
mul_use = 0;
|
||||
|
||||
if ((!gr->imported_data) && (!gr->color.stops) && (!gr->alpha.stops))
|
||||
{
|
||||
static DATA32 p = 0xffffffff;
|
||||
|
||||
gr->color.data = &p;
|
||||
gr->color.len = 1;
|
||||
gr->imported_data = 1;
|
||||
gr->has_alpha = 0;
|
||||
}
|
||||
|
||||
if (gr->color.stops)
|
||||
{
|
||||
Eina_Inlist *lc;
|
||||
RGBA_Gradient_Color_Stop *gc, *gc_next;
|
||||
DATA32 *pmap, *map_end;
|
||||
int i, dii;
|
||||
int r, g, b, a;
|
||||
int next_r, next_g, next_b, next_a;
|
||||
int rr, drr, gg, dgg, bb, dbb, aa, daa;
|
||||
int mr = 256, mg = 256, mb = 256, ma = 256;
|
||||
|
||||
gr->color.data = realloc(gr->color.data, gr->color.len * sizeof(DATA32));
|
||||
if (!gr->color.data) return;
|
||||
|
||||
gc = (RGBA_Gradient_Color_Stop *)gr->color.stops;
|
||||
r = gc->r; g = gc->g; b = gc->b; a = gc->a;
|
||||
if (mul_use)
|
||||
{
|
||||
mr = 1 + ((color >> 16) & 0xff); mg = 1 + ((color >> 8) & 0xff);
|
||||
mb = 1 + ((color) & 0xff); ma = 1 + (color >> 24);
|
||||
if (ma < 256)
|
||||
gr->map.has_alpha = 1;
|
||||
r = (r * mr) >> 8; g = (g * mg) >> 8;
|
||||
b = (b * mb) >> 8; a = (a * ma) >> 8;
|
||||
}
|
||||
lc = gr->color.stops->next;
|
||||
pmap = gr->color.data; map_end = pmap + gr->color.len;
|
||||
|
||||
while (pmap < map_end)
|
||||
{
|
||||
if (lc)
|
||||
{
|
||||
i = gc->dist;
|
||||
dii = 65536 / i;
|
||||
gc_next = (RGBA_Gradient_Color_Stop *)lc;
|
||||
next_r = gc_next->r; next_g = gc_next->g;
|
||||
next_b = gc_next->b; next_a = gc_next->a;
|
||||
if (mul_use)
|
||||
{
|
||||
next_r = (next_r * mr) >> 8; next_g = (next_g * mg) >> 8;
|
||||
next_b = (next_b * mb) >> 8; next_a = (next_a * ma) >> 8;
|
||||
}
|
||||
rr = r << 16; drr = ((next_r - r) * dii);
|
||||
gg = g << 16; dgg = ((next_g - g) * dii);
|
||||
bb = b << 16; dbb = ((next_b - b) * dii);
|
||||
aa = a << 16; daa = ((next_a - a) * dii);
|
||||
while (i--)
|
||||
{
|
||||
r = rr >> 16; r += (rr - (r << 16)) >> 15;
|
||||
g = gg >> 16; g += (gg - (g << 16)) >> 15;
|
||||
b = bb >> 16; b += (bb - (b << 16)) >> 15;
|
||||
a = aa >> 16; a += (aa - (a << 16)) >> 15;
|
||||
*pmap++ = ARGB_JOIN(a,r,g,b);
|
||||
rr += drr; gg += dgg; bb += dbb; aa += daa;
|
||||
}
|
||||
gc = gc_next;
|
||||
r = next_r; g = next_g; b = next_b; a = next_a;
|
||||
lc = lc->next;
|
||||
}
|
||||
else
|
||||
*pmap++ = ARGB_JOIN(a,r,g,b);
|
||||
}
|
||||
}
|
||||
|
||||
if (gr->alpha.stops)
|
||||
{
|
||||
Eina_Inlist *lc;
|
||||
RGBA_Gradient_Alpha_Stop *ga, *ga_next;
|
||||
DATA8 *pamap, *amap_end;
|
||||
int i, dii;
|
||||
int a, next_a;
|
||||
int aa, daa;
|
||||
|
||||
gr->alpha.data = realloc(gr->alpha.data, gr->alpha.len * sizeof(DATA8));
|
||||
if (!gr->alpha.data) return;
|
||||
|
||||
ga = (RGBA_Gradient_Alpha_Stop *)gr->alpha.stops;
|
||||
a = ga->a;
|
||||
lc = gr->alpha.stops->next;
|
||||
pamap = gr->alpha.data; amap_end = pamap + gr->alpha.len;
|
||||
|
||||
while (pamap < amap_end)
|
||||
{
|
||||
if (lc)
|
||||
{
|
||||
i = ga->dist;
|
||||
dii = 65536 / i;
|
||||
ga_next = (RGBA_Gradient_Alpha_Stop *)lc;
|
||||
next_a = ga_next->a;
|
||||
aa = a << 16; daa = ((next_a - a) * dii);
|
||||
while (i--)
|
||||
{
|
||||
a = aa >> 16; a += (aa - (a << 16)) >> 15;
|
||||
*pamap++ = a;
|
||||
aa += daa;
|
||||
}
|
||||
ga = ga_next;
|
||||
a = next_a;
|
||||
lc = lc->next;
|
||||
}
|
||||
else
|
||||
*pamap++ = a;
|
||||
}
|
||||
}
|
||||
|
||||
if (gr->color.data && gr->alpha.data)
|
||||
{
|
||||
if (!gr->imported_data)
|
||||
color = 0xffffffff;
|
||||
if (gr->color.len == gr->alpha.len)
|
||||
{
|
||||
evas_common_scale_rgba_a8_span(gr->color.data, gr->alpha.data, gr->color.len,
|
||||
color, gr->map.data, gr->map.len, gr->map.direction);
|
||||
return;
|
||||
}
|
||||
evas_common_scale_rgba_span(gr->color.data, NULL, gr->color.len,
|
||||
color, gr->map.data, gr->map.len, gr->map.direction);
|
||||
evas_common_scale_clip_a8_span(NULL, gr->alpha.data, gr->alpha.len,
|
||||
0xffffffff, gr->map.data, gr->map.len, gr->map.direction);
|
||||
return;
|
||||
}
|
||||
|
||||
if (gr->color.data)
|
||||
{
|
||||
if (!gr->imported_data)
|
||||
color = 0xffffffff;
|
||||
evas_common_scale_rgba_span(gr->color.data, NULL, gr->color.len,
|
||||
color, gr->map.data, gr->map.len, gr->map.direction);
|
||||
gr->map.has_alpha |= (!!(255 - (color >> 24)));
|
||||
return;
|
||||
}
|
||||
|
||||
evas_common_scale_a8_span(NULL, gr->alpha.data, gr->alpha.len,
|
||||
color, gr->map.data, gr->map.len, gr->map.direction);
|
||||
}
|
||||
|
||||
static void
|
||||
evas_common_gradient_map_ahsv(RGBA_Draw_Context *dc, RGBA_Gradient *gr, int len)
|
||||
{
|
||||
DATA32 color;
|
||||
|
||||
if (!gr || !dc)
|
||||
return;
|
||||
if (len < 1)
|
||||
{
|
||||
if (gr->map.data)
|
||||
free(gr->map.data);
|
||||
gr->map.data = NULL;
|
||||
gr->map.len = 0;
|
||||
return;
|
||||
}
|
||||
if ((len != gr->map.len) || (!gr->map.data))
|
||||
gr->map.data = realloc(gr->map.data, len * sizeof(DATA32));
|
||||
if (!gr->map.data)
|
||||
{ gr->map.len = 0; return; }
|
||||
gr->map.len = len;
|
||||
gr->map.has_alpha = gr->has_alpha;
|
||||
|
||||
color = dc->mul.col;
|
||||
if (!dc->mul.use)
|
||||
color = 0xffffffff;
|
||||
|
||||
if ((!gr->imported_data) && (!gr->color.stops) && (!gr->alpha.stops))
|
||||
{
|
||||
static DATA32 p = 0xffffffff;
|
||||
|
||||
gr->color.data = &p;
|
||||
gr->color.len = 1;
|
||||
gr->imported_data = 1;
|
||||
gr->has_alpha = 0;
|
||||
}
|
||||
|
||||
if (gr->color.stops)
|
||||
{
|
||||
Eina_Inlist *lc;
|
||||
RGBA_Gradient_Color_Stop *gc, *gc_next;
|
||||
DATA32 *pmap, *map_end;
|
||||
int i, dii;
|
||||
int h, s, v;
|
||||
int next_h, next_s, next_v;
|
||||
int hh, dhh, ss, dss, vv, dvv, aa, daa;
|
||||
int r, g, b, a;
|
||||
int next_r, next_g, next_b, next_a;
|
||||
|
||||
gr->color.data = realloc(gr->color.data, gr->color.len * sizeof(DATA32));
|
||||
if (!gr->color.data) return;
|
||||
|
||||
gc = (RGBA_Gradient_Color_Stop *)gr->color.stops;
|
||||
r = gc->r; g = gc->g; b = gc->b; a = gc->a;
|
||||
evas_common_convert_color_rgb_to_hsv_int(r, g, b, &h, &s, &v);
|
||||
|
||||
lc = gr->color.stops->next;
|
||||
pmap = gr->color.data; map_end = pmap + gr->color.len;
|
||||
|
||||
while (pmap < map_end)
|
||||
{
|
||||
if (lc)
|
||||
{
|
||||
i = gc->dist;
|
||||
dii = 65536 / i;
|
||||
gc_next = (RGBA_Gradient_Color_Stop *)lc;
|
||||
|
||||
next_r = gc_next->r; next_g = gc_next->g;
|
||||
next_b = gc_next->b; next_a = gc_next->a;
|
||||
evas_common_convert_color_rgb_to_hsv_int(next_r, next_g, next_b,
|
||||
&next_h, &next_s, &next_v);
|
||||
hh = h << 16; dhh = ((next_h - h) * dii);
|
||||
ss = s << 16; dss = ((next_s - s) * dii);
|
||||
vv = v << 16; dvv = ((next_v - v) * dii);
|
||||
aa = a << 16; daa = ((next_a - a) * dii);
|
||||
while (i--)
|
||||
{
|
||||
h = hh >> 16; h += (hh - (h << 16)) >> 15;
|
||||
s = ss >> 16; s += (ss - (s << 16)) >> 15;
|
||||
v = vv >> 16; v += (vv - (v << 16)) >> 15;
|
||||
a = aa >> 16; a += (aa - (a << 16)) >> 15;
|
||||
evas_common_convert_color_hsv_to_rgb_int(h, s, v, &r, &g, &b);
|
||||
*pmap++ = ARGB_JOIN(a,r,g,b);
|
||||
hh += dhh; ss += dss; vv += dvv; aa += daa;
|
||||
}
|
||||
gc = gc_next;
|
||||
h = next_h; s = next_s; v = next_v; a = next_a;
|
||||
lc = lc->next;
|
||||
}
|
||||
else
|
||||
*pmap++ = ARGB_JOIN(gc->a,gc->r,gc->g,gc->b);
|
||||
}
|
||||
}
|
||||
|
||||
if (gr->alpha.stops)
|
||||
{
|
||||
Eina_Inlist *lc;
|
||||
RGBA_Gradient_Alpha_Stop *ga, *ga_next;
|
||||
DATA8 *pamap, *amap_end;
|
||||
int i, dii;
|
||||
int a, next_a;
|
||||
int aa, daa;
|
||||
|
||||
gr->alpha.data = realloc(gr->alpha.data, gr->alpha.len * sizeof(DATA8));
|
||||
if (!gr->alpha.data) return;
|
||||
|
||||
ga = (RGBA_Gradient_Alpha_Stop *)gr->alpha.stops;
|
||||
a = ga->a;
|
||||
lc = gr->alpha.stops->next;
|
||||
pamap = gr->alpha.data; amap_end = pamap + gr->alpha.len;
|
||||
|
||||
while (pamap < amap_end)
|
||||
{
|
||||
if (lc)
|
||||
{
|
||||
i = ga->dist;
|
||||
dii = 65536 / i;
|
||||
ga_next = (RGBA_Gradient_Alpha_Stop *)lc;
|
||||
next_a = ga_next->a;
|
||||
aa = a << 16; daa = ((next_a - a) * dii);
|
||||
while (i--)
|
||||
{
|
||||
a = aa >> 16; a += (aa - (a << 16)) >> 15;
|
||||
*pamap++ = a;
|
||||
aa += daa;
|
||||
}
|
||||
ga = ga_next;
|
||||
a = next_a;
|
||||
lc = lc->next;
|
||||
}
|
||||
else
|
||||
*pamap++ = a;
|
||||
}
|
||||
}
|
||||
|
||||
if (gr->color.data && gr->alpha.data)
|
||||
{
|
||||
if (gr->color.len == gr->alpha.len)
|
||||
{
|
||||
evas_common_scale_hsva_a8_span(gr->color.data, gr->alpha.data, gr->color.len,
|
||||
color, gr->map.data, gr->map.len, gr->map.direction);
|
||||
return;
|
||||
}
|
||||
evas_common_scale_hsva_span(gr->color.data, NULL, gr->color.len,
|
||||
color, gr->map.data, gr->map.len, gr->map.direction);
|
||||
evas_common_scale_clip_a8_span(NULL, gr->alpha.data, gr->alpha.len,
|
||||
0xffffffff, gr->map.data, gr->map.len, gr->map.direction);
|
||||
return;
|
||||
}
|
||||
if (gr->color.data)
|
||||
{
|
||||
evas_common_scale_hsva_span(gr->color.data, NULL, gr->color.len,
|
||||
color, gr->map.data, gr->map.len, gr->map.direction);
|
||||
gr->map.has_alpha |= (!!(255 - (color >> 24)));
|
||||
return;
|
||||
}
|
||||
|
||||
evas_common_scale_a8_span(NULL, gr->alpha.data, gr->alpha.len,
|
||||
color, gr->map.data, gr->map.len, gr->map.direction);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_gradient_map(RGBA_Draw_Context *dc, RGBA_Gradient *gr, int len)
|
||||
{
|
||||
if (!gr || !dc) return;
|
||||
if (dc->interpolation.color_space == _EVAS_COLOR_SPACE_AHSV)
|
||||
{
|
||||
evas_common_gradient_map_ahsv(dc, gr, len);
|
||||
return;
|
||||
}
|
||||
evas_common_gradient_map_argb(dc, gr, len);
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
#ifndef _EVAS_GRADIENT_PRIVATE_H
|
||||
#define _EVAS_GRADIENT_PRIVATE_H
|
||||
|
||||
|
||||
RGBA_Gradient_Type *evas_common_gradient_linear_get (void);
|
||||
RGBA_Gradient_Type *evas_common_gradient_radial_get (void);
|
||||
RGBA_Gradient_Type *evas_common_gradient_angular_get (void);
|
||||
RGBA_Gradient_Type *evas_common_gradient_rectangular_get (void);
|
||||
RGBA_Gradient_Type *evas_common_gradient_sinusoidal_get (void);
|
||||
char *evas_common_gradient_get_key_fval (char *in, char *key, float *val);
|
||||
|
||||
|
||||
#endif /* _EVAS_GRADIENT_PRIVATE_H */
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,834 +0,0 @@
|
|||
#include <math.h>
|
||||
|
||||
#include "evas_common.h"
|
||||
#include "evas_gradient_private.h"
|
||||
|
||||
typedef struct _Sinusoidal_Data Sinusoidal_Data;
|
||||
struct _Sinusoidal_Data
|
||||
{
|
||||
float amp, per;
|
||||
|
||||
float sa, sp;
|
||||
float off;
|
||||
int len;
|
||||
};
|
||||
|
||||
static void
|
||||
sinusoidal_init(void);
|
||||
|
||||
static void
|
||||
sinusoidal_shutdown(void);
|
||||
|
||||
static void
|
||||
sinusoidal_init_geom(RGBA_Gradient *gr);
|
||||
|
||||
static void
|
||||
sinusoidal_setup_geom(RGBA_Gradient *gr);
|
||||
|
||||
static void
|
||||
sinusoidal_free_geom(void *gdata);
|
||||
|
||||
static int
|
||||
sinusoidal_has_alpha(RGBA_Gradient *gr, int op);
|
||||
|
||||
static int
|
||||
sinusoidal_has_mask(RGBA_Gradient *gr, int op);
|
||||
|
||||
static int
|
||||
sinusoidal_get_map_len(RGBA_Gradient *gr);
|
||||
|
||||
static Gfx_Func_Gradient_Fill
|
||||
sinusoidal_get_fill_func(RGBA_Gradient *gr, int op, unsigned char aa);
|
||||
|
||||
static RGBA_Gradient_Type sinusoidal = {"sinusoidal", sinusoidal_init, sinusoidal_shutdown,
|
||||
sinusoidal_init_geom, sinusoidal_setup_geom, sinusoidal_free_geom,
|
||||
sinusoidal_has_alpha, sinusoidal_has_mask,
|
||||
sinusoidal_get_map_len, sinusoidal_get_fill_func};
|
||||
|
||||
|
||||
/** internal functions **/
|
||||
|
||||
static void
|
||||
sinusoidal_reflect(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
static void
|
||||
sinusoidal_reflect_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
static void
|
||||
sinusoidal_repeat(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
static void
|
||||
sinusoidal_repeat_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_reflect(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_reflect_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_reflect_masked(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_reflect_aa_masked(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_repeat(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_repeat_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_repeat_masked(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_repeat_aa_masked(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
static void
|
||||
sinusoidal_pad(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
static void
|
||||
sinusoidal_pad_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data);
|
||||
|
||||
|
||||
RGBA_Gradient_Type *
|
||||
evas_common_gradient_sinusoidal_get(void)
|
||||
{
|
||||
return &sinusoidal;
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_shutdown(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_free_geom(void *gdata)
|
||||
{
|
||||
Sinusoidal_Data *data = (Sinusoidal_Data *)gdata;
|
||||
if (data) free(data);
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_setup_geom(RGBA_Gradient *gr)
|
||||
{
|
||||
Sinusoidal_Data *sinusoidal_data;
|
||||
|
||||
if (!gr || (gr->type.geometer != &sinusoidal)) return;
|
||||
|
||||
sinusoidal_data = (Sinusoidal_Data *)gr->type.gdata;
|
||||
if (!sinusoidal_data) return;
|
||||
sinusoidal_data->sa = sinusoidal_data->amp * gr->fill.h;
|
||||
sinusoidal_data->sp = sinusoidal_data->per * (M_PI / gr->fill.w);
|
||||
sinusoidal_data->off = gr->map.offset;
|
||||
sinusoidal_data->len = gr->fill.h;
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_init_geom(RGBA_Gradient *gr)
|
||||
{
|
||||
Sinusoidal_Data *sinusoidal_data;
|
||||
int err = 1;
|
||||
char *s, *p, key[256];
|
||||
float amp, per, val;
|
||||
|
||||
if (!gr || (gr->type.geometer != &sinusoidal)) return;
|
||||
|
||||
sinusoidal_data = (Sinusoidal_Data *)gr->type.gdata;
|
||||
if (!sinusoidal_data)
|
||||
{
|
||||
sinusoidal_data = calloc(1, sizeof(Sinusoidal_Data));
|
||||
if (!sinusoidal_data) return;
|
||||
sinusoidal_data->amp = 1.0;
|
||||
sinusoidal_data->per = 1.0;
|
||||
sinusoidal_data->sa = 32;
|
||||
sinusoidal_data->sp = M_PI / 32;
|
||||
sinusoidal_data->off = 0.0;
|
||||
sinusoidal_data->len = 32;
|
||||
}
|
||||
gr->type.gdata = sinusoidal_data;
|
||||
|
||||
if (!gr->type.params || !*(gr->type.params))
|
||||
return;
|
||||
|
||||
s = strdup(gr->type.params);
|
||||
if (!s) return;
|
||||
|
||||
amp = sinusoidal_data->amp;
|
||||
per = sinusoidal_data->per;
|
||||
p = s;
|
||||
while ((p = evas_common_gradient_get_key_fval(p, key, &val)))
|
||||
{
|
||||
if (!strcmp(key, "amplitude"))
|
||||
{
|
||||
err = 0;
|
||||
amp = val;
|
||||
}
|
||||
else if (!strcmp(key, "period"))
|
||||
{
|
||||
err = 0;
|
||||
per = val;
|
||||
}
|
||||
else
|
||||
{
|
||||
err = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!err)
|
||||
{
|
||||
sinusoidal_data->amp = amp;
|
||||
if (per < 0.0) per = -per;
|
||||
sinusoidal_data->per = per;
|
||||
}
|
||||
free(s);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
sinusoidal_has_alpha(RGBA_Gradient *gr, int op)
|
||||
{
|
||||
if (!gr || (gr->type.geometer != &sinusoidal)) return 0;
|
||||
|
||||
if (gr->has_alpha | gr->map.has_alpha)
|
||||
return 1;
|
||||
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
|
||||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
|
||||
return 0;
|
||||
if ( (gr->fill.spread == _EVAS_TEXTURE_RESTRICT) ||
|
||||
(gr->fill.spread == _EVAS_TEXTURE_RESTRICT_REFLECT) ||
|
||||
(gr->fill.spread == _EVAS_TEXTURE_RESTRICT_REPEAT) )
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
sinusoidal_has_mask(RGBA_Gradient *gr, int op)
|
||||
{
|
||||
if (!gr || (gr->type.geometer != &sinusoidal)) return 0;
|
||||
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
|
||||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
|
||||
{
|
||||
if ( (gr->fill.spread == _EVAS_TEXTURE_RESTRICT) ||
|
||||
(gr->fill.spread == _EVAS_TEXTURE_RESTRICT_REFLECT) ||
|
||||
(gr->fill.spread == _EVAS_TEXTURE_RESTRICT_REPEAT) )
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
sinusoidal_get_map_len(RGBA_Gradient *gr)
|
||||
{
|
||||
Sinusoidal_Data *sinusoidal_data;
|
||||
|
||||
if (!gr || (gr->type.geometer != &sinusoidal)) return 0;
|
||||
sinusoidal_data = (Sinusoidal_Data *)gr->type.gdata;
|
||||
if (!sinusoidal_data) return 0;
|
||||
return sinusoidal_data->len;
|
||||
}
|
||||
|
||||
static Gfx_Func_Gradient_Fill
|
||||
sinusoidal_get_fill_func(RGBA_Gradient *gr, int op, unsigned char aa)
|
||||
{
|
||||
Sinusoidal_Data *sinusoidal_data;
|
||||
Gfx_Func_Gradient_Fill sfunc = NULL;
|
||||
int masked_op = 0;
|
||||
|
||||
if (!gr || (gr->type.geometer != &sinusoidal))
|
||||
return sfunc;
|
||||
sinusoidal_data = (Sinusoidal_Data *)gr->type.gdata;
|
||||
if (!sinusoidal_data) return sfunc;
|
||||
|
||||
sinusoidal_data->off = gr->map.offset;
|
||||
if ( (op == _EVAS_RENDER_COPY) || (op == _EVAS_RENDER_COPY_REL) ||
|
||||
(op == _EVAS_RENDER_MASK) || (op == _EVAS_RENDER_MUL) )
|
||||
masked_op = 1;
|
||||
|
||||
switch (gr->fill.spread)
|
||||
{
|
||||
case _EVAS_TEXTURE_REFLECT:
|
||||
{
|
||||
if (aa)
|
||||
sfunc = sinusoidal_reflect_aa;
|
||||
else
|
||||
sfunc = sinusoidal_reflect;
|
||||
}
|
||||
break;
|
||||
case _EVAS_TEXTURE_REPEAT:
|
||||
{
|
||||
if (aa)
|
||||
sfunc = sinusoidal_repeat_aa;
|
||||
else
|
||||
sfunc = sinusoidal_repeat;
|
||||
}
|
||||
break;
|
||||
case _EVAS_TEXTURE_RESTRICT:
|
||||
sinusoidal_data->off = 0;
|
||||
case _EVAS_TEXTURE_RESTRICT_REFLECT:
|
||||
{
|
||||
if (aa)
|
||||
{
|
||||
if (masked_op)
|
||||
sfunc = sinusoidal_restrict_reflect_aa_masked;
|
||||
else
|
||||
sfunc = sinusoidal_restrict_reflect_aa;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (masked_op)
|
||||
sfunc = sinusoidal_restrict_reflect_masked;
|
||||
else
|
||||
sfunc = sinusoidal_restrict_reflect;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case _EVAS_TEXTURE_RESTRICT_REPEAT:
|
||||
{
|
||||
if (aa)
|
||||
{
|
||||
if (masked_op)
|
||||
sfunc = sinusoidal_restrict_repeat_aa_masked;
|
||||
else
|
||||
sfunc = sinusoidal_restrict_repeat_aa;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (masked_op)
|
||||
sfunc = sinusoidal_restrict_repeat_masked;
|
||||
else
|
||||
sfunc = sinusoidal_restrict_repeat;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case _EVAS_TEXTURE_PAD:
|
||||
{
|
||||
if (aa)
|
||||
sfunc = sinusoidal_pad_aa;
|
||||
else
|
||||
sfunc = sinusoidal_pad;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
sfunc = sinusoidal_reflect_aa;
|
||||
break;
|
||||
}
|
||||
return sfunc;
|
||||
}
|
||||
|
||||
#define SETUP_SINU_FILL \
|
||||
a00 = gdata->sp * (axx / 65536.0f); \
|
||||
a01 = gdata->sp * (axy / 65536.0f); \
|
||||
a10 = ayx / 65536.0f; \
|
||||
a11 = ayy / 65536.0f; \
|
||||
xf = (a00 * x) + (a01 * y); \
|
||||
yf = (a10 * x) + (a11 * y);
|
||||
|
||||
static void
|
||||
sinusoidal_reflect(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
float off = gdata->off * (src_len - 1);
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
int l = (yf - (sa * sin(xf))) + off;
|
||||
|
||||
if (l < 0) l = -l;
|
||||
if (l >= src_len)
|
||||
{
|
||||
int m = (l % (2 * src_len));
|
||||
|
||||
l = (l % src_len);
|
||||
if (m >= src_len)
|
||||
l = src_len - l - 1;
|
||||
}
|
||||
*dst++ = src[l]; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_reflect_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
float off = gdata->off * (src_len - 1);
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
float r = (yf - (sa * sin(xf))) + off;
|
||||
int l = r, a;
|
||||
|
||||
if (r < 0) r = -r;
|
||||
a = 1 + (int)(255 * (r - (int)r));
|
||||
|
||||
if (l < 0) l = -l;
|
||||
if (l >= src_len)
|
||||
{
|
||||
int m = (l % (2 * src_len));
|
||||
|
||||
l = (l % src_len);
|
||||
if (m >= src_len)
|
||||
{ l = src_len - l - 1; a = 257 - a; }
|
||||
}
|
||||
*dst = src[l];
|
||||
if (l + 1 < src_len)
|
||||
*dst = INTERP_256(a, src[l + 1], *dst);
|
||||
|
||||
dst++; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_repeat(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
float off = gdata->off * (src_len - 1);
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
int l = (yf - (sa * sin(xf))) + off;
|
||||
|
||||
l = (l % src_len);
|
||||
if (l < 0)
|
||||
l += src_len;
|
||||
*dst++ = src[l]; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_repeat_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
float off = gdata->off * (src_len - 1);
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
float r = (yf - (sa * sin(xf))) + off;
|
||||
int l = r, a;
|
||||
|
||||
if (r < 0) r = -r;
|
||||
a = 1 + (int)(255 * (r - (int)r));
|
||||
|
||||
l = l % src_len;
|
||||
if (l < 0)
|
||||
{ l += src_len; a = 257 - a; }
|
||||
|
||||
*dst = src[l];
|
||||
if (l + 1 < src_len)
|
||||
*dst = INTERP_256(a, src[l + 1], *dst);
|
||||
if (l == (src_len - 1))
|
||||
*dst = INTERP_256(a, src[0], *dst);
|
||||
dst++; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_reflect(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
float off = gdata->off * (src_len - 1);
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
int l = (yf - (sa * sin(xf)));
|
||||
|
||||
*dst = 0;
|
||||
if ((unsigned)l < src_len)
|
||||
{
|
||||
l += off;
|
||||
if (l < 0) l = -l;
|
||||
if (l >= src_len)
|
||||
{
|
||||
int m = (l % (2 * src_len));
|
||||
|
||||
l = (l % src_len);
|
||||
if (m >= src_len)
|
||||
l = src_len - l - 1;
|
||||
}
|
||||
*dst = src[l];
|
||||
}
|
||||
dst++; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_reflect_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
float off = gdata->off * (src_len - 1);
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
float r = (yf - (sa * sin(xf))) + off, s = r - off;
|
||||
int l = s;
|
||||
|
||||
*dst = 0;
|
||||
if ((unsigned)l < src_len)
|
||||
{
|
||||
int a, lp = r;
|
||||
|
||||
if (r < 0) r = -r;
|
||||
a = 1 + (int)(255 * (r - (int)r));
|
||||
if (lp < 0) lp = -lp;
|
||||
if (lp >= src_len)
|
||||
{
|
||||
int m = (lp % (2 * src_len));
|
||||
|
||||
lp = (lp % src_len);
|
||||
if (m >= src_len)
|
||||
{ lp = src_len - lp - 1; a = 257 - a; }
|
||||
}
|
||||
*dst = src[lp];
|
||||
if (lp + 1 < src_len)
|
||||
*dst = INTERP_256(a, src[lp + 1], *dst);
|
||||
if ((l == 0) && (s < 0))
|
||||
{
|
||||
a = 256 + (255 * s);
|
||||
*dst = MUL_256(a, *dst);
|
||||
}
|
||||
if (l == (src_len - 1))
|
||||
{
|
||||
a = 256 - (255 * (s - l));
|
||||
*dst = MUL_256(a, *dst);
|
||||
}
|
||||
}
|
||||
dst++; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_reflect_masked(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
float off = gdata->off * (src_len - 1);
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
int l = (yf - (sa * sin(xf)));
|
||||
|
||||
*dst = 0; *mask = 0;
|
||||
if ((unsigned)l < src_len)
|
||||
{
|
||||
l += off;
|
||||
if (l < 0) l = -l;
|
||||
if (l >= src_len)
|
||||
{
|
||||
int m = (l % (2 * src_len));
|
||||
|
||||
l = (l % src_len);
|
||||
if (m >= src_len)
|
||||
l = src_len - l - 1;
|
||||
}
|
||||
*dst = src[l]; *mask = 255;
|
||||
}
|
||||
dst++; mask++; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_reflect_aa_masked(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
float off = gdata->off * (src_len - 1);
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
float r = (yf - (sa * sin(xf))) + off, s = r - off;
|
||||
int l = s;
|
||||
|
||||
*dst = 0; *mask = 0;
|
||||
if ((unsigned)l < src_len)
|
||||
{
|
||||
int a, lp = r;
|
||||
|
||||
if (r < 0) r = -r;
|
||||
a = 1 + (int)(255 * (r - (int)r));
|
||||
if (lp < 0) lp = -lp;
|
||||
if (lp >= src_len)
|
||||
{
|
||||
int m = (lp % (2 * src_len));
|
||||
|
||||
lp = (lp % src_len);
|
||||
if (m >= src_len)
|
||||
{ lp = src_len - lp - 1; a = 257 - a; }
|
||||
}
|
||||
*dst = src[lp]; *mask = 255;
|
||||
if (lp + 1 < src_len)
|
||||
*dst = INTERP_256(a, src[lp + 1], *dst);
|
||||
if ((l == 0) && (s < 0))
|
||||
*mask = 255 + (255 * s);
|
||||
if (l == (src_len - 1))
|
||||
*mask = 255 - (255 * (s - l));
|
||||
}
|
||||
dst++; mask++; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_repeat(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
float off = gdata->off * (src_len - 1);
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
int l = (yf - (sa * sin(xf)));
|
||||
|
||||
*dst = 0;
|
||||
if ((unsigned)l < src_len)
|
||||
{
|
||||
l += off;
|
||||
l = l % src_len;
|
||||
if (l < 0)
|
||||
l += src_len;
|
||||
*dst = src[l];
|
||||
}
|
||||
dst++; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_repeat_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
float off = gdata->off * (src_len - 1);
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
float r = (yf - (sa * sin(xf))) + off, s = r - off;
|
||||
int l = s;
|
||||
|
||||
*dst = 0;
|
||||
if ((unsigned)l < src_len)
|
||||
{
|
||||
int a, lp = r;
|
||||
|
||||
if (r < 0) r = -r;
|
||||
a = 1 + (int)(255 * (r - (int)r));
|
||||
lp = lp % src_len;
|
||||
if (lp < 0)
|
||||
{ lp += src_len; a = 257 - a; }
|
||||
*dst = src[lp];
|
||||
if (lp + 1 < src_len)
|
||||
*dst = INTERP_256(a, src[lp + 1], *dst);
|
||||
if (lp == (src_len - 1))
|
||||
*dst = INTERP_256(a, src[0], *dst);
|
||||
if ((l == 0) && (s < 0))
|
||||
{
|
||||
a = 256 + (255 * s);
|
||||
*dst = MUL_256(a, *dst);
|
||||
}
|
||||
if (l == (src_len - 1))
|
||||
{
|
||||
a = 256 - (255 * (s - l));
|
||||
*dst = MUL_256(a, *dst);
|
||||
}
|
||||
}
|
||||
dst++; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_repeat_masked(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
float off = gdata->off * (src_len - 1);
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
int l = (yf - (sa * sin(xf)));
|
||||
|
||||
*dst = 0; *mask = 0;
|
||||
if ((unsigned)l < src_len)
|
||||
{
|
||||
l += off;
|
||||
l = l % src_len;
|
||||
if (l < 0)
|
||||
l += src_len;
|
||||
*dst = src[l]; *mask = 255;
|
||||
}
|
||||
dst++; mask++; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_restrict_repeat_aa_masked(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
float off = gdata->off * (src_len - 1);
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
float r = (yf - (sa * sin(xf))) + off, s = r - off;
|
||||
int l = s;
|
||||
|
||||
*dst = 0; *mask = 0;
|
||||
if ((unsigned)l < src_len)
|
||||
{
|
||||
int a, lp = r;
|
||||
|
||||
if (r < 0) r = -r;
|
||||
a = 1 + (int)(255 * (r - (int)r));
|
||||
lp = lp % src_len;
|
||||
if (lp < 0)
|
||||
{ lp += src_len; a = 257 - a; }
|
||||
*dst = src[lp]; *mask = 255;
|
||||
if (lp + 1 < src_len)
|
||||
*dst = INTERP_256(a, src[lp + 1], *dst);
|
||||
if (lp == (src_len - 1))
|
||||
*dst = INTERP_256(a, src[0], *dst);
|
||||
if ((l == 0) && (s < 0))
|
||||
*mask = 255 + (255 * s);
|
||||
if (l == (src_len - 1))
|
||||
*mask = 255 - (255 * (s - l));
|
||||
}
|
||||
dst++; mask++; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_pad(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
int l = (yf - (sa * sin(xf)));
|
||||
|
||||
if (l < 0)
|
||||
l = 0;
|
||||
if (l >= src_len)
|
||||
l = src_len - 1;
|
||||
*dst = src[l];
|
||||
dst++; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sinusoidal_pad_aa(DATA32 *src, int src_len, DATA32 *dst, DATA8 *mask __UNUSED__, int dst_len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy, void *params_data)
|
||||
{
|
||||
DATA32 *dst_end = dst + dst_len;
|
||||
Sinusoidal_Data *gdata = (Sinusoidal_Data *)params_data;
|
||||
float xf, yf, sa = gdata->sa;
|
||||
float a00, a01, a10, a11;
|
||||
|
||||
SETUP_SINU_FILL
|
||||
|
||||
while (dst < dst_end)
|
||||
{
|
||||
float r = (yf - (sa * sin(xf)));
|
||||
int l = r;
|
||||
|
||||
*dst = 0;
|
||||
if ((unsigned)l < (src_len - 1))
|
||||
{
|
||||
int a;
|
||||
|
||||
if (r < 0) r = -r;
|
||||
a = 1 + (int)(255 * (r - (int)r));
|
||||
*dst = INTERP_256(a, src[l + 1], src[l]);
|
||||
}
|
||||
if (l < 0) *dst = src[0];
|
||||
if (l >= src_len) *dst = src[src_len - 1];
|
||||
dst++; xf += a00; yf += a10;
|
||||
}
|
||||
}
|
|
@ -1173,178 +1173,6 @@ evas_common_pipe_poly_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
|
|||
evas_common_pipe_draw_context_copy(dc, op);
|
||||
}
|
||||
|
||||
/**************** GRAD ******************/
|
||||
static void
|
||||
evas_common_pipe_op_grad_free(RGBA_Pipe_Op *op)
|
||||
{
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
LKL(op->op.grad.grad->ref_fq_del);
|
||||
op->op.grad.grad->ref_fq[1]++;
|
||||
LKU(op->op.grad.grad->ref_fq_del);
|
||||
pthread_cond_signal(&(op->op.grad.grad->cond_fq_del));
|
||||
#else
|
||||
evas_common_gradient_free(op->op.grad.grad);
|
||||
#endif
|
||||
evas_common_pipe_op_free(op);
|
||||
}
|
||||
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
EAPI void
|
||||
evas_common_pipe_op_grad_flush(RGBA_Gradient *gr)
|
||||
{
|
||||
if (! evas_common_frameq_enabled())
|
||||
return;
|
||||
|
||||
LKL(gr->ref_fq_add);
|
||||
LKL(gr->ref_fq_del);
|
||||
|
||||
while (gr->ref_fq[0] != gr->ref_fq[1])
|
||||
pthread_cond_wait(&(gr->cond_fq_del), &(gr->ref_fq_del));
|
||||
|
||||
LKU(gr->ref_fq_del);
|
||||
LKU(gr->ref_fq_add);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
evas_common_pipe_grad_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thread_Info *info)
|
||||
{
|
||||
if (info)
|
||||
{
|
||||
RGBA_Draw_Context context;
|
||||
|
||||
memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context));
|
||||
#ifdef EVAS_SLI
|
||||
evas_common_draw_context_set_sli(&(context), info->y, info->h);
|
||||
#else
|
||||
evas_common_draw_context_clip_clip(&(context), info->x, info->y, info->w, info->h);
|
||||
#endif
|
||||
evas_common_gradient_draw(dst, &(context),
|
||||
op->op.grad.x, op->op.grad.y,
|
||||
op->op.grad.w, op->op.grad.h,
|
||||
op->op.grad.grad);
|
||||
}
|
||||
else
|
||||
{
|
||||
evas_common_gradient_draw(dst, &(op->context),
|
||||
op->op.grad.x, op->op.grad.y,
|
||||
op->op.grad.w, op->op.grad.h,
|
||||
op->op.grad.grad);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_pipe_grad_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
|
||||
int x, int y, int w, int h, RGBA_Gradient *gr)
|
||||
{
|
||||
RGBA_Pipe_Op *op;
|
||||
|
||||
if (!gr) return;
|
||||
dst->cache_entry.pipe = evas_common_pipe_add(dst->cache_entry.pipe, &op);
|
||||
if (!dst->cache_entry.pipe) return;
|
||||
op->op.grad.x = x;
|
||||
op->op.grad.y = y;
|
||||
op->op.grad.w = w;
|
||||
op->op.grad.h = h;
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
LKL(gr->ref_fq_add);
|
||||
gr->ref_fq[0]++;
|
||||
LKU(gr->ref_fq_add);
|
||||
#else
|
||||
gr->references++;
|
||||
#endif
|
||||
op->op.grad.grad = gr;
|
||||
op->op_func = evas_common_pipe_grad_draw_do;
|
||||
op->free_func = evas_common_pipe_op_grad_free;
|
||||
evas_common_pipe_draw_context_copy(dc, op);
|
||||
}
|
||||
|
||||
/**************** GRAD2 ******************/
|
||||
static void
|
||||
evas_common_pipe_op_grad2_free(RGBA_Pipe_Op *op)
|
||||
{
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
LKL(op->op.grad2.grad->ref_fq_del);
|
||||
op->op.grad2.grad->ref_fq[1]++;
|
||||
LKU(op->op.grad2.grad->ref_fq_del);
|
||||
pthread_cond_signal(&(op->op.grad2.grad->cond_fq_del));
|
||||
#else
|
||||
evas_common_gradient2_free(op->op.grad2.grad);
|
||||
#endif
|
||||
evas_common_pipe_op_free(op);
|
||||
}
|
||||
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
EAPI void
|
||||
evas_common_pipe_op_grad2_flush(RGBA_Gradient2 *gr)
|
||||
{
|
||||
if (! evas_common_frameq_enabled())
|
||||
return;
|
||||
|
||||
LKL(gr->ref_fq_add);
|
||||
LKL(gr->ref_fq_del);
|
||||
|
||||
while (gr->ref_fq[0] != gr->ref_fq[1])
|
||||
pthread_cond_wait(&(gr->cond_fq_del), &(gr->ref_fq_del));
|
||||
|
||||
LKU(gr->ref_fq_del);
|
||||
LKU(gr->ref_fq_add);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
evas_common_pipe_grad2_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thread_Info *info)
|
||||
{
|
||||
if (info)
|
||||
{
|
||||
RGBA_Draw_Context context;
|
||||
|
||||
memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context));
|
||||
#ifdef EVAS_SLI
|
||||
evas_common_draw_context_set_sli(&(context), info->y, info->h);
|
||||
#else
|
||||
evas_common_draw_context_clip_clip(&(context), info->x, info->y, info->w, info->h);
|
||||
#endif
|
||||
evas_common_gradient2_draw(dst, &(context),
|
||||
op->op.grad2.x, op->op.grad2.y,
|
||||
op->op.grad2.w, op->op.grad2.h,
|
||||
op->op.grad2.grad);
|
||||
}
|
||||
else
|
||||
{
|
||||
evas_common_gradient2_draw(dst, &(op->context),
|
||||
op->op.grad2.x, op->op.grad2.y,
|
||||
op->op.grad2.w, op->op.grad2.h,
|
||||
op->op.grad2.grad);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
evas_common_pipe_grad2_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
|
||||
int x, int y, int w, int h, RGBA_Gradient2 *gr)
|
||||
{
|
||||
RGBA_Pipe_Op *op;
|
||||
|
||||
if (!gr) return;
|
||||
dst->cache_entry.pipe = evas_common_pipe_add(dst->cache_entry.pipe, &op);
|
||||
if (!dst->cache_entry.pipe) return;
|
||||
op->op.grad2.x = x;
|
||||
op->op.grad2.y = y;
|
||||
op->op.grad2.w = w;
|
||||
op->op.grad2.h = h;
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
LKL(gr->ref_fq_add);
|
||||
gr->ref_fq[0]++;
|
||||
LKU(gr->ref_fq_add);
|
||||
#else
|
||||
gr->references++;
|
||||
#endif
|
||||
op->op.grad2.grad = gr;
|
||||
op->op_func = evas_common_pipe_grad2_draw_do;
|
||||
op->free_func = evas_common_pipe_op_grad2_free;
|
||||
evas_common_pipe_draw_context_copy(dc, op);
|
||||
}
|
||||
|
||||
/**************** TEXT ******************/
|
||||
static void
|
||||
evas_common_pipe_op_text_free(RGBA_Pipe_Op *op)
|
||||
|
|
|
@ -87,8 +87,6 @@ EAPI void evas_common_pipe_free(RGBA_Image *im);
|
|||
EAPI void evas_common_pipe_rectangle_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h);
|
||||
EAPI void evas_common_pipe_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1);
|
||||
EAPI void evas_common_pipe_poly_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
|
||||
EAPI void evas_common_pipe_grad_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h, RGBA_Gradient *gr);
|
||||
EAPI void evas_common_pipe_grad2_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h, RGBA_Gradient2 *gr);
|
||||
EAPI void evas_common_pipe_text_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int x, int y, const Eina_Unicode *text, const Evas_BiDi_Props *intl_props);
|
||||
EAPI void evas_common_pipe_image_load(RGBA_Image *im);
|
||||
EAPI void evas_common_pipe_image_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int smooth, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
|
||||
|
@ -98,8 +96,6 @@ EAPI void evas_common_pipe_map4_draw(RGBA_Image *src, RGBA_Image *dst,
|
|||
EAPI void evas_common_pipe_flush(RGBA_Image *im);
|
||||
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
EAPI void evas_common_pipe_op_grad_flush(RGBA_Gradient *gr);
|
||||
EAPI void evas_common_pipe_op_grad2_flush(RGBA_Gradient2 *gr);
|
||||
EAPI void evas_common_pipe_op_text_flush(RGBA_Font *fn);
|
||||
EAPI void evas_common_pipe_op_image_flush(RGBA_Image *im);
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,6 @@ typedef struct _Evas_Cairo_Context Evas_Cairo_Context;
|
|||
typedef struct _Evas_Cairo_Image Evas_Cairo_Image;
|
||||
typedef struct _Evas_Cairo_Polygon Evas_Cairo_Polygon;
|
||||
typedef struct _Evas_Cairo_Polygon_Point Evas_Cairo_Polygon_Point;
|
||||
typedef struct _Evas_Cairo_Gradient Evas_Cairo_Gradient;
|
||||
|
||||
struct _Evas_Cairo_Context
|
||||
{
|
||||
|
@ -114,11 +113,6 @@ struct _Evas_Cairo_Polygon_Point
|
|||
{
|
||||
int x, y;
|
||||
};
|
||||
|
||||
struct _Evas_Cairo_Gradient
|
||||
{
|
||||
RGBA_Gradient *grad;
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -150,16 +144,12 @@ void evas_gl_common_image_dirty(Evas_GL_Image *im);
|
|||
Evas_GL_Polygon *evas_gl_common_poly_point_add(Evas_GL_Polygon *poly, int x, int y);
|
||||
Evas_GL_Polygon *evas_gl_common_poly_points_clear(Evas_GL_Polygon *poly);
|
||||
|
||||
Evas_GL_Gradient *evas_gl_common_gradient_color_add(Evas_GL_Gradient *gr, int r, int g, int b, int a, int distance);
|
||||
Evas_GL_Gradient *evas_gl_common_gradient_colors_clear(Evas_GL_Gradient *gr);
|
||||
|
||||
void evas_gl_common_swap_rect(Evas_GL_Context *gc, int x, int y, int w, int h);
|
||||
|
||||
void evas_gl_common_rect_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, int x, int y, int w, int h);
|
||||
void evas_gl_common_image_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
|
||||
void evas_gl_common_line_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
|
||||
void evas_gl_common_poly_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, Evas_GL_Polygon *poly);
|
||||
void evas_gl_common_gradient_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, Evas_GL_Gradient *gr, int x, int y, int w, int h, double angle);
|
||||
|
||||
Evas_GL_Font_Texture *evas_gl_font_texture_new(Evas_GL_Context *gc, RGBA_Font_Glyph *fg);
|
||||
void evas_gl_font_texture_free(Evas_GL_Font_Texture *ft);
|
||||
|
|
|
@ -379,13 +379,6 @@ typedef struct _RGBA_Pipe_Thread_Info RGBA_Pipe_Thread_Info;
|
|||
typedef struct _RGBA_Image RGBA_Image;
|
||||
typedef struct _RGBA_Image_Span RGBA_Image_Span;
|
||||
typedef struct _RGBA_Draw_Context RGBA_Draw_Context;
|
||||
typedef struct _RGBA_Gradient RGBA_Gradient;
|
||||
typedef struct _RGBA_Gradient_Color_Stop RGBA_Gradient_Color_Stop;
|
||||
typedef struct _RGBA_Gradient_Alpha_Stop RGBA_Gradient_Alpha_Stop;
|
||||
typedef struct _RGBA_Gradient_Type RGBA_Gradient_Type;
|
||||
typedef struct _RGBA_Gradient2 RGBA_Gradient2;
|
||||
typedef struct _RGBA_Gradient2_Type RGBA_Gradient2_Type;
|
||||
typedef struct _RGBA_Gradient2_Color_Np_Stop RGBA_Gradient2_Color_Np_Stop;
|
||||
typedef struct _RGBA_Polygon_Point RGBA_Polygon_Point;
|
||||
typedef struct _RGBA_Map_Point RGBA_Map_Point;
|
||||
typedef struct _RGBA_Font RGBA_Font;
|
||||
|
@ -427,16 +420,6 @@ typedef void (*Gfx_Func_Copy) (DATA32 *src, DATA32 *dst, int len);
|
|||
|
||||
typedef void (*Gfx_Func_Convert) (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
|
||||
|
||||
typedef void (*Gfx_Func_Gradient_Fill)(DATA32 *src, int src_len,
|
||||
DATA32 *dst, DATA8 *mask, int len,
|
||||
int x, int y, int axx, int axy, int ayx, int ayy,
|
||||
void *geom_data);
|
||||
|
||||
typedef void (*Gfx_Func_Gradient2_Fill)(DATA32 *src, int src_len,
|
||||
DATA32 *dst, DATA8 *mask, int len,
|
||||
int x, int y,
|
||||
void *geom_data);
|
||||
|
||||
#include "../cache/evas_cache.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -688,14 +671,6 @@ struct _RGBA_Pipe_Op
|
|||
struct {
|
||||
RGBA_Polygon_Point *points;
|
||||
} poly;
|
||||
struct {
|
||||
RGBA_Gradient *grad;
|
||||
int x, y, w, h;
|
||||
} grad;
|
||||
struct {
|
||||
RGBA_Gradient2 *grad;
|
||||
int x, y, w, h;
|
||||
} grad2;
|
||||
struct {
|
||||
RGBA_Font *font;
|
||||
int x, y;
|
||||
|
@ -776,150 +751,6 @@ struct _RGBA_Image
|
|||
} cache;
|
||||
};
|
||||
|
||||
struct _RGBA_Gradient_Color_Stop
|
||||
{
|
||||
EINA_INLIST;
|
||||
int r, g, b, a;
|
||||
int dist;
|
||||
};
|
||||
|
||||
struct _RGBA_Gradient_Alpha_Stop
|
||||
{
|
||||
EINA_INLIST;
|
||||
int a;
|
||||
int dist;
|
||||
};
|
||||
|
||||
struct _RGBA_Gradient
|
||||
{
|
||||
struct
|
||||
{
|
||||
DATA32 *data;
|
||||
int len;
|
||||
float angle;
|
||||
int direction;
|
||||
float offset;
|
||||
Eina_Bool has_alpha : 1;
|
||||
} map;
|
||||
|
||||
struct {
|
||||
Eina_Inlist *stops;
|
||||
DATA32 *data;
|
||||
int nstops;
|
||||
int len;
|
||||
} color;
|
||||
struct {
|
||||
Eina_Inlist *stops;
|
||||
DATA8 *data;
|
||||
int nstops;
|
||||
int len;
|
||||
} alpha;
|
||||
|
||||
struct
|
||||
{
|
||||
int x, y, w, h;
|
||||
int spread;
|
||||
float angle;
|
||||
} fill;
|
||||
struct
|
||||
{
|
||||
char *name;
|
||||
char *params;
|
||||
RGBA_Gradient_Type *geometer;
|
||||
void *gdata;
|
||||
} type;
|
||||
|
||||
int references;
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
LK(ref_fq_add);
|
||||
LK(ref_fq_del);
|
||||
pthread_cond_t cond_fq_del;
|
||||
int ref_fq[2]; //ref_fq[0] is for addition,
|
||||
//ref_fq[1] is for deletion
|
||||
#endif
|
||||
|
||||
Eina_Bool imported_data : 1;
|
||||
Eina_Bool has_alpha : 1;
|
||||
};
|
||||
|
||||
struct _RGBA_Gradient_Type
|
||||
{
|
||||
const char *name;
|
||||
void (*init)(void);
|
||||
void (*shutdown)(void);
|
||||
void (*geom_init)(RGBA_Gradient *gr);
|
||||
void (*geom_set)(RGBA_Gradient *gr);
|
||||
void (*geom_free)(void *gdata);
|
||||
int (*has_alpha)(RGBA_Gradient *gr, int render_op);
|
||||
int (*has_mask)(RGBA_Gradient *gr, int render_op);
|
||||
int (*get_map_len)(RGBA_Gradient *gr);
|
||||
Gfx_Func_Gradient_Fill (*get_fill_func)(RGBA_Gradient *gr, int render_op, unsigned char aa);
|
||||
};
|
||||
|
||||
struct _RGBA_Gradient2_Color_Np_Stop
|
||||
{
|
||||
EINA_INLIST;
|
||||
int r, g, b, a;
|
||||
float pos;
|
||||
int dist;
|
||||
};
|
||||
|
||||
struct _RGBA_Gradient2
|
||||
{
|
||||
struct
|
||||
{
|
||||
DATA32 *data;
|
||||
int len;
|
||||
Eina_Bool has_alpha : 1;
|
||||
} map;
|
||||
|
||||
struct {
|
||||
Eina_Inlist *stops;
|
||||
int nstops;
|
||||
DATA32 *cdata;
|
||||
DATA8 *adata;
|
||||
int len;
|
||||
} stops;
|
||||
|
||||
struct
|
||||
{
|
||||
Evas_Common_Transform transform;
|
||||
int spread;
|
||||
} fill;
|
||||
struct
|
||||
{
|
||||
int id;
|
||||
RGBA_Gradient2_Type *geometer;
|
||||
void *gdata;
|
||||
} type;
|
||||
|
||||
int references;
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
LK(ref_fq_add);
|
||||
LK(ref_fq_del);
|
||||
pthread_cond_t cond_fq_del;
|
||||
int ref_fq[2]; //ref_fq[0] is for addition,
|
||||
//ref_fq[1] is for deletion
|
||||
#endif
|
||||
|
||||
Eina_Bool has_alpha : 1;
|
||||
};
|
||||
|
||||
struct _RGBA_Gradient2_Type
|
||||
{
|
||||
const char *name;
|
||||
void (*init)(void);
|
||||
void (*shutdown)(void);
|
||||
void (*geom_init)(RGBA_Gradient2 *gr);
|
||||
void (*geom_update)(RGBA_Gradient2 *gr);
|
||||
void (*geom_free)(void *gdata);
|
||||
int (*has_alpha)(RGBA_Gradient2 *gr, int render_op);
|
||||
int (*has_mask)(RGBA_Gradient2 *gr, int render_op);
|
||||
int (*get_map_len)(RGBA_Gradient2 *gr);
|
||||
Gfx_Func_Gradient2_Fill (*get_fill_func)(RGBA_Gradient2 *gr, int render_op);
|
||||
};
|
||||
|
||||
|
||||
struct _RGBA_Polygon_Point
|
||||
{
|
||||
EINA_INLIST;
|
||||
|
@ -1283,7 +1114,6 @@ EAPI void evas_common_blit_init (void);
|
|||
EAPI void evas_common_blit_rectangle (const RGBA_Image *src, RGBA_Image *dst, int src_x, int src_y, int w, int h, int dst_x, int dst_y);
|
||||
|
||||
/****/
|
||||
#include "../engines/common/evas_gradient.h"
|
||||
#include "../engines/common/evas_font.h"
|
||||
|
||||
/****/
|
||||
|
|
|
@ -57,15 +57,12 @@ typedef struct _Evas_Post_Callback Evas_Post_Callback;
|
|||
#define MAGIC_OBJ 0x71777770
|
||||
#define MAGIC_OBJ_RECTANGLE 0x71777771
|
||||
#define MAGIC_OBJ_LINE 0x71777772
|
||||
#define MAGIC_OBJ_GRADIENT 0x71777773
|
||||
#define MAGIC_OBJ_POLYGON 0x71777774
|
||||
#define MAGIC_OBJ_IMAGE 0x71777775
|
||||
#define MAGIC_OBJ_TEXT 0x71777776
|
||||
#define MAGIC_OBJ_SMART 0x71777777
|
||||
#define MAGIC_OBJ_TEXTBLOCK 0x71777778
|
||||
#define MAGIC_SMART 0x72777770
|
||||
#define MAGIC_OBJ_GRADIENT_LINEAR 0x72777771
|
||||
#define MAGIC_OBJ_GRADIENT_RADIAL 0x72777772
|
||||
#define MAGIC_OBJ_SHAPE 0x72777773
|
||||
#define MAGIC_OBJ_CONTAINER 0x72777774
|
||||
#define MAGIC_OBJ_CUSTOM 0x72777775
|
||||
|
@ -624,49 +621,6 @@ struct _Evas_Func
|
|||
void *(*polygon_points_clear) (void *data, void *context, void *polygon);
|
||||
void (*polygon_draw) (void *data, void *context, void *surface, void *polygon, int x, int y);
|
||||
|
||||
void (*gradient2_color_np_stop_insert) (void *data, void *gradient, int r, int g, int b, int a, float pos);
|
||||
void (*gradient2_clear) (void *data, void *gradient);
|
||||
void (*gradient2_fill_transform_set) (void *data, void *gradient, void *transform);
|
||||
void (*gradient2_fill_spread_set) (void *data, void *gradient, int spread);
|
||||
|
||||
void *(*gradient2_linear_new) (void *data);
|
||||
void (*gradient2_linear_free) (void *data, void *linear_gradient);
|
||||
void (*gradient2_linear_fill_set) (void *data, void *linear_gradient, float x0, float y0, float x1, float y1);
|
||||
int (*gradient2_linear_is_opaque) (void *data, void *context, void *linear_gradient, int x, int y, int w, int h);
|
||||
int (*gradient2_linear_is_visible) (void *data, void *context, void *linear_gradient, int x, int y, int w, int h);
|
||||
void (*gradient2_linear_render_pre) (void *data, void *context, void *linear_gradient);
|
||||
void (*gradient2_linear_render_post) (void *data, void *linear_gradient);
|
||||
void (*gradient2_linear_draw) (void *data, void *context, void *surface, void *linear_gradient, int x, int y, int w, int h);
|
||||
|
||||
void *(*gradient2_radial_new) (void *data);
|
||||
void (*gradient2_radial_free) (void *data, void *radial_gradient);
|
||||
void (*gradient2_radial_fill_set) (void *data, void *radial_gradient, float cx, float cy, float rx, float ry);
|
||||
int (*gradient2_radial_is_opaque) (void *data, void *context, void *radial_gradient, int x, int y, int w, int h);
|
||||
int (*gradient2_radial_is_visible) (void *data, void *context, void *radial_gradient, int x, int y, int w, int h);
|
||||
void (*gradient2_radial_render_pre) (void *data, void *context, void *radial_gradient);
|
||||
void (*gradient2_radial_render_post) (void *data, void *radial_gradient);
|
||||
void (*gradient2_radial_draw) (void *data, void *context, void *surface, void *radial_gradient, int x, int y, int w, int h);
|
||||
|
||||
void *(*gradient_new) (void *data);
|
||||
void (*gradient_free) (void *data, void *gradient);
|
||||
void (*gradient_color_stop_add) (void *data, void *gradient, int r, int g, int b, int a, int delta);
|
||||
void (*gradient_alpha_stop_add) (void *data, void *gradient, int a, int delta);
|
||||
void (*gradient_color_data_set) (void *data, void *gradient, void *map, int len, int alpha_flag);
|
||||
void (*gradient_alpha_data_set) (void *data, void *gradient, void *alpha_map, int len);
|
||||
void (*gradient_clear) (void *data, void *gradient);
|
||||
void (*gradient_fill_set) (void *data, void *gradient, int x, int y, int w, int h);
|
||||
void (*gradient_fill_angle_set) (void *data, void *gradient, double fill_angle);
|
||||
void (*gradient_fill_spread_set) (void *data, void *gradient, int spread);
|
||||
void (*gradient_angle_set) (void *data, void *gradient, double angle);
|
||||
void (*gradient_offset_set) (void *data, void *gradient, float offset);
|
||||
void (*gradient_direction_set) (void *data, void *gradient, int direction);
|
||||
void (*gradient_type_set) (void *data, void *gradient, char *name, char *params);
|
||||
int (*gradient_is_opaque) (void *data, void *context, void *gradient, int x, int y, int w, int h);
|
||||
int (*gradient_is_visible) (void *data, void *context, void *gradient, int x, int y, int w, int h);
|
||||
void (*gradient_render_pre) (void *data, void *context, void *gradient);
|
||||
void (*gradient_render_post) (void *data, void *gradient);
|
||||
void (*gradient_draw) (void *data, void *context, void *surface, void *gradient, int x, int y, int w, int h);
|
||||
|
||||
void *(*image_load) (void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo);
|
||||
void *(*image_new_from_data) (void *data, int w, int h, DATA32 *image_data, int alpha, int cspace);
|
||||
void *(*image_new_from_copied_data) (void *data, int w, int h, DATA32 *image_data, int alpha, int cspace);
|
||||
|
|
|
@ -186,9 +186,6 @@ evas_debug_magic_string_get(DATA32 magic)
|
|||
case MAGIC_OBJ_LINE:
|
||||
return "Evas_Object (Line)";
|
||||
break;
|
||||
case MAGIC_OBJ_GRADIENT:
|
||||
return "Evas_Object (Gradient)";
|
||||
break;
|
||||
case MAGIC_OBJ_POLYGON:
|
||||
return "Evas_Object (Polygon)";
|
||||
break;
|
||||
|
|
|
@ -74,7 +74,6 @@ _output_setup(int w,
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -51,26 +51,6 @@ static void *eng_polygon_point_add(void *data, void *context, void *polygon, int
|
|||
static void *eng_polygon_points_clear(void *data, void *context, void *polygon);
|
||||
static void eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y);
|
||||
|
||||
static void *eng_gradient_new(void *data);
|
||||
static void eng_gradient_free(void *data, void *gradient);
|
||||
static void eng_gradient_color_stop_add(void *data, void *gradient, int r, int g, int b, int a, int delta);
|
||||
static void eng_gradient_alpha_stop_add(void *data, void *gradient, int a, int delta);
|
||||
static void eng_gradient_color_data_set(void *data, void *gradient, void *map, int len, int has_alpha);
|
||||
static void eng_gradient_alpha_data_set(void *data, void *gradient, void *alpha_map, int len);
|
||||
static void eng_gradient_clear(void *data, void *gradient);
|
||||
static void eng_gradient_fill_set(void *data, void *gradient, int x, int y, int w, int h);
|
||||
static void eng_gradient_fill_angle_set(void *data, void *gradient, double angle);
|
||||
static void eng_gradient_fill_spread_set(void *data, void *gradient, int spread);
|
||||
static void eng_gradient_angle_set(void *data, void *gradient, double angle);
|
||||
static void eng_gradient_offset_set(void *data, void *gradient, float offset);
|
||||
static void eng_gradient_direction_set(void *data, void *gradient, int direction);
|
||||
static void eng_gradient_type_set(void *data, void *gradient, char *name, char *params);
|
||||
static int eng_gradient_is_opaque(void *data, void *context, void *gradient, int x, int y, int w, int h);
|
||||
static int eng_gradient_is_visible(void *data, void *context, void *gradient, int x, int y, int w, int h);
|
||||
static void eng_gradient_render_pre(void *data, void *context, void *gradient);
|
||||
static void eng_gradient_render_post(void *data, void *gradient);
|
||||
static void eng_gradient_draw(void *data, void *context, void *surface, void *gradient, int x, int y, int w, int h);
|
||||
|
||||
static void *eng_image_load(void *data, char *file, char *key, int *error, Evas_Image_Load_Opts *lo);
|
||||
static void *eng_image_new_from_data(void *data, int w, int h, DATA32 *image_data, int alpha, int cspace);
|
||||
static void *eng_image_new_from_copied_data(void *data, int w, int h, DATA32 *image_data, int alpha, int cspace);
|
||||
|
@ -174,26 +154,6 @@ static Evas_Func eng_func =
|
|||
eng_polygon_point_add,
|
||||
eng_polygon_points_clear,
|
||||
eng_polygon_draw,
|
||||
/* gradient draw funcs */
|
||||
eng_gradient_new,
|
||||
eng_gradient_free,
|
||||
eng_gradient_color_stop_add,
|
||||
eng_gradient_alpha_stop_add,
|
||||
eng_gradient_color_data_set,
|
||||
eng_gradient_alpha_data_set,
|
||||
eng_gradient_clear,
|
||||
eng_gradient_fill_set,
|
||||
eng_gradient_fill_angle_set,
|
||||
eng_gradient_fill_spread_set,
|
||||
eng_gradient_angle_set,
|
||||
eng_gradient_offset_set,
|
||||
eng_gradient_direction_set,
|
||||
eng_gradient_type_set,
|
||||
eng_gradient_is_opaque,
|
||||
eng_gradient_is_visible,
|
||||
eng_gradient_render_pre,
|
||||
eng_gradient_render_post,
|
||||
eng_gradient_draw,
|
||||
/* image draw funcs */
|
||||
eng_image_load,
|
||||
eng_image_new_from_data,
|
||||
|
@ -328,7 +288,6 @@ eng_output_setup(int w, int h, Display *disp, Drawable draw, Visual *vis, Colorm
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
@ -797,117 +756,6 @@ eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x,
|
|||
cairo_stroke(ctxt->cairo);
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient_new(void *data)
|
||||
{
|
||||
return evas_common_gradient_new();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_stop_add(void *data, void *gradient, int r, int g, int b, int a, int delta)
|
||||
{
|
||||
evas_common_gradient_color_stop_add(gradient, r, g, b, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_stop_add(void *data, void *gradient, int a, int delta)
|
||||
{
|
||||
evas_common_gradient_alpha_stop_add(gradient, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_clear(void *data, void *gradient)
|
||||
{
|
||||
evas_common_gradient_clear(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_data_set(void *data, void *gradient, void *map, int len, int has_alpha)
|
||||
{
|
||||
evas_common_gradient_color_data_set(gradient, map, len, has_alpha);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_data_set(void *data, void *gradient, void *alpha_map, int len)
|
||||
{
|
||||
evas_common_gradient_alpha_data_set(gradient, alpha_map, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_free(void *data, void *gradient)
|
||||
{
|
||||
evas_common_gradient_free(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_set(void *data, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
evas_common_gradient_fill_set(gradient, x, y, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_angle_set(void *data, void *gradient, double angle)
|
||||
{
|
||||
evas_common_gradient_fill_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_spread_set(void *data, void *gradient, int spread)
|
||||
{
|
||||
evas_common_gradient_fill_spread_set(gradient, spread);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_angle_set(void *data, void *gradient, double angle)
|
||||
{
|
||||
evas_common_gradient_map_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_offset_set(void *data, void *gradient, float offset)
|
||||
{
|
||||
evas_common_gradient_map_offset_set(gradient, offset);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_direction_set(void *data, void *gradient, int direction)
|
||||
{
|
||||
evas_common_gradient_map_direction_set(gradient, direction);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_type_set(void *data, void *gradient, char *name, char *params)
|
||||
{
|
||||
evas_common_gradient_type_set(gradient, name, params);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_opaque(void *data, void *context, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_visible(void *data, void *context, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_pre(void *data, void *context, void *gradient)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_post(void *data, void *gradient)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_draw(void *data, void *context, void *surface, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_image_load(void *data, char *file, char *key, int *error, Evas_Image_Load_Opts *lo)
|
||||
{
|
||||
|
|
|
@ -51,7 +51,6 @@ _output_setup(int width, int height, int rotation, HWND window, int depth, int f
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
@ -415,119 +414,6 @@ eng_font_free(void *data, void *font)
|
|||
evas_direct3d_font_free(re->d3d, font);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Gradients
|
||||
//
|
||||
|
||||
static void
|
||||
eng_gradient2_color_np_stop_insert(void *data, void *gradient, int r, int g, int b, int a, float pos)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_clear(void *data, void *gradient)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_transform_set(void *data, void *gradient, void *transform)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_spread_set(void *data, void *gradient, int spread)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_linear_new(void *data)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_free(void *data, void *linear_gradient)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_fill_set(void *data, void *linear_gradient, int x0, int y0, int x1, int y1)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_opaque(void *data, void *context, void *linear_gradient, int x, int y, int w, int h)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_visible(void *data, void *context, void *linear_gradient, int x, int y, int w, int h)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_pre(void *data, void *context, void *linear_gradient)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_post(void *data, void *linear_gradient)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_draw(void *data, void *context, void *surface, void *linear_gradient, int x, int y, int w, int h)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_radial_new(void *data)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_free(void *data, void *radial_gradient)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_fill_set(void *data, void *radial_gradient, float cx, float cy, float rx, float ry)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_opaque(void *data, void *context, void *radial_gradient, int x, int y, int w, int h)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_visible(void *data, void *context, void *radial_gradient, int x, int y, int w, int h)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_pre(void *data, void *context, void *radial_gradient)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_post(void *data, void *radial_gradient)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_draw(void *data, void *context, void *surface, void *radial_gradient, int x, int y, int w, int h)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* module advertising code */
|
||||
static int
|
||||
module_open(Evas_Module *em)
|
||||
|
@ -586,28 +472,6 @@ module_open(Evas_Module *em)
|
|||
// ORD(image_map_surface_new);
|
||||
// ORD(image_map_surface_free);
|
||||
|
||||
/*
|
||||
ORD(gradient2_color_np_stop_insert);
|
||||
ORD(gradient2_clear);
|
||||
ORD(gradient2_fill_transform_set);
|
||||
ORD(gradient2_fill_spread_set);
|
||||
ORD(gradient2_linear_new);
|
||||
ORD(gradient2_linear_free);
|
||||
ORD(gradient2_linear_fill_set);
|
||||
ORD(gradient2_linear_is_opaque);
|
||||
ORD(gradient2_linear_is_visible);
|
||||
ORD(gradient2_linear_render_pre);
|
||||
ORD(gradient2_linear_render_post);
|
||||
ORD(gradient2_linear_draw);
|
||||
ORD(gradient2_radial_new);
|
||||
ORD(gradient2_radial_free);
|
||||
ORD(gradient2_radial_fill_set);
|
||||
ORD(gradient2_radial_is_opaque);
|
||||
ORD(gradient2_radial_is_visible);
|
||||
ORD(gradient2_radial_render_pre);
|
||||
ORD(gradient2_radial_render_post);
|
||||
ORD(gradient2_radial_draw);
|
||||
*/
|
||||
/* now advertise out own api */
|
||||
em->functions = (void *)(&func);
|
||||
return 1;
|
||||
|
|
|
@ -738,7 +738,6 @@ _evas_common_init(void)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
@ -1168,29 +1167,6 @@ evas_engine_dfb_polygon_draw(void *data, void *context, void *surface, void *pol
|
|||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
evas_engine_dfb_gradient_draw(void *data, void *context, void *surface, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
DirectFB_Engine_Image_Entry *eim = surface;
|
||||
IDirectFBSurface *screen;
|
||||
Render_Engine *re = data;
|
||||
RGBA_Image *dst, *src;
|
||||
|
||||
dst = (RGBA_Image *)eim->cache_entry.src;
|
||||
screen = eim->surface;
|
||||
if (!_dfb_lock_and_sync_image(screen, dst, DSLF_READ | DSLF_WRITE))
|
||||
return;
|
||||
|
||||
evas_common_gradient_draw(dst, context, x, y, w, h, gradient);
|
||||
evas_common_cpu_end_opt();
|
||||
|
||||
dst->image.data = NULL;
|
||||
|
||||
screen->Unlock(screen);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** Image Object *******************************************************/
|
||||
static void *
|
||||
evas_engine_dfb_image_load(void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo)
|
||||
|
@ -1742,7 +1718,6 @@ module_open(Evas_Module *em)
|
|||
ORD(line_draw);
|
||||
ORD(rectangle_draw);
|
||||
ORD(polygon_draw);
|
||||
ORD(gradient_draw);
|
||||
ORD(image_scale_hint_set);
|
||||
ORD(image_scale_hint_get);
|
||||
|
||||
|
|
|
@ -54,7 +54,6 @@ _output_setup(int w, int h, int rot, int vt, int dev, int refresh)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -111,9 +111,6 @@ typedef struct _Evas_GL_Image Evas_GL_Image;
|
|||
typedef struct _Evas_GL_Font_Texture Evas_GL_Font_Texture;
|
||||
typedef struct _Evas_GL_Polygon Evas_GL_Polygon;
|
||||
typedef struct _Evas_GL_Polygon_Point Evas_GL_Polygon_Point;
|
||||
/*
|
||||
typedef struct _Evas_GL_Gradient Evas_GL_Gradient;
|
||||
*/
|
||||
|
||||
struct _Evas_GL_Program
|
||||
{
|
||||
|
@ -331,16 +328,6 @@ struct _Evas_GL_Polygon_Point
|
|||
int x, y;
|
||||
};
|
||||
|
||||
/*
|
||||
struct _Evas_GL_Gradient
|
||||
{
|
||||
RGBA_Gradient *grad;
|
||||
Evas_GL_Texture *tex;
|
||||
int tw, th;
|
||||
unsigned char changed : 1;
|
||||
};
|
||||
*/
|
||||
|
||||
extern Evas_GL_Program_Source shader_rect_frag_src;
|
||||
extern Evas_GL_Program_Source shader_rect_vert_src;
|
||||
extern Evas_GL_Program_Source shader_font_frag_src;
|
||||
|
|
|
@ -66,7 +66,6 @@ eng_setup(Evas *e, void *in)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
@ -336,244 +335,6 @@ eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x,
|
|||
//--// evas_gl_common_poly_draw(re->window->gl_context, polygon, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_color_np_stop_insert(void *data __UNUSED__, void *gradient __UNUSED__, int r __UNUSED__, int g __UNUSED__, int b __UNUSED__, int a __UNUSED__, float pos __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_clear(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_transform_set(void *data __UNUSED__, void *gradient __UNUSED__, void *transform __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_spread_set
|
||||
(void *data __UNUSED__, void *gradient __UNUSED__, int spread __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_linear_new(void *data __UNUSED__)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_free(void *data __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_fill_set(void *data __UNUSED__, void *linear_gradient __UNUSED__, int x0 __UNUSED__, int y0 __UNUSED__, int x1 __UNUSED__, int y1 __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_post(void *data __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_radial_new(void *data __UNUSED__)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_free(void *data __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_fill_set(void *data __UNUSED__, void *radial_gradient __UNUSED__, float cx __UNUSED__, float cy __UNUSED__, float rx __UNUSED__, float ry __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_post(void *data __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient_new(void *data __UNUSED__)
|
||||
{
|
||||
//--// return evas_gl_common_gradient_new();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_stop_add(void *data __UNUSED__, void *gradient, int r, int g, int b, int a, int delta)
|
||||
{
|
||||
//--// evas_gl_common_gradient_color_stop_add(gradient, r, g, b, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_stop_add(void *data __UNUSED__, void *gradient, int a, int delta)
|
||||
{
|
||||
//--// evas_gl_common_gradient_alpha_stop_add(gradient, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_clear(void *data __UNUSED__, void *gradient)
|
||||
{
|
||||
//--// evas_gl_common_gradient_clear(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_data_set(void *data __UNUSED__, void *gradient, void *map, int len, int has_alpha)
|
||||
{
|
||||
//--// evas_gl_common_gradient_color_data_set(gradient, map, len, has_alpha);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_data_set(void *data __UNUSED__, void *gradient, void *alpha_map, int len)
|
||||
{
|
||||
//--// evas_gl_common_gradient_alpha_data_set(gradient, alpha_map, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_free(void *data __UNUSED__, void *gradient)
|
||||
{
|
||||
//--// evas_gl_common_gradient_free(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_set(void *data __UNUSED__, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
//--// evas_gl_common_gradient_fill_set(gradient, x, y, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_angle_set(void *data __UNUSED__, void *gradient, double angle)
|
||||
{
|
||||
//--// evas_gl_common_gradient_fill_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_spread_set(void *data __UNUSED__, void *gradient, int spread)
|
||||
{
|
||||
//--// evas_gl_common_gradient_fill_spread_set(gradient, spread);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_angle_set(void *data __UNUSED__, void *gradient, double angle)
|
||||
{
|
||||
//--// evas_gl_common_gradient_map_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_offset_set(void *data __UNUSED__, void *gradient, float offset)
|
||||
{
|
||||
//--// evas_gl_common_gradient_map_offset_set(gradient, offset);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_direction_set(void *data __UNUSED__, void *gradient, int direction)
|
||||
{
|
||||
//--// evas_gl_common_gradient_map_direction_set(gradient, direction);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_type_set(void *data __UNUSED__, void *gradient, char *name, char *params)
|
||||
{
|
||||
//--// evas_gl_common_gradient_type_set(gradient, name, params);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_opaque(void *data, void *context, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->window->gl_context->dc = context;
|
||||
//--// return evas_gl_common_gradient_is_opaque(re->window->gl_context, gradient, x, y, w, h);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_visible(void *data, void *context, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->window->gl_context->dc = context;
|
||||
//--// return evas_gl_common_gradient_is_visible(re->window->gl_context, gradient, x, y, w, h);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_pre(void *data, void *context, void *gradient)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->window->gl_context->dc = context;
|
||||
//--// evas_gl_common_gradient_render_pre(re->window->gl_context, gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_post(void *data __UNUSED__, void *gradient)
|
||||
{
|
||||
//--// evas_gl_common_gradient_render_post(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_draw(void *data, void *context, void *surface __UNUSED__, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
eng_window_use(re->window);
|
||||
re->window->gl_context->dc = context;
|
||||
//--// evas_gl_common_gradient_draw(re->window->gl_context, gradient, x, y, w, h);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_image_alpha_get(void *data, void *image)
|
||||
{
|
||||
|
@ -1062,47 +823,6 @@ module_open(Evas_Module *em)
|
|||
ORD(polygon_points_clear);
|
||||
ORD(polygon_draw);
|
||||
|
||||
ORD(gradient2_color_np_stop_insert);
|
||||
ORD(gradient2_clear);
|
||||
ORD(gradient2_fill_transform_set);
|
||||
ORD(gradient2_fill_spread_set);
|
||||
ORD(gradient2_linear_new);
|
||||
ORD(gradient2_linear_free);
|
||||
ORD(gradient2_linear_fill_set);
|
||||
ORD(gradient2_linear_is_opaque);
|
||||
ORD(gradient2_linear_is_visible);
|
||||
ORD(gradient2_linear_render_pre);
|
||||
ORD(gradient2_linear_render_post);
|
||||
ORD(gradient2_linear_draw);
|
||||
ORD(gradient2_radial_new);
|
||||
ORD(gradient2_radial_free);
|
||||
ORD(gradient2_radial_fill_set);
|
||||
ORD(gradient2_radial_is_opaque);
|
||||
ORD(gradient2_radial_is_visible);
|
||||
ORD(gradient2_radial_render_pre);
|
||||
ORD(gradient2_radial_render_post);
|
||||
ORD(gradient2_radial_draw);
|
||||
|
||||
ORD(gradient_new);
|
||||
ORD(gradient_free);
|
||||
ORD(gradient_color_stop_add);
|
||||
ORD(gradient_alpha_stop_add);
|
||||
ORD(gradient_color_data_set);
|
||||
ORD(gradient_alpha_data_set);
|
||||
ORD(gradient_clear);
|
||||
ORD(gradient_fill_set);
|
||||
ORD(gradient_fill_angle_set);
|
||||
ORD(gradient_fill_spread_set);
|
||||
ORD(gradient_angle_set);
|
||||
ORD(gradient_offset_set);
|
||||
ORD(gradient_direction_set);
|
||||
ORD(gradient_type_set);
|
||||
ORD(gradient_is_opaque);
|
||||
ORD(gradient_is_visible);
|
||||
ORD(gradient_render_pre);
|
||||
ORD(gradient_render_post);
|
||||
ORD(gradient_draw);
|
||||
|
||||
ORD(image_load);
|
||||
ORD(image_new_from_data);
|
||||
ORD(image_new_from_copied_data);
|
||||
|
|
|
@ -341,363 +341,6 @@ eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x,
|
|||
evas_gl_common_poly_draw(re->gl_context, polygon, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_color_np_stop_insert(void *data __UNUSED__, void *gradient __UNUSED__, int r __UNUSED__, int g __UNUSED__, int b __UNUSED__, int a __UNUSED__, float pos __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_color_np_stop_insert(gradient, r, g, b, a, pos);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_clear(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_clear(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_transform_set(void *data __UNUSED__, void *gradient __UNUSED__, void *transform __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_fill_transform_set(gradient, transform);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_spread_set(void *data __UNUSED__, void *gradient __UNUSED__, int spread __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_fill_spread_set(gradient, spread);
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_linear_new(void *data __UNUSED__)
|
||||
{
|
||||
return evas_common_gradient2_linear_new();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_free(void *data __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_free(linear_gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_fill_set(void *data __UNUSED__, void *linear_gradient __UNUSED__, float x0 __UNUSED__, float y0 __UNUSED__, float x1 __UNUSED__, float y1 __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_linear_fill_set(linear_gradient, x0, y0, x1, y1);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient2 *gr = (RGBA_Gradient2 *)linear_gradient;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return 0;
|
||||
return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
|
||||
gr->type.geometer->has_mask(gr, dc->render_op));
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
|
||||
if (!dc || !linear_gradient) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient2 *gr = (RGBA_Gradient2 *)linear_gradient;
|
||||
int len;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return;
|
||||
gr->type.geometer->geom_update(gr);
|
||||
len = gr->type.geometer->get_map_len(gr);
|
||||
evas_common_gradient2_map(dc, gr, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_post(void *data __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
re->gl_context->dc = context;
|
||||
{
|
||||
Evas_GL_Image *gim;
|
||||
RGBA_Image *im;
|
||||
RGBA_Draw_Context *dc = context;
|
||||
int op = dc->render_op, cuse = dc->clip.use;
|
||||
|
||||
im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
|
||||
im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
|
||||
|
||||
dc->render_op = _EVAS_RENDER_FILL;
|
||||
dc->clip.use = 0;
|
||||
|
||||
// draw to buf, copy to tex, draw tex
|
||||
evas_common_gradient2_draw(im, dc, 0, 0, w, h, linear_gradient);
|
||||
|
||||
gim = evas_gl_common_image_new_from_data(re->gl_context, w, h,
|
||||
im->image.data, 1,
|
||||
EVAS_COLORSPACE_ARGB8888);
|
||||
dc->render_op = op;
|
||||
dc->clip.use = cuse;
|
||||
evas_gl_common_image_draw(re->gl_context, gim, 0, 0, w, h, x, y, w, h, 0);
|
||||
evas_cache_image_drop(&im->cache_entry);
|
||||
evas_gl_common_image_free(gim);
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_radial_new(void *data __UNUSED__)
|
||||
{
|
||||
return evas_common_gradient2_radial_new();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_free(void *data __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_free(radial_gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_fill_set(void *data __UNUSED__, void *radial_gradient __UNUSED__, float cx __UNUSED__, float cy __UNUSED__, float rx __UNUSED__, float ry __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_radial_fill_set(radial_gradient, cx, cy, rx, ry);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient2 *gr = (RGBA_Gradient2 *)radial_gradient;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return 0;
|
||||
return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
|
||||
gr->type.geometer->has_mask(gr, dc->render_op));
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
|
||||
if (!dc || !radial_gradient) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient2 *gr = (RGBA_Gradient2 *)radial_gradient;
|
||||
int len;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return;
|
||||
gr->type.geometer->geom_update(gr);
|
||||
len = gr->type.geometer->get_map_len(gr);
|
||||
evas_common_gradient2_map(dc, gr, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_post(void *data __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
re->gl_context->dc = context;
|
||||
{
|
||||
Evas_GL_Image *gim;
|
||||
RGBA_Image *im;
|
||||
RGBA_Draw_Context *dc = context;
|
||||
int op = dc->render_op, cuse = dc->clip.use;
|
||||
|
||||
im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
|
||||
im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
|
||||
|
||||
dc->render_op = _EVAS_RENDER_FILL;
|
||||
dc->clip.use = 0;
|
||||
|
||||
// draw to buf, copy to tex, draw tex
|
||||
evas_common_gradient2_draw(im, dc, 0, 0, w, h, radial_gradient);
|
||||
|
||||
gim = evas_gl_common_image_new_from_data(re->gl_context, w, h,
|
||||
im->image.data, 1,
|
||||
EVAS_COLORSPACE_ARGB8888);
|
||||
dc->render_op = op;
|
||||
dc->clip.use = cuse;
|
||||
evas_gl_common_image_draw(re->gl_context, gim, 0, 0, w, h, x, y, w, h, 0);
|
||||
evas_cache_image_drop(&im->cache_entry);
|
||||
evas_gl_common_image_free(gim);
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient_new(void *data __UNUSED__)
|
||||
{
|
||||
return evas_common_gradient_new();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_free(void *data __UNUSED__, void *gradient)
|
||||
{
|
||||
evas_common_gradient_free(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_stop_add(void *data __UNUSED__, void *gradient, int r, int g, int b, int a, int delta)
|
||||
{
|
||||
evas_common_gradient_color_stop_add(gradient, r, g, b, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_stop_add(void *data __UNUSED__, void *gradient, int a, int delta)
|
||||
{
|
||||
evas_common_gradient_alpha_stop_add(gradient, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_data_set(void *data __UNUSED__, void *gradient, void *map, int len, int has_alpha)
|
||||
{
|
||||
evas_common_gradient_color_data_set(gradient, map, len, has_alpha);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_data_set(void *data __UNUSED__, void *gradient, void *alpha_map, int len)
|
||||
{
|
||||
evas_common_gradient_alpha_data_set(gradient, alpha_map, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_clear(void *data __UNUSED__, void *gradient)
|
||||
{
|
||||
evas_common_gradient_clear(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_set(void *data __UNUSED__, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
evas_common_gradient_fill_set(gradient, x, y, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_angle_set(void *data __UNUSED__, void *gradient, double angle)
|
||||
{
|
||||
evas_common_gradient_fill_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_spread_set(void *data __UNUSED__, void *gradient, int spread)
|
||||
{
|
||||
evas_common_gradient_fill_spread_set(gradient, spread);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_angle_set(void *data __UNUSED__, void *gradient, double angle)
|
||||
{
|
||||
evas_common_gradient_map_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_offset_set(void *data __UNUSED__, void *gradient, float offset)
|
||||
{
|
||||
evas_common_gradient_map_offset_set(gradient, offset);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_direction_set(void *data __UNUSED__, void *gradient, int direction)
|
||||
{
|
||||
evas_common_gradient_map_direction_set(gradient, direction);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_type_set(void *data __UNUSED__, void *gradient, char *name, char *params)
|
||||
{
|
||||
evas_common_gradient_type_set(gradient, name, params);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_opaque(void *data, void *context, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return 0;
|
||||
return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
|
||||
gr->type.geometer->has_mask(gr, dc->render_op));
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_visible(void *data, void *context, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
|
||||
if (!dc || !gradient) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_pre(void *data, void *context, void *gradient)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
|
||||
int len;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return;
|
||||
gr->type.geometer->geom_set(gr);
|
||||
len = gr->type.geometer->get_map_len(gr);
|
||||
evas_common_gradient_map(dc, gr, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_post(void *data __UNUSED__, void *gradient)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_draw(void *data, void *context, void *surface __UNUSED__, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
re->gl_context->dc = context;
|
||||
{
|
||||
Evas_GL_Image *gim;
|
||||
RGBA_Image *im;
|
||||
RGBA_Draw_Context *dc = context;
|
||||
int op = dc->render_op, cuse = dc->clip.use;
|
||||
|
||||
im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
|
||||
im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
|
||||
|
||||
dc->render_op = _EVAS_RENDER_FILL;
|
||||
dc->clip.use = 0;
|
||||
|
||||
// draw to buf, copy to tex, draw tex
|
||||
evas_common_gradient_draw(im, dc, 0, 0, w, h, gradient);
|
||||
|
||||
gim = evas_gl_common_image_new_from_data(re->gl_context, w, h,
|
||||
im->image.data, 1,
|
||||
EVAS_COLORSPACE_ARGB8888);
|
||||
dc->render_op = op;
|
||||
dc->clip.use = cuse;
|
||||
evas_gl_common_image_draw(re->gl_context, gim, 0, 0, w, h, x, y, w, h, 0);
|
||||
evas_cache_image_drop(&im->cache_entry);
|
||||
evas_gl_common_image_free(gim);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
eng_image_alpha_get(void *data, void *image)
|
||||
{
|
||||
|
@ -1248,46 +891,6 @@ module_open(Evas_Module *em)
|
|||
ORD(polygon_points_clear);
|
||||
ORD(polygon_draw);
|
||||
|
||||
ORD(gradient2_color_np_stop_insert);
|
||||
ORD(gradient2_clear);
|
||||
ORD(gradient2_fill_transform_set);
|
||||
ORD(gradient2_fill_spread_set);
|
||||
ORD(gradient2_linear_new);
|
||||
ORD(gradient2_linear_free);
|
||||
ORD(gradient2_linear_fill_set);
|
||||
ORD(gradient2_linear_is_opaque);
|
||||
ORD(gradient2_linear_is_visible);
|
||||
ORD(gradient2_linear_render_pre);
|
||||
ORD(gradient2_linear_render_post);
|
||||
ORD(gradient2_linear_draw);
|
||||
ORD(gradient2_radial_new);
|
||||
ORD(gradient2_radial_free);
|
||||
ORD(gradient2_radial_fill_set);
|
||||
ORD(gradient2_radial_is_opaque);
|
||||
ORD(gradient2_radial_is_visible);
|
||||
ORD(gradient2_radial_render_pre);
|
||||
ORD(gradient2_radial_render_post);
|
||||
ORD(gradient2_radial_draw);
|
||||
|
||||
ORD(gradient_new);
|
||||
ORD(gradient_free);
|
||||
ORD(gradient_color_stop_add);
|
||||
ORD(gradient_alpha_stop_add);
|
||||
ORD(gradient_color_data_set);
|
||||
ORD(gradient_alpha_data_set);
|
||||
ORD(gradient_clear);
|
||||
ORD(gradient_fill_set);
|
||||
ORD(gradient_fill_angle_set);
|
||||
ORD(gradient_fill_spread_set);
|
||||
ORD(gradient_angle_set);
|
||||
ORD(gradient_offset_set);
|
||||
ORD(gradient_direction_set);
|
||||
ORD(gradient_type_set);
|
||||
ORD(gradient_is_opaque);
|
||||
ORD(gradient_is_visible);
|
||||
ORD(gradient_render_pre);
|
||||
ORD(gradient_render_post);
|
||||
ORD(gradient_draw);
|
||||
ORD(image_load);
|
||||
ORD(image_new_from_data);
|
||||
ORD(image_new_from_copied_data);
|
||||
|
@ -1364,7 +967,6 @@ _sdl_output_setup (int w, int h, int fullscreen, int noframe)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -305,7 +305,6 @@ eng_setup(Evas *e, void *in)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
@ -751,366 +750,6 @@ eng_polygon_draw(void *data, void *context, void *surface __UNUSED__, void *poly
|
|||
evas_gl_common_poly_draw(re->win->gl_context, polygon, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_color_np_stop_insert(void *data __UNUSED__, void *gradient __UNUSED__, int r __UNUSED__, int g __UNUSED__, int b __UNUSED__, int a __UNUSED__, float pos __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_color_np_stop_insert(gradient, r, g, b, a, pos);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_clear(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_clear(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_transform_set(void *data __UNUSED__, void *gradient __UNUSED__, void *transform __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_fill_transform_set(gradient, transform);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_spread_set(void *data __UNUSED__, void *gradient __UNUSED__, int spread __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_fill_spread_set(gradient, spread);
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_linear_new(void *data __UNUSED__)
|
||||
{
|
||||
return evas_common_gradient2_linear_new();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_free(void *data __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_free(linear_gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_fill_set(void *data __UNUSED__, void *linear_gradient __UNUSED__, float x0 __UNUSED__, float y0 __UNUSED__, float x1 __UNUSED__, float y1 __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_linear_fill_set(linear_gradient, x0, y0, x1, y1);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient2 *gr = (RGBA_Gradient2 *)linear_gradient;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return 0;
|
||||
return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
|
||||
gr->type.geometer->has_mask(gr, dc->render_op));
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
|
||||
if (!dc || !linear_gradient) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient2 *gr = (RGBA_Gradient2 *)linear_gradient;
|
||||
int len;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return;
|
||||
gr->type.geometer->geom_update(gr);
|
||||
len = gr->type.geometer->get_map_len(gr);
|
||||
evas_common_gradient2_map(dc, gr, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_post(void *data __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
eng_window_use(re->win);
|
||||
re->win->gl_context->dc = context;
|
||||
{
|
||||
Evas_GL_Image *gim;
|
||||
RGBA_Image *im;
|
||||
RGBA_Draw_Context *dc = context;
|
||||
int op = dc->render_op, cuse = dc->clip.use;
|
||||
|
||||
im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
|
||||
im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
|
||||
|
||||
dc->render_op = _EVAS_RENDER_FILL;
|
||||
dc->clip.use = 0;
|
||||
|
||||
// draw to buf, copy to tex, draw tex
|
||||
evas_common_gradient2_draw(im, dc, 0, 0, w, h, linear_gradient);
|
||||
|
||||
gim = evas_gl_common_image_new_from_data(re->win->gl_context, w, h,
|
||||
im->image.data, 1,
|
||||
EVAS_COLORSPACE_ARGB8888);
|
||||
dc->render_op = op;
|
||||
dc->clip.use = cuse;
|
||||
evas_gl_common_image_draw(re->win->gl_context, gim, 0, 0, w, h, x, y, w, h, 0);
|
||||
evas_cache_image_drop(&im->cache_entry);
|
||||
evas_gl_common_image_free(gim);
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_radial_new(void *data __UNUSED__)
|
||||
{
|
||||
return evas_common_gradient2_radial_new();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_free(void *data __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_free(radial_gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_fill_set(void *data __UNUSED__, void *radial_gradient __UNUSED__, float cx __UNUSED__, float cy __UNUSED__, float rx __UNUSED__, float ry __UNUSED__)
|
||||
{
|
||||
evas_common_gradient2_radial_fill_set(radial_gradient, cx, cy, rx, ry);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient2 *gr = (RGBA_Gradient2 *)radial_gradient;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return 0;
|
||||
return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
|
||||
gr->type.geometer->has_mask(gr, dc->render_op));
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
|
||||
if (!dc || !radial_gradient) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient2 *gr = (RGBA_Gradient2 *)radial_gradient;
|
||||
int len;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return;
|
||||
gr->type.geometer->geom_update(gr);
|
||||
len = gr->type.geometer->get_map_len(gr);
|
||||
evas_common_gradient2_map(dc, gr, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_post(void *data __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
eng_window_use(re->win);
|
||||
re->win->gl_context->dc = context;
|
||||
{
|
||||
Evas_GL_Image *gim;
|
||||
RGBA_Image *im;
|
||||
RGBA_Draw_Context *dc = context;
|
||||
int op = dc->render_op, cuse = dc->clip.use;
|
||||
|
||||
im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
|
||||
im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
|
||||
|
||||
dc->render_op = _EVAS_RENDER_FILL;
|
||||
dc->clip.use = 0;
|
||||
|
||||
// draw to buf, copy to tex, draw tex
|
||||
evas_common_gradient2_draw(im, dc, 0, 0, w, h, radial_gradient);
|
||||
|
||||
gim = evas_gl_common_image_new_from_data(re->win->gl_context, w, h,
|
||||
im->image.data, 1,
|
||||
EVAS_COLORSPACE_ARGB8888);
|
||||
dc->render_op = op;
|
||||
dc->clip.use = cuse;
|
||||
evas_gl_common_image_draw(re->win->gl_context, gim, 0, 0, w, h, x, y, w, h, 0);
|
||||
evas_cache_image_drop(&im->cache_entry);
|
||||
evas_gl_common_image_free(gim);
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient_new(void *data __UNUSED__)
|
||||
{
|
||||
return evas_common_gradient_new();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_free(void *data __UNUSED__, void *gradient)
|
||||
{
|
||||
evas_common_gradient_free(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_stop_add(void *data __UNUSED__, void *gradient, int r, int g, int b, int a, int delta)
|
||||
{
|
||||
evas_common_gradient_color_stop_add(gradient, r, g, b, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_stop_add(void *data __UNUSED__, void *gradient, int a, int delta)
|
||||
{
|
||||
evas_common_gradient_alpha_stop_add(gradient, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_data_set(void *data __UNUSED__, void *gradient, void *map, int len, int has_alpha)
|
||||
{
|
||||
evas_common_gradient_color_data_set(gradient, map, len, has_alpha);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_data_set(void *data __UNUSED__, void *gradient, void *alpha_map, int len)
|
||||
{
|
||||
evas_common_gradient_alpha_data_set(gradient, alpha_map, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_clear(void *data __UNUSED__, void *gradient)
|
||||
{
|
||||
evas_common_gradient_clear(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_set(void *data __UNUSED__, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
evas_common_gradient_fill_set(gradient, x, y, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_angle_set(void *data __UNUSED__, void *gradient, double angle)
|
||||
{
|
||||
evas_common_gradient_fill_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_spread_set(void *data __UNUSED__, void *gradient, int spread)
|
||||
{
|
||||
evas_common_gradient_fill_spread_set(gradient, spread);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_angle_set(void *data __UNUSED__, void *gradient, double angle)
|
||||
{
|
||||
evas_common_gradient_map_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_offset_set(void *data __UNUSED__, void *gradient, float offset)
|
||||
{
|
||||
evas_common_gradient_map_offset_set(gradient, offset);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_direction_set(void *data __UNUSED__, void *gradient, int direction)
|
||||
{
|
||||
evas_common_gradient_map_direction_set(gradient, direction);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_type_set(void *data __UNUSED__, void *gradient, char *name, char *params)
|
||||
{
|
||||
evas_common_gradient_type_set(gradient, name, params);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_opaque(void *data, void *context, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return 0;
|
||||
return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
|
||||
gr->type.geometer->has_mask(gr, dc->render_op));
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_visible(void *data, void *context, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
|
||||
if (!dc || !gradient) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_pre(void *data, void *context, void *gradient)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
|
||||
int len;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return;
|
||||
gr->type.geometer->geom_set(gr);
|
||||
len = gr->type.geometer->get_map_len(gr);
|
||||
evas_common_gradient_map(dc, gr, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_post(void *data __UNUSED__, void *gradient)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_draw(void *data, void *context, void *surface __UNUSED__, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
re = (Render_Engine *)data;
|
||||
eng_window_use(re->win);
|
||||
re->win->gl_context->dc = context;
|
||||
{
|
||||
Evas_GL_Image *gim;
|
||||
RGBA_Image *im;
|
||||
RGBA_Draw_Context *dc = context;
|
||||
int op = dc->render_op, cuse = dc->clip.use;
|
||||
|
||||
im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
|
||||
im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
|
||||
|
||||
dc->render_op = _EVAS_RENDER_FILL;
|
||||
dc->clip.use = 0;
|
||||
|
||||
// draw to buf, copy to tex, draw tex
|
||||
evas_common_gradient_draw(im, dc, 0, 0, w, h, gradient);
|
||||
|
||||
gim = evas_gl_common_image_new_from_data(re->win->gl_context, w, h,
|
||||
im->image.data, 1,
|
||||
EVAS_COLORSPACE_ARGB8888);
|
||||
dc->render_op = op;
|
||||
dc->clip.use = cuse;
|
||||
evas_gl_common_image_draw(re->win->gl_context, gim, 0, 0, w, h, x, y, w, h, 0);
|
||||
evas_cache_image_drop(&im->cache_entry);
|
||||
evas_gl_common_image_free(gim);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
eng_image_alpha_get(void *data, void *image)
|
||||
{
|
||||
|
@ -2071,46 +1710,6 @@ module_open(Evas_Module *em)
|
|||
ORD(polygon_points_clear);
|
||||
ORD(polygon_draw);
|
||||
|
||||
ORD(gradient2_color_np_stop_insert);
|
||||
ORD(gradient2_clear);
|
||||
ORD(gradient2_fill_transform_set);
|
||||
ORD(gradient2_fill_spread_set);
|
||||
ORD(gradient2_linear_new);
|
||||
ORD(gradient2_linear_free);
|
||||
ORD(gradient2_linear_fill_set);
|
||||
ORD(gradient2_linear_is_opaque);
|
||||
ORD(gradient2_linear_is_visible);
|
||||
ORD(gradient2_linear_render_pre);
|
||||
ORD(gradient2_linear_render_post);
|
||||
ORD(gradient2_linear_draw);
|
||||
ORD(gradient2_radial_new);
|
||||
ORD(gradient2_radial_free);
|
||||
ORD(gradient2_radial_fill_set);
|
||||
ORD(gradient2_radial_is_opaque);
|
||||
ORD(gradient2_radial_is_visible);
|
||||
ORD(gradient2_radial_render_pre);
|
||||
ORD(gradient2_radial_render_post);
|
||||
ORD(gradient2_radial_draw);
|
||||
|
||||
ORD(gradient_new);
|
||||
ORD(gradient_free);
|
||||
ORD(gradient_color_stop_add);
|
||||
ORD(gradient_alpha_stop_add);
|
||||
ORD(gradient_color_data_set);
|
||||
ORD(gradient_alpha_data_set);
|
||||
ORD(gradient_clear);
|
||||
ORD(gradient_fill_set);
|
||||
ORD(gradient_fill_angle_set);
|
||||
ORD(gradient_fill_spread_set);
|
||||
ORD(gradient_angle_set);
|
||||
ORD(gradient_offset_set);
|
||||
ORD(gradient_direction_set);
|
||||
ORD(gradient_type_set);
|
||||
ORD(gradient_is_opaque);
|
||||
ORD(gradient_is_visible);
|
||||
ORD(gradient_render_pre);
|
||||
ORD(gradient_render_post);
|
||||
ORD(gradient_draw);
|
||||
ORD(image_load);
|
||||
ORD(image_new_from_data);
|
||||
ORD(image_new_from_copied_data);
|
||||
|
|
|
@ -89,7 +89,6 @@ eng_output_setup(CGContextRef context, int w, int h)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
@ -494,231 +493,6 @@ eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
|
|||
CGContextFillPath(re->ctx);
|
||||
}
|
||||
|
||||
#pragma mark Gradient Manipulation & Drawing
|
||||
|
||||
static void *
|
||||
eng_gradient_new(void *data)
|
||||
{
|
||||
Evas_Quartz_Gradient *gradient = calloc(1, sizeof(Evas_Quartz_Gradient));
|
||||
if (!gradient) return NULL;
|
||||
|
||||
gradient->grad = evas_common_gradient_new();
|
||||
if (!(gradient->grad))
|
||||
{
|
||||
free(gradient);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gradient->changed = 1;
|
||||
gradient->buf = NULL;
|
||||
|
||||
return gradient;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_free(void *data, void *gradient)
|
||||
{
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
if (!gr) return;
|
||||
if (gr->grad) evas_common_gradient_free(gr->grad);
|
||||
if (gr->im) eng_image_free(data, gr->im);
|
||||
if (gr->buf) free(gr->buf);
|
||||
free(gr);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_stop_add(void *data, void *gradient, int r, int g, int b, int a, int delta)
|
||||
{
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
if (!gr) return;
|
||||
evas_common_gradient_color_stop_add(gr->grad, r, g, b, a, delta);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_stop_add(void *data, void *gradient, int a, int delta)
|
||||
{
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
if (!gr) return;
|
||||
evas_common_gradient_alpha_stop_add(gr->grad, a, delta);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_data_set(void *data, void *gradient, void *map, int len, int has_alpha)
|
||||
{
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
if (!gr) return;
|
||||
evas_common_gradient_color_data_set(gr->grad, map, len, has_alpha);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_data_set(void *data, void *gradient, void *alpha_map, int len)
|
||||
{
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
if (!gr) return;
|
||||
evas_common_gradient_alpha_data_set(gr->grad, alpha_map, len);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_clear(void *data, void *gradient)
|
||||
{
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
if (!gr) return;
|
||||
evas_common_gradient_clear(gr->grad);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_set(void *data, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
if (!gr) return;
|
||||
evas_common_gradient_fill_set(gr->grad, x, y, w, h);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_angle_set(void *data, void *gradient, double angle)
|
||||
{
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
if (!gr) return;
|
||||
evas_common_gradient_fill_angle_set(gr->grad, angle);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_spread_set(void *data, void *gradient, int spread)
|
||||
{
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
if (!gr) return;
|
||||
evas_common_gradient_fill_spread_set(gr->grad, spread);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_angle_set(void *data, void *gradient, double angle)
|
||||
{
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
if (!gr) return;
|
||||
evas_common_gradient_map_angle_set(gr->grad, angle);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_offset_set(void *data, void *gradient, float offset)
|
||||
{
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
if (!gr) return;
|
||||
evas_common_gradient_map_offset_set(gr->grad, offset);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_direction_set(void *data, void *gradient, int direction)
|
||||
{
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
if (!gr) return;
|
||||
evas_common_gradient_map_direction_set(gr->grad, direction);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_type_set(void *data, void *gradient, char *name, char *params)
|
||||
{
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
if (!gr) return;
|
||||
evas_common_gradient_type_set(gr->grad, name, params);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_opaque(void *data, void *context, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient *grad;
|
||||
if (!gradient) return 0;
|
||||
|
||||
grad = ((Evas_Quartz_Gradient *)gradient)->grad;
|
||||
|
||||
if (!grad || !grad->type.geometer) return 0;
|
||||
|
||||
return !(grad->type.geometer->has_alpha(grad, dc->render_op) |
|
||||
grad->type.geometer->has_mask(grad, dc->render_op));
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_visible(void *data, void *context, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
if (!gradient) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_pre(void *data, void *context, void *gradient)
|
||||
{
|
||||
int len;
|
||||
RGBA_Gradient *grad;
|
||||
|
||||
if (!context || !gradient) return;
|
||||
grad = ((Evas_Quartz_Gradient *)gradient)->grad;
|
||||
if (!grad || !grad->type.geometer) return;
|
||||
grad->type.geometer->geom_set(grad);
|
||||
len = grad->type.geometer->get_map_len(grad);
|
||||
evas_common_gradient_map(context, grad, len);
|
||||
((Evas_Quartz_Gradient *)gradient)->changed = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_post(void *data, void *gradient)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_draw(void *data, void *context, void *surface, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
Evas_Quartz_Gradient *gr = (Evas_Quartz_Gradient *)gradient;
|
||||
|
||||
INF("#Gradient#");
|
||||
INF("Fill: %i %i %i %i", gr->grad->fill.x, gr->grad->fill.y, gr->grad->fill.w, gr->grad->fill.h);
|
||||
INF("Type: %s %s", gr->grad->type.name, gr->grad->type.params);
|
||||
INF("XYWH: %i %i %i %i", x, y, w, h);
|
||||
INF("Geom: %p %p", gr->grad->type.geometer, gr->grad->type.geometer->get_fill_func);
|
||||
INF("Map: len: %d angle: %f direction: %d offset: %f", gr->grad->map.len, gr->grad->map.angle, gr->grad->map.direction, gr->grad->map.offset);
|
||||
INF("Color: nstops: %d len: %d", gr->grad->color.nstops, gr->grad->color.len);
|
||||
INF("Alpha: nstops: %d len: %d", gr->grad->alpha.nstops, gr->grad->alpha.len);
|
||||
INF("");
|
||||
|
||||
if ((gr->sw != w) || (gr->sh != h))
|
||||
gr->changed = 1;
|
||||
|
||||
if ((gr->changed) || (!gr->im))
|
||||
{
|
||||
if (gr->buf && ((gr->sw != w) || (gr->sh != h)))
|
||||
{
|
||||
free(gr->buf);
|
||||
gr->buf = NULL;
|
||||
}
|
||||
|
||||
if (!gr->buf)
|
||||
gr->buf = calloc(w * h, 4);
|
||||
|
||||
eng_image_free(data, gr->im);
|
||||
gr->im = eng_image_new_from_data(data, w, h, gr->buf, 1, EVAS_COLORSPACE_ARGB8888);
|
||||
dc->render_op = _EVAS_RENDER_FILL;
|
||||
evas_common_gradient_draw((RGBA_Image *) &gr->im->im->cache_entry, dc, 0, 0, w, h, gr->grad);
|
||||
evas_common_cpu_end_opt();
|
||||
gr->sw = w;
|
||||
gr->sh = h;
|
||||
gr->changed = 0;
|
||||
}
|
||||
|
||||
eng_image_draw(data, context, NULL, gr->im, 0, 0, 0, 0, x, y, w, h, 0);
|
||||
}
|
||||
|
||||
#pragma mark Image Manipulation & Drawing
|
||||
|
||||
static void *
|
||||
|
@ -1476,25 +1250,6 @@ module_open(Evas_Module *em)
|
|||
ORD(font_memory_load);
|
||||
ORD(font_string_size_get);
|
||||
ORD(font_v_advance_get);
|
||||
ORD(gradient_new);
|
||||
ORD(gradient_free);
|
||||
ORD(gradient_color_stop_add);
|
||||
ORD(gradient_alpha_stop_add);
|
||||
ORD(gradient_color_data_set);
|
||||
ORD(gradient_alpha_data_set);
|
||||
ORD(gradient_clear);
|
||||
ORD(gradient_fill_set);
|
||||
ORD(gradient_fill_angle_set);
|
||||
ORD(gradient_fill_spread_set);
|
||||
ORD(gradient_angle_set);
|
||||
ORD(gradient_offset_set);
|
||||
ORD(gradient_direction_set);
|
||||
ORD(gradient_type_set);
|
||||
ORD(gradient_is_opaque);
|
||||
ORD(gradient_is_visible);
|
||||
ORD(gradient_render_pre);
|
||||
ORD(gradient_render_post);
|
||||
ORD(gradient_draw);
|
||||
ORD(image_alpha_get);
|
||||
ORD(image_alpha_set);
|
||||
ORD(image_colorspace_get);
|
||||
|
|
|
@ -1,98 +0,0 @@
|
|||
#ifndef EVAS_ENGINE_H
|
||||
#define EVAS_ENGINE_H
|
||||
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
|
||||
/* log domain variable declared in evas_engine.c */
|
||||
extern int _evas_engine_quartz_log_dom ;
|
||||
#ifdef ERR
|
||||
# undef ERR
|
||||
#endif
|
||||
#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_quartz_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef DBG
|
||||
# undef DBG
|
||||
#endif
|
||||
#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_quartz_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef INF
|
||||
# undef INF
|
||||
#endif
|
||||
#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_quartz_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef WRN
|
||||
# undef WRN
|
||||
#endif
|
||||
#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_quartz_log_dom, __VA_ARGS__)
|
||||
|
||||
#ifdef CRIT
|
||||
# undef CRIT
|
||||
#endif
|
||||
#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_quartz_log_dom, __VA_ARGS__)
|
||||
|
||||
typedef struct _Evas_Quartz_Context Evas_Quartz_Context;
|
||||
|
||||
struct _Evas_Quartz_Context
|
||||
{
|
||||
int w, h;
|
||||
|
||||
struct
|
||||
{
|
||||
double r, g, b, a;
|
||||
} col;
|
||||
|
||||
struct
|
||||
{
|
||||
double r, g, b, a;
|
||||
int set : 1;
|
||||
} mul;
|
||||
|
||||
unsigned char aa, clipped;
|
||||
};
|
||||
|
||||
typedef struct _Evas_Quartz_Polygon Evas_Quartz_Polygon;
|
||||
|
||||
struct _Evas_Quartz_Polygon
|
||||
{
|
||||
Eina_List *points;
|
||||
};
|
||||
|
||||
typedef struct _Evas_Quartz_Polygon_Point Evas_Quartz_Polygon_Point;
|
||||
|
||||
struct _Evas_Quartz_Polygon_Point
|
||||
{
|
||||
int x, y;
|
||||
};
|
||||
|
||||
typedef struct _Evas_Quartz_Image Evas_Quartz_Image;
|
||||
|
||||
struct _Evas_Quartz_Image
|
||||
{
|
||||
RGBA_Image *im;
|
||||
CGImageRef cgim;
|
||||
|
||||
int references;
|
||||
};
|
||||
|
||||
typedef struct _Evas_Quartz_Font Evas_Quartz_Font;
|
||||
|
||||
struct _Evas_Quartz_Font
|
||||
{
|
||||
CTFontRef font;
|
||||
CFDictionaryRef attr;
|
||||
int hint;
|
||||
int size;
|
||||
};
|
||||
|
||||
typedef struct _Evas_Quartz_Gradient Evas_Quartz_Gradient;
|
||||
|
||||
struct _Evas_Quartz_Gradient
|
||||
{
|
||||
DATA32 *buf;
|
||||
RGBA_Gradient *grad;
|
||||
Evas_Quartz_Image *im;
|
||||
unsigned char changed : 1;
|
||||
int sw, sh;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -46,25 +46,6 @@ static void *eng_polygon_point_add(void *data, void *context, void *polygon, int
|
|||
static void *eng_polygon_points_clear(void *data, void *context, void *polygon);
|
||||
static void eng_polygon_draw(void *data, void *context, void *surface, void *polygon);
|
||||
|
||||
static void *eng_gradient_new(void *data);
|
||||
static void eng_gradient_free(void *data, void *gradient);
|
||||
static void eng_gradient_color_stop_add(void *data, void *gradient, int r, int g, int b, int a, int delta);
|
||||
static void eng_gradient_alpha_stop_add(void *data, void *gradient, int a, int delta);
|
||||
static void eng_gradient_color_data_set(void *data, void *gradient, void *map, int len, int has_alpha);
|
||||
static void eng_gradient_alpha_data_set(void *data, void *gradient, void *alpha_map, int len);
|
||||
static void eng_gradient_clear(void *data, void *gradient);
|
||||
static void eng_gradient_fill_set(void *data, void *gradient, int x, int y, int w, int h);
|
||||
static void eng_gradient_fill_angle_set(void *data, void *gradient, double angle);
|
||||
static void eng_gradient_fill_spread_set(void *data, void *gradient, int spread);
|
||||
static void eng_gradient_angle_set(void *data, void *gradient, double angle);
|
||||
static void eng_gradient_offset_set(void *data, void *gradient, float offset);
|
||||
static void eng_gradient_direction_set(void *data, void *gradient, int direction);
|
||||
static void eng_gradient_type_set(void *data, void *gradient, char *name, char *params);
|
||||
static int eng_gradient_is_opaque(void *data, void *context, void *gradient, int x, int y, int w, int h);
|
||||
static int eng_gradient_is_visible(void *data, void *context, void *gradient, int x, int y, int w, int h);
|
||||
static void eng_gradient_render_pre(void *data, void *context, void *gradient);
|
||||
static void eng_gradient_render_post(void *data, void *gradient);
|
||||
static void eng_gradient_draw(void *data, void *context, void *surface, void *gradient, int x, int y, int w, int h);
|
||||
static void *eng_image_load(void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo);
|
||||
|
||||
static void *eng_image_new_from_data(void *data, int w, int h, DATA32 *image_data, int alpha, int cspace);
|
||||
|
|
|
@ -203,264 +203,6 @@ eng_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *poly
|
|||
soft16_polygon_draw(surface, context, polygon, x, y);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
eng_gradient2_color_np_stop_insert(void *data __UNUSED__, void *gradient __UNUSED__, int r __UNUSED__, int g __UNUSED__, int b __UNUSED__, int a __UNUSED__, float pos __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_clear(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_transform_set(void *data __UNUSED__, void *gradient __UNUSED__, void *transform __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_spread_set(void *data __UNUSED__, void *gradient __UNUSED__, int spread __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_linear_new(void *data __UNUSED__)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_free(void *data __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_fill_set(void *data __UNUSED__, void *linear_gradient __UNUSED__, float x0 __UNUSED__, float y0 __UNUSED__, float x1 __UNUSED__, float y1 __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_post(void *data __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_radial_new(void *data __UNUSED__)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_free(void *data __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_fill_set(void *data __UNUSED__, void *radial_gradient __UNUSED__, float cx __UNUSED__, float cy __UNUSED__, float rx __UNUSED__, float ry __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_post(void *data __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient_new(void *data __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
return NULL;
|
||||
// return evas_common_gradient_new();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_free(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_free(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_stop_add(void *data __UNUSED__, void *gradient __UNUSED__, int r __UNUSED__, int g __UNUSED__, int b __UNUSED__, int a __UNUSED__, int delta __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_color_stop_add(gradient, r, g, b, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_stop_add(void *data __UNUSED__, void *gradient __UNUSED__, int a __UNUSED__, int delta __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_alpha_stop_add(gradient, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_data_set(void *data __UNUSED__, void *gradient __UNUSED__, void *map __UNUSED__, int len __UNUSED__, int has_alpha __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_color_data_set(gradient, map, len, has_alpha);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_data_set(void *data __UNUSED__, void *gradient __UNUSED__, void *alpha_map __UNUSED__, int len __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_alpha_data_set(gradient, alpha_map, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_clear(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_clear(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_set(void *data __UNUSED__, void *gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_fill_set(gradient, x, y, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_angle_set(void *data __UNUSED__, void *gradient __UNUSED__, double angle __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_fill_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_spread_set(void *data __UNUSED__, void *gradient __UNUSED__, int spread __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_fill_spread_set(gradient, spread);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_angle_set(void *data __UNUSED__, void *gradient __UNUSED__, double angle __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_map_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_offset_set(void *data __UNUSED__, void *gradient __UNUSED__, float offset __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_map_offset_set(gradient, offset);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_direction_set(void *data __UNUSED__, void *gradient __UNUSED__, int direction __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_map_direction_set(gradient, direction);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_type_set(void *data __UNUSED__, void *gradient __UNUSED__, char *name __UNUSED__, char *params __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_type_set(gradient, name, params);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
return 0;
|
||||
// RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
// RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
|
||||
//
|
||||
// if (!dc || !gr || !gr->type.geometer) return 0;
|
||||
// return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
|
||||
// gr->type.geometer->has_mask(gr, dc->render_op));
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
return 0;
|
||||
// RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
//
|
||||
// if (!dc || !gradient) return 0;
|
||||
// return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
// RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
// RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
|
||||
// int len;
|
||||
//
|
||||
// if (!dc || !gr || !gr->type.geometer) return;
|
||||
// gr->type.geometer->geom_set(gr);
|
||||
// len = gr->type.geometer->get_map_len(gr);
|
||||
// evas_common_gradient_map(dc, gr, len);
|
||||
NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_post(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
// evas_common_gradient_draw(surface, context, x, y, w, h, gradient);
|
||||
// evas_common_cpu_end_opt();
|
||||
NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
static int
|
||||
eng_image_alpha_get(void *data __UNUSED__, void *image)
|
||||
{
|
||||
|
@ -921,49 +663,6 @@ static Evas_Func func =
|
|||
eng_polygon_point_add,
|
||||
eng_polygon_points_clear,
|
||||
eng_polygon_draw,
|
||||
/* gradient draw funcs */
|
||||
eng_gradient2_color_np_stop_insert,
|
||||
eng_gradient2_clear,
|
||||
eng_gradient2_fill_transform_set,
|
||||
eng_gradient2_fill_spread_set,
|
||||
|
||||
eng_gradient2_linear_new,
|
||||
eng_gradient2_linear_free,
|
||||
eng_gradient2_linear_fill_set,
|
||||
eng_gradient2_linear_is_opaque,
|
||||
eng_gradient2_linear_is_visible,
|
||||
eng_gradient2_linear_render_pre,
|
||||
eng_gradient2_linear_render_post,
|
||||
eng_gradient2_linear_draw,
|
||||
|
||||
eng_gradient2_radial_new,
|
||||
eng_gradient2_radial_free,
|
||||
eng_gradient2_radial_fill_set,
|
||||
eng_gradient2_radial_is_opaque,
|
||||
eng_gradient2_radial_is_visible,
|
||||
eng_gradient2_radial_render_pre,
|
||||
eng_gradient2_radial_render_post,
|
||||
eng_gradient2_radial_draw,
|
||||
|
||||
eng_gradient_new,
|
||||
eng_gradient_free,
|
||||
eng_gradient_color_stop_add,
|
||||
eng_gradient_alpha_stop_add,
|
||||
eng_gradient_color_data_set,
|
||||
eng_gradient_alpha_data_set,
|
||||
eng_gradient_clear,
|
||||
eng_gradient_fill_set,
|
||||
eng_gradient_fill_angle_set,
|
||||
eng_gradient_fill_spread_set,
|
||||
eng_gradient_angle_set,
|
||||
eng_gradient_offset_set,
|
||||
eng_gradient_direction_set,
|
||||
eng_gradient_type_set,
|
||||
eng_gradient_is_opaque,
|
||||
eng_gradient_is_visible,
|
||||
eng_gradient_render_pre,
|
||||
eng_gradient_render_post,
|
||||
eng_gradient_draw,
|
||||
/* image draw funcs */
|
||||
eng_image_load,
|
||||
eng_image_new_from_data,
|
||||
|
|
|
@ -126,7 +126,6 @@ eng_setup(Evas *e, void *in)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -129,7 +129,6 @@ _sdl16_output_setup(int w, int h, int rotation, int fullscreen, int noframe, int
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -160,7 +160,6 @@ eng_setup(Evas *e, void *in)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -178,7 +178,6 @@ eng_setup(Evas *e, void *in)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -216,322 +216,6 @@ eng_polygon_draw(void *data __UNUSED__, void *context, void *surface,
|
|||
soft8_polygon_draw(surface, context, polygon, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_color_np_stop_insert(void *data __UNUSED__,
|
||||
void *gradient __UNUSED__, int r __UNUSED__,
|
||||
int g __UNUSED__, int b __UNUSED__,
|
||||
int a __UNUSED__, float pos __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_clear(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_transform_set(void *data __UNUSED__,
|
||||
void *gradient __UNUSED__,
|
||||
void *transform __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_spread_set(void *data __UNUSED__, void *gradient __UNUSED__,
|
||||
int spread __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_linear_new(void *data __UNUSED__)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_free(void *data __UNUSED__,
|
||||
void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_fill_set(void *data __UNUSED__,
|
||||
void *linear_gradient __UNUSED__,
|
||||
float x0 __UNUSED__, float y0 __UNUSED__,
|
||||
float x1 __UNUSED__, float y1 __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_opaque(void *data __UNUSED__, void *context __UNUSED__,
|
||||
void *linear_gradient __UNUSED__,
|
||||
int x __UNUSED__, int y __UNUSED__,
|
||||
int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_visible(void *data __UNUSED__, void *context __UNUSED__,
|
||||
void *linear_gradient __UNUSED__,
|
||||
int x __UNUSED__, int y __UNUSED__,
|
||||
int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_pre(void *data __UNUSED__, void *context __UNUSED__,
|
||||
void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_post(void *data __UNUSED__,
|
||||
void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_draw(void *data __UNUSED__, void *context __UNUSED__,
|
||||
void *surface __UNUSED__,
|
||||
void *linear_gradient __UNUSED__, int x __UNUSED__,
|
||||
int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_radial_new(void *data __UNUSED__)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_free(void *data __UNUSED__,
|
||||
void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_fill_set(void *data __UNUSED__,
|
||||
void *radial_gradient __UNUSED__,
|
||||
float cx __UNUSED__, float cy __UNUSED__,
|
||||
float rx __UNUSED__, float ry __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_opaque(void *data __UNUSED__, void *context __UNUSED__,
|
||||
void *radial_gradient __UNUSED__,
|
||||
int x __UNUSED__, int y __UNUSED__,
|
||||
int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_visible(void *data __UNUSED__, void *context __UNUSED__,
|
||||
void *radial_gradient __UNUSED__,
|
||||
int x __UNUSED__, int y __UNUSED__,
|
||||
int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_pre(void *data __UNUSED__, void *context __UNUSED__,
|
||||
void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_post(void *data __UNUSED__,
|
||||
void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_draw(void *data __UNUSED__, void *context __UNUSED__,
|
||||
void *surface __UNUSED__,
|
||||
void *radial_gradient __UNUSED__, int x __UNUSED__,
|
||||
int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient_new(void *data __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
return NULL;
|
||||
// return evas_common_gradient_new();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_free(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_free(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_stop_add(void *data __UNUSED__, void *gradient __UNUSED__,
|
||||
int r __UNUSED__, int g __UNUSED__,
|
||||
int b __UNUSED__, int a __UNUSED__,
|
||||
int delta __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_color_stop_add(gradient, r, g, b, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_stop_add(void *data __UNUSED__, void *gradient __UNUSED__,
|
||||
int a __UNUSED__, int delta __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_alpha_stop_add(gradient, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_data_set(void *data __UNUSED__, void *gradient __UNUSED__,
|
||||
void *map __UNUSED__, int len __UNUSED__,
|
||||
int has_alpha __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_color_data_set(gradient, map, len, has_alpha);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_data_set(void *data __UNUSED__, void *gradient __UNUSED__,
|
||||
void *alpha_map __UNUSED__, int len __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_alpha_data_set(gradient, alpha_map, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_clear(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_clear(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_set(void *data __UNUSED__, void *gradient __UNUSED__,
|
||||
int x __UNUSED__, int y __UNUSED__, int w __UNUSED__,
|
||||
int h __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_fill_set(gradient, x, y, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_angle_set(void *data __UNUSED__, void *gradient __UNUSED__,
|
||||
double angle __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_fill_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_spread_set(void *data __UNUSED__, void *gradient __UNUSED__,
|
||||
int spread __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_fill_spread_set(gradient, spread);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_angle_set(void *data __UNUSED__, void *gradient __UNUSED__,
|
||||
double angle __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_map_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_offset_set(void *data __UNUSED__, void *gradient __UNUSED__,
|
||||
float offset __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_map_offset_set(gradient, offset);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_direction_set(void *data __UNUSED__, void *gradient __UNUSED__,
|
||||
int direction __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_map_direction_set(gradient, direction);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_type_set(void *data __UNUSED__, void *gradient __UNUSED__,
|
||||
char *name __UNUSED__, char *params __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
// evas_common_gradient_type_set(gradient, name, params);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_opaque(void *data __UNUSED__, void *context __UNUSED__,
|
||||
void *gradient __UNUSED__, int x __UNUSED__,
|
||||
int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
return 0;
|
||||
// RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
// RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
|
||||
//
|
||||
// if (!dc || !gr || !gr->type.geometer) return 0;
|
||||
// return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
|
||||
// gr->type.geometer->has_mask(gr, dc->render_op));
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_visible(void *data __UNUSED__, void *context __UNUSED__,
|
||||
void *gradient __UNUSED__, int x __UNUSED__,
|
||||
int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
return 0;
|
||||
// RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
//
|
||||
// if (!dc || !gradient) return 0;
|
||||
// return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_pre(void *data __UNUSED__, void *context __UNUSED__,
|
||||
void *gradient __UNUSED__)
|
||||
{
|
||||
// RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
// RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
|
||||
// int len;
|
||||
//
|
||||
// if (!dc || !gr || !gr->type.geometer) return;
|
||||
// gr->type.geometer->geom_set(gr);
|
||||
// len = gr->type.geometer->get_map_len(gr);
|
||||
// evas_common_gradient_map(dc, gr, len);
|
||||
NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_post(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_draw(void *data __UNUSED__, void *context __UNUSED__,
|
||||
void *surface __UNUSED__, void *gradient __UNUSED__,
|
||||
int x __UNUSED__, int y __UNUSED__, int w __UNUSED__,
|
||||
int h __UNUSED__)
|
||||
{
|
||||
// evas_common_gradient_draw(surface, context, x, y, w, h, gradient);
|
||||
// evas_common_cpu_end_opt();
|
||||
NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
static int
|
||||
eng_image_alpha_get(void *data __UNUSED__, void *image)
|
||||
{
|
||||
|
@ -1023,49 +707,6 @@ static Evas_Func func = {
|
|||
eng_polygon_point_add,
|
||||
eng_polygon_points_clear,
|
||||
eng_polygon_draw,
|
||||
/* gradient draw funcs */
|
||||
eng_gradient2_color_np_stop_insert,
|
||||
eng_gradient2_clear,
|
||||
eng_gradient2_fill_transform_set,
|
||||
eng_gradient2_fill_spread_set,
|
||||
|
||||
eng_gradient2_linear_new,
|
||||
eng_gradient2_linear_free,
|
||||
eng_gradient2_linear_fill_set,
|
||||
eng_gradient2_linear_is_opaque,
|
||||
eng_gradient2_linear_is_visible,
|
||||
eng_gradient2_linear_render_pre,
|
||||
eng_gradient2_linear_render_post,
|
||||
eng_gradient2_linear_draw,
|
||||
|
||||
eng_gradient2_radial_new,
|
||||
eng_gradient2_radial_free,
|
||||
eng_gradient2_radial_fill_set,
|
||||
eng_gradient2_radial_is_opaque,
|
||||
eng_gradient2_radial_is_visible,
|
||||
eng_gradient2_radial_render_pre,
|
||||
eng_gradient2_radial_render_post,
|
||||
eng_gradient2_radial_draw,
|
||||
|
||||
eng_gradient_new,
|
||||
eng_gradient_free,
|
||||
eng_gradient_color_stop_add,
|
||||
eng_gradient_alpha_stop_add,
|
||||
eng_gradient_color_data_set,
|
||||
eng_gradient_alpha_data_set,
|
||||
eng_gradient_clear,
|
||||
eng_gradient_fill_set,
|
||||
eng_gradient_fill_angle_set,
|
||||
eng_gradient_fill_spread_set,
|
||||
eng_gradient_angle_set,
|
||||
eng_gradient_offset_set,
|
||||
eng_gradient_direction_set,
|
||||
eng_gradient_type_set,
|
||||
eng_gradient_is_opaque,
|
||||
eng_gradient_is_visible,
|
||||
eng_gradient_render_pre,
|
||||
eng_gradient_render_post,
|
||||
eng_gradient_draw,
|
||||
/* image draw funcs */
|
||||
eng_image_load,
|
||||
eng_image_new_from_data,
|
||||
|
|
|
@ -158,7 +158,6 @@ eng_setup(Evas * e, void *in)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -46,7 +46,6 @@ _output_setup(int width,
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -44,7 +44,6 @@ _output_setup(int width,
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -212,312 +212,6 @@ eng_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *poly
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_color_np_stop_insert(void *data __UNUSED__, void *gradient, int r, int g, int b, int a, float pos)
|
||||
{
|
||||
evas_common_gradient2_color_np_stop_insert(gradient, r, g, b, a, pos);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_clear(void *data __UNUSED__, void *gradient)
|
||||
{
|
||||
evas_common_gradient2_clear(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_transform_set(void *data __UNUSED__, void *gradient, void *transform)
|
||||
{
|
||||
evas_common_gradient2_fill_transform_set(gradient, transform);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_spread_set(void *data __UNUSED__, void *gradient, int spread)
|
||||
{
|
||||
evas_common_gradient2_fill_spread_set(gradient, spread);
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_linear_new(void *data __UNUSED__)
|
||||
{
|
||||
return evas_common_gradient2_linear_new();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_free(void *data __UNUSED__, void *linear_gradient)
|
||||
{
|
||||
evas_common_gradient2_free(linear_gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_fill_set(void *data __UNUSED__, void *linear_gradient, float x0, float y0, float x1, float y1)
|
||||
{
|
||||
evas_common_gradient2_linear_fill_set(linear_gradient, x0, y0, x1, y1);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_opaque(void *data __UNUSED__, void *context, void *linear_gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient2 *gr = (RGBA_Gradient2 *)linear_gradient;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return 0;
|
||||
return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
|
||||
gr->type.geometer->has_mask(gr, dc->render_op));
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_visible(void *data __UNUSED__, void *context, void *linear_gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
|
||||
if (!dc || !linear_gradient) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_pre(void *data __UNUSED__, void *context, void *linear_gradient)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient2 *gr = (RGBA_Gradient2 *)linear_gradient;
|
||||
int len;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return;
|
||||
gr->type.geometer->geom_update(gr);
|
||||
len = gr->type.geometer->get_map_len(gr);
|
||||
evas_common_gradient2_map(dc, gr, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_post(void *data __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_draw(void *data __UNUSED__, void *context, void *surface, void *linear_gradient, int x, int y, int w, int h)
|
||||
{
|
||||
#ifdef BUILD_PIPE_RENDER
|
||||
if ((cpunum > 1)
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
&& evas_common_frameq_enabled()
|
||||
#endif
|
||||
)
|
||||
evas_common_pipe_grad2_draw(surface, context, x, y, w, h, linear_gradient);
|
||||
else
|
||||
#endif
|
||||
evas_common_gradient2_draw(surface, context, x, y, w, h, linear_gradient);
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_radial_new(void *data __UNUSED__)
|
||||
{
|
||||
return evas_common_gradient2_radial_new();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_free(void *data __UNUSED__, void *radial_gradient)
|
||||
{
|
||||
evas_common_gradient2_free(radial_gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_fill_set(void *data __UNUSED__, void *radial_gradient, float cx, float cy, float rx, float ry)
|
||||
{
|
||||
evas_common_gradient2_radial_fill_set(radial_gradient, cx, cy, rx, ry);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_opaque(void *data __UNUSED__, void *context, void *radial_gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient2 *gr = (RGBA_Gradient2 *)radial_gradient;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return 0;
|
||||
return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
|
||||
gr->type.geometer->has_mask(gr, dc->render_op));
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_visible(void *data __UNUSED__, void *context, void *radial_gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
|
||||
if (!dc || !radial_gradient) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_pre(void *data __UNUSED__, void *context, void *radial_gradient)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient2 *gr = (RGBA_Gradient2 *)radial_gradient;
|
||||
int len;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return;
|
||||
gr->type.geometer->geom_update(gr);
|
||||
len = gr->type.geometer->get_map_len(gr);
|
||||
evas_common_gradient2_map(dc, gr, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_post(void *data __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_draw(void *data __UNUSED__, void *context, void *surface, void *radial_gradient, int x, int y, int w, int h)
|
||||
{
|
||||
#ifdef BUILD_PIPE_RENDER
|
||||
if ((cpunum > 1)
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
&& evas_common_frameq_enabled()
|
||||
#endif
|
||||
)
|
||||
evas_common_pipe_grad2_draw(surface, context, x, y, w, h, radial_gradient);
|
||||
else
|
||||
#endif
|
||||
evas_common_gradient2_draw(surface, context, x, y, w, h, radial_gradient);
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient_new(void *data __UNUSED__)
|
||||
{
|
||||
return evas_common_gradient_new();
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_free(void *data __UNUSED__, void *gradient)
|
||||
{
|
||||
evas_common_gradient_free(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_stop_add(void *data __UNUSED__, void *gradient, int r, int g, int b, int a, int delta)
|
||||
{
|
||||
evas_common_gradient_color_stop_add(gradient, r, g, b, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_stop_add(void *data __UNUSED__, void *gradient, int a, int delta)
|
||||
{
|
||||
evas_common_gradient_alpha_stop_add(gradient, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_data_set(void *data __UNUSED__, void *gradient, void *map, int len, int has_alpha)
|
||||
{
|
||||
evas_common_gradient_color_data_set(gradient, map, len, has_alpha);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_data_set(void *data __UNUSED__, void *gradient, void *alpha_map, int len)
|
||||
{
|
||||
evas_common_gradient_alpha_data_set(gradient, alpha_map, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_clear(void *data __UNUSED__, void *gradient)
|
||||
{
|
||||
evas_common_gradient_clear(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_set(void *data __UNUSED__, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
evas_common_gradient_fill_set(gradient, x, y, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_angle_set(void *data __UNUSED__, void *gradient, double angle)
|
||||
{
|
||||
evas_common_gradient_fill_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_spread_set(void *data __UNUSED__, void *gradient, int spread)
|
||||
{
|
||||
evas_common_gradient_fill_spread_set(gradient, spread);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_angle_set(void *data __UNUSED__, void *gradient, double angle)
|
||||
{
|
||||
evas_common_gradient_map_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_offset_set(void *data __UNUSED__, void *gradient, float offset)
|
||||
{
|
||||
evas_common_gradient_map_offset_set(gradient, offset);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_direction_set(void *data __UNUSED__, void *gradient, int direction)
|
||||
{
|
||||
evas_common_gradient_map_direction_set(gradient, direction);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_type_set(void *data __UNUSED__, void *gradient, char *name, char *params)
|
||||
{
|
||||
evas_common_gradient_type_set(gradient, name, params);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_opaque(void *data __UNUSED__, void *context, void *gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return 0;
|
||||
return !(gr->type.geometer->has_alpha(gr, dc->render_op) |
|
||||
gr->type.geometer->has_mask(gr, dc->render_op));
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_visible(void *data __UNUSED__, void *context, void *gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
|
||||
if (!dc || !gradient) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_pre(void *data __UNUSED__, void *context, void *gradient)
|
||||
{
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
RGBA_Gradient *gr = (RGBA_Gradient *)gradient;
|
||||
int len;
|
||||
|
||||
if (!dc || !gr || !gr->type.geometer) return;
|
||||
gr->type.geometer->geom_set(gr);
|
||||
len = gr->type.geometer->get_map_len(gr);
|
||||
evas_common_gradient_map(dc, gr, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_post(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_draw(void *data __UNUSED__, void *context, void *surface, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
#ifdef BUILD_PIPE_RENDER
|
||||
if ((cpunum > 1)
|
||||
#ifdef EVAS_FRAME_QUEUING
|
||||
&& evas_common_frameq_enabled()
|
||||
#endif
|
||||
)
|
||||
evas_common_pipe_grad_draw(surface, context, x, y, w, h, gradient);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
evas_common_gradient_draw(surface, context, x, y, w, h, gradient);
|
||||
evas_common_cpu_end_opt();
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
eng_image_alpha_get(void *data __UNUSED__, void *image)
|
||||
{
|
||||
|
@ -1138,49 +832,6 @@ static Evas_Func func =
|
|||
eng_polygon_point_add,
|
||||
eng_polygon_points_clear,
|
||||
eng_polygon_draw,
|
||||
/* gradient draw funcs */
|
||||
eng_gradient2_color_np_stop_insert,
|
||||
eng_gradient2_clear,
|
||||
eng_gradient2_fill_transform_set,
|
||||
eng_gradient2_fill_spread_set,
|
||||
|
||||
eng_gradient2_linear_new,
|
||||
eng_gradient2_linear_free,
|
||||
eng_gradient2_linear_fill_set,
|
||||
eng_gradient2_linear_is_opaque,
|
||||
eng_gradient2_linear_is_visible,
|
||||
eng_gradient2_linear_render_pre,
|
||||
eng_gradient2_linear_render_post,
|
||||
eng_gradient2_linear_draw,
|
||||
|
||||
eng_gradient2_radial_new,
|
||||
eng_gradient2_radial_free,
|
||||
eng_gradient2_radial_fill_set,
|
||||
eng_gradient2_radial_is_opaque,
|
||||
eng_gradient2_radial_is_visible,
|
||||
eng_gradient2_radial_render_pre,
|
||||
eng_gradient2_radial_render_post,
|
||||
eng_gradient2_radial_draw,
|
||||
|
||||
eng_gradient_new,
|
||||
eng_gradient_free,
|
||||
eng_gradient_color_stop_add,
|
||||
eng_gradient_alpha_stop_add,
|
||||
eng_gradient_color_data_set,
|
||||
eng_gradient_alpha_data_set,
|
||||
eng_gradient_clear,
|
||||
eng_gradient_fill_set,
|
||||
eng_gradient_fill_angle_set,
|
||||
eng_gradient_fill_spread_set,
|
||||
eng_gradient_angle_set,
|
||||
eng_gradient_offset_set,
|
||||
eng_gradient_direction_set,
|
||||
eng_gradient_type_set,
|
||||
eng_gradient_is_opaque,
|
||||
eng_gradient_is_visible,
|
||||
eng_gradient_render_pre,
|
||||
eng_gradient_render_post,
|
||||
eng_gradient_draw,
|
||||
/* image draw funcs */
|
||||
eng_image_load,
|
||||
eng_image_new_from_data,
|
||||
|
|
|
@ -53,7 +53,6 @@ _output_setup(int w, int h, int rot, QWidget *target)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -857,26 +857,6 @@ evas_engine_sdl_polygon_draw(void *data __UNUSED__, void *context, void *surface
|
|||
SDL_UnlockSurface(eim->surface);
|
||||
}
|
||||
|
||||
static void
|
||||
evas_engine_sdl_gradient_draw(void *data __UNUSED__, void *context, void *surface, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
SDL_Engine_Image_Entry *eim = surface;
|
||||
int mustlock_im = 0;
|
||||
|
||||
if (eim->surface && SDL_MUSTLOCK(eim->surface))
|
||||
{
|
||||
mustlock_im = 1;
|
||||
SDL_LockSurface(eim->surface);
|
||||
_SDL_UPDATE_PIXELS(eim);
|
||||
}
|
||||
|
||||
evas_common_gradient_draw((RGBA_Image *) eim->cache_entry.src, context, x, y, w, h, gradient);
|
||||
evas_common_cpu_end_opt();
|
||||
|
||||
if (mustlock_im)
|
||||
SDL_UnlockSurface(eim->surface);
|
||||
}
|
||||
|
||||
static int module_open(Evas_Module *em)
|
||||
{
|
||||
if (!em) return 0;
|
||||
|
@ -935,11 +915,10 @@ static int module_open(Evas_Module *em)
|
|||
ORD(line_draw);
|
||||
ORD(rectangle_draw);
|
||||
ORD(polygon_draw);
|
||||
ORD(gradient_draw);
|
||||
|
||||
|
||||
ORD(image_scale_hint_set);
|
||||
ORD(image_scale_hint_get);
|
||||
|
||||
|
||||
/* now advertise out own api */
|
||||
em->functions = (void *)(&func);
|
||||
return 1;
|
||||
|
@ -982,7 +961,6 @@ _sdl_output_setup (int w, int h, int fullscreen, int noframe, int alpha, int hw
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -475,7 +475,6 @@ eng_setup(Evas *e, void *in)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
|
|
@ -15,7 +15,6 @@ if BUILD_ENGINE_XRENDER_X11
|
|||
|
||||
XRENDER_X11_SOURCES = \
|
||||
evas_engine_xlib_font.c \
|
||||
evas_engine_xlib_gradient.c \
|
||||
evas_engine_xlib_image.c \
|
||||
evas_engine_xlib_render.c \
|
||||
evas_engine_xlib_ximage.c \
|
||||
|
@ -25,7 +24,6 @@ if BUILD_ENGINE_XRENDER_XCB
|
|||
|
||||
XRENDER_X11_SOURCES += \
|
||||
evas_engine_xcb_font.c \
|
||||
evas_engine_xcb_gradient.c \
|
||||
evas_engine_xcb_image.c \
|
||||
evas_engine_xcb_render.c \
|
||||
evas_engine_xcb_ximage.c
|
||||
|
|
|
@ -99,22 +99,6 @@ struct _Render_Engine
|
|||
void (*font_surface_free)(XR_Font_Surface *fs);
|
||||
void (*font_surface_draw)(Ximage_Info *xinf, RGBA_Image *surface, RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg, int x, int y);
|
||||
|
||||
XR_Gradient *(*gradient_new)(Ximage_Info *xinf);
|
||||
void (*gradient_free)(XR_Gradient *gr);
|
||||
void (*gradient_color_stop_add)(XR_Gradient *gr, int r, int g, int b, int a, int delta);
|
||||
void (*gradient_alpha_stop_add)(XR_Gradient *gr, int a, int delta);
|
||||
void (*gradient_color_data_set)(XR_Gradient *gr, void *map, int len, int has_alpha);
|
||||
void (*gradient_alpha_data_set)(XR_Gradient *gr, void *alpha_map, int len);
|
||||
void (*gradient_clear)(XR_Gradient *gr);
|
||||
void (*gradient_fill_set)(XR_Gradient *gr, int x, int y, int w, int h);
|
||||
void (*gradient_fill_angle_set)(XR_Gradient *gr, double angle);
|
||||
void (*gradient_fill_spread_set)(XR_Gradient *gr, int spread);
|
||||
void (*gradient_angle_set)(XR_Gradient *gr, double angle);
|
||||
void (*gradient_offset_set)(XR_Gradient *gr, float offset);
|
||||
void (*gradient_direction_set)(XR_Gradient *gr, int direction);
|
||||
void (*gradient_type_set)(XR_Gradient *gr, char *name, char *params);
|
||||
void (*gradient_draw)(Xrender_Surface *rs, RGBA_Draw_Context *dc, XR_Gradient *gr, int x, int y, int w, int h);
|
||||
|
||||
XR_Image *(*image_load)(Ximage_Info *xinf, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
|
||||
XR_Image *(*image_new_from_data)(Ximage_Info *xinf, int w, int h, void *data, int alpha, int cspace);
|
||||
XR_Image *(*image_new_from_copied_data)(Ximage_Info *xinf, int w, int h, void *data, int alpha, int cspace);
|
||||
|
@ -213,22 +197,6 @@ _output_xlib_setup(int width,
|
|||
re->font_surface_free = _xre_xlib_font_surface_free;
|
||||
re->font_surface_draw = _xre_xlib_font_surface_draw;
|
||||
|
||||
re->gradient_new = _xre_xlib_gradient_new;
|
||||
re->gradient_free = _xre_xlib_gradient_free;
|
||||
re->gradient_color_stop_add = _xre_xlib_gradient_color_stop_add;
|
||||
re->gradient_alpha_stop_add = _xre_xlib_gradient_alpha_stop_add;
|
||||
re->gradient_color_data_set = _xre_xlib_gradient_color_data_set;
|
||||
re->gradient_alpha_data_set = _xre_xlib_gradient_alpha_data_set;
|
||||
re->gradient_clear = _xre_xlib_gradient_clear;
|
||||
re->gradient_fill_set = _xre_xlib_gradient_fill_set;
|
||||
re->gradient_fill_angle_set = _xre_xlib_gradient_fill_angle_set;
|
||||
re->gradient_fill_spread_set = _xre_xlib_gradient_fill_spread_set;
|
||||
re->gradient_angle_set = _xre_xlib_gradient_angle_set;
|
||||
re->gradient_offset_set = _xre_xlib_gradient_offset_set;
|
||||
re->gradient_direction_set = _xre_xlib_gradient_direction_set;
|
||||
re->gradient_type_set = _xre_xlib_gradient_type_set;
|
||||
re->gradient_draw = _xre_xlib_gradient_draw;
|
||||
|
||||
re->image_load = _xre_xlib_image_load;
|
||||
re->image_new_from_data = _xre_xlib_image_new_from_data;
|
||||
re->image_new_from_copied_data = _xre_xlib_image_new_from_copied_data;
|
||||
|
@ -391,22 +359,6 @@ _output_xcb_setup(int width,
|
|||
re->font_surface_free = _xre_xcb_font_surface_free;
|
||||
re->font_surface_draw = _xre_xcb_font_surface_draw;
|
||||
|
||||
re->gradient_new = _xre_xcb_gradient_new;
|
||||
re->gradient_free = _xre_xcb_gradient_free;
|
||||
re->gradient_color_stop_add = _xre_xcb_gradient_color_stop_add;
|
||||
re->gradient_alpha_stop_add = _xre_xcb_gradient_alpha_stop_add;
|
||||
re->gradient_color_data_set = _xre_xcb_gradient_color_data_set;
|
||||
re->gradient_alpha_data_set = _xre_xcb_gradient_alpha_data_set;
|
||||
re->gradient_clear = _xre_xcb_gradient_clear;
|
||||
re->gradient_fill_set = _xre_xcb_gradient_fill_set;
|
||||
re->gradient_fill_angle_set = _xre_xcb_gradient_fill_angle_set;
|
||||
re->gradient_fill_spread_set = _xre_xcb_gradient_fill_spread_set;
|
||||
re->gradient_angle_set = _xre_xcb_gradient_angle_set;
|
||||
re->gradient_offset_set = _xre_xcb_gradient_offset_set;
|
||||
re->gradient_direction_set = _xre_xcb_gradient_direction_set;
|
||||
re->gradient_type_set = _xre_xcb_gradient_type_set;
|
||||
re->gradient_draw = _xre_xcb_gradient_draw;
|
||||
|
||||
re->image_load = _xre_xcb_image_load;
|
||||
re->image_new_from_data = _xre_xcb_image_new_from_data;
|
||||
re->image_new_from_copied_data = _xre_xcb_image_new_from_copied_data;
|
||||
|
@ -490,7 +442,6 @@ eng_setup(Evas *e, void *in)
|
|||
evas_common_convert_init();
|
||||
evas_common_scale_init();
|
||||
evas_common_rectangle_init();
|
||||
evas_common_gradient_init();
|
||||
evas_common_polygon_init();
|
||||
evas_common_line_init();
|
||||
evas_common_font_init();
|
||||
|
@ -789,272 +740,6 @@ eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x,
|
|||
re->render_surface_polygon_draw((Xrender_Surface *)surface, (RGBA_Draw_Context *)context, (RGBA_Polygon_Point *)polygon, x, y);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
eng_gradient2_color_np_stop_insert(void *data __UNUSED__, void *gradient __UNUSED__, int r __UNUSED__, int g __UNUSED__, int b __UNUSED__, int a __UNUSED__, float pos __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_clear(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_transform_set(void *data __UNUSED__, void *gradient __UNUSED__, void *transform __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_fill_spread_set(void *data __UNUSED__, void *gradient __UNUSED__, int spread __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_linear_new(void *data __UNUSED__)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_free(void *data __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_fill_set(void *data __UNUSED__, void *linear_gradient __UNUSED__, float x0 __UNUSED__, float y0 __UNUSED__, float x1 __UNUSED__, float y1 __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_linear_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_render_post(void *data __UNUSED__, void *linear_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_linear_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *linear_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient2_radial_new(void *data __UNUSED__)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_free(void *data __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_fill_set(void *data __UNUSED__, void *radial_gradient __UNUSED__, float cx __UNUSED__, float cy __UNUSED__, float rx __UNUSED__, float ry __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_opaque(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient2_radial_is_visible(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_pre(void *data __UNUSED__, void *context __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_render_post(void *data __UNUSED__, void *radial_gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient2_radial_draw(void *data __UNUSED__, void *context __UNUSED__, void *surface __UNUSED__, void *radial_gradient __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_gradient_new(void *data)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
return re->gradient_new(re->xinf);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_free(void *data, void *gradient)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_free(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_stop_add(void *data, void *gradient, int r, int g, int b, int a, int delta)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_color_stop_add(gradient, r, g, b, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_stop_add(void *data, void *gradient, int a, int delta)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_alpha_stop_add(gradient, a, delta);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_color_data_set(void *data, void *gradient, void *map, int len, int has_alpha)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_color_data_set(gradient, map, len, has_alpha);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_alpha_data_set(void *data, void *gradient, void *alpha_map, int len)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_alpha_data_set(gradient, alpha_map, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_clear(void *data, void *gradient)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_clear(gradient);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_set(void *data, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_fill_set(gradient, x, y, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_angle_set(void *data, void *gradient, double angle)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_fill_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_fill_spread_set(void *data, void *gradient, int spread)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_fill_spread_set(gradient, spread);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_angle_set(void *data, void *gradient, double angle)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_angle_set(gradient, angle);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_offset_set(void *data, void *gradient, float offset)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_offset_set(gradient, offset);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_direction_set(void *data, void *gradient, int direction)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_direction_set(gradient, direction);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_type_set(void *data, void *gradient, char *name, char *params)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_type_set(gradient, name, params);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_opaque(void *data __UNUSED__, void *context, void *gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
RGBA_Gradient *grad;
|
||||
RGBA_Draw_Context *dc = (RGBA_Draw_Context *)context;
|
||||
|
||||
if (!dc || !gradient) return 0;
|
||||
grad = ((XR_Gradient *)gradient)->grad;
|
||||
if(!grad || !grad->type.geometer) return 0;
|
||||
return !(grad->type.geometer->has_alpha(grad, dc->render_op) |
|
||||
grad->type.geometer->has_mask(grad, dc->render_op));
|
||||
}
|
||||
|
||||
static int
|
||||
eng_gradient_is_visible(void *data __UNUSED__, void *context, void *gradient, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
||||
{
|
||||
if (!context || !gradient) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_pre(void *data __UNUSED__, void *context, void *gradient)
|
||||
{
|
||||
int len;
|
||||
RGBA_Gradient *grad;
|
||||
|
||||
if (!context || !gradient) return;
|
||||
grad = ((XR_Gradient *)gradient)->grad;
|
||||
if(!grad || !grad->type.geometer) return;
|
||||
grad->type.geometer->geom_set(grad);
|
||||
len = grad->type.geometer->get_map_len(grad);
|
||||
evas_common_gradient_map(context, grad, len);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_render_post(void *data __UNUSED__, void *gradient __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
eng_gradient_draw(void *data, void *context, void *surface, void *gradient, int x, int y, int w, int h)
|
||||
{
|
||||
Render_Engine *re = (Render_Engine *)data;
|
||||
|
||||
re->gradient_draw(surface, context, gradient, x, y, w, h);
|
||||
}
|
||||
|
||||
static int
|
||||
eng_image_alpha_get(void *data, void *image)
|
||||
{
|
||||
|
@ -1572,46 +1257,6 @@ module_open(Evas_Module *em)
|
|||
ORD(line_draw);
|
||||
ORD(polygon_draw);
|
||||
|
||||
ORD(gradient2_color_np_stop_insert);
|
||||
ORD(gradient2_clear);
|
||||
ORD(gradient2_fill_transform_set);
|
||||
ORD(gradient2_fill_spread_set);
|
||||
ORD(gradient2_linear_new);
|
||||
ORD(gradient2_linear_free);
|
||||
ORD(gradient2_linear_fill_set);
|
||||
ORD(gradient2_linear_is_opaque);
|
||||
ORD(gradient2_linear_is_visible);
|
||||
ORD(gradient2_linear_render_pre);
|
||||
ORD(gradient2_linear_render_post);
|
||||
ORD(gradient2_linear_draw);
|
||||
ORD(gradient2_radial_new);
|
||||
ORD(gradient2_radial_free);
|
||||
ORD(gradient2_radial_fill_set);
|
||||
ORD(gradient2_radial_is_opaque);
|
||||
ORD(gradient2_radial_is_visible);
|
||||
ORD(gradient2_radial_render_pre);
|
||||
ORD(gradient2_radial_render_post);
|
||||
ORD(gradient2_radial_draw);
|
||||
|
||||
ORD(gradient_new);
|
||||
ORD(gradient_free);
|
||||
ORD(gradient_color_stop_add);
|
||||
ORD(gradient_alpha_stop_add);
|
||||
ORD(gradient_color_data_set);
|
||||
ORD(gradient_alpha_data_set);
|
||||
ORD(gradient_clear);
|
||||
ORD(gradient_fill_set);
|
||||
ORD(gradient_fill_angle_set);
|
||||
ORD(gradient_fill_spread_set);
|
||||
ORD(gradient_angle_set);
|
||||
ORD(gradient_offset_set);
|
||||
ORD(gradient_direction_set);
|
||||
ORD(gradient_type_set);
|
||||
ORD(gradient_is_opaque);
|
||||
ORD(gradient_is_visible);
|
||||
ORD(gradient_render_pre);
|
||||
ORD(gradient_render_post);
|
||||
ORD(gradient_draw);
|
||||
ORD(image_load);
|
||||
ORD(image_new_from_data);
|
||||
ORD(image_new_from_copied_data);
|
||||
|
|
|
@ -261,49 +261,4 @@ void _xre_xcb_font_surface_free(XR_Font_Surface *fs);
|
|||
void _xre_xcb_font_surface_draw(Ximage_Info *xinf, RGBA_Image *surface, RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg, int x, int y);
|
||||
#endif
|
||||
|
||||
typedef struct _XR_Gradient XR_Gradient;
|
||||
|
||||
struct _XR_Gradient
|
||||
{
|
||||
Ximage_Info *xinf;
|
||||
Xrender_Surface *surface;
|
||||
RGBA_Gradient *grad;
|
||||
unsigned char changed : 1;
|
||||
int sw, sh;
|
||||
};
|
||||
|
||||
XR_Gradient *_xre_xlib_gradient_new(Ximage_Info *xinf);
|
||||
void _xre_xlib_gradient_free(XR_Gradient *gr);
|
||||
void _xre_xlib_gradient_color_stop_add(XR_Gradient *gr, int r, int g, int b, int a, int delta);
|
||||
void _xre_xlib_gradient_alpha_stop_add(XR_Gradient *gr, int a, int delta);
|
||||
void _xre_xlib_gradient_color_data_set(XR_Gradient *gr, void *map, int len, int has_alpha);
|
||||
void _xre_xlib_gradient_alpha_data_set(XR_Gradient *gr, void *alpha_map, int len);
|
||||
void _xre_xlib_gradient_clear(XR_Gradient *gr);
|
||||
void _xre_xlib_gradient_fill_set(XR_Gradient *gr, int x, int y, int w, int h);
|
||||
void _xre_xlib_gradient_fill_angle_set(XR_Gradient *gr, double angle);
|
||||
void _xre_xlib_gradient_fill_spread_set(XR_Gradient *gr, int spread);
|
||||
void _xre_xlib_gradient_angle_set(XR_Gradient *gr, double angle);
|
||||
void _xre_xlib_gradient_offset_set(XR_Gradient *gr, float offset);
|
||||
void _xre_xlib_gradient_direction_set(XR_Gradient *gr, int direction);
|
||||
void _xre_xlib_gradient_type_set(XR_Gradient *gr, char *name, char *params);
|
||||
void _xre_xlib_gradient_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, XR_Gradient *gr, int x, int y, int w, int h);
|
||||
|
||||
#ifdef BUILD_ENGINE_XRENDER_XCB
|
||||
XR_Gradient *_xre_xcb_gradient_new(Ximage_Info *xinf);
|
||||
void _xre_xcb_gradient_free(XR_Gradient *gr);
|
||||
void _xre_xcb_gradient_color_stop_add(XR_Gradient *gr, int r, int g, int b, int a, int delta);
|
||||
void _xre_xcb_gradient_alpha_stop_add(XR_Gradient *gr, int a, int delta);
|
||||
void _xre_xcb_gradient_color_data_set(XR_Gradient *gr, void *map, int len, int has_alpha);
|
||||
void _xre_xcb_gradient_alpha_data_set(XR_Gradient *gr, void *alpha_map, int len);
|
||||
void _xre_xcb_gradient_clear(XR_Gradient *gr);
|
||||
void _xre_xcb_gradient_fill_set(XR_Gradient *gr, int x, int y, int w, int h);
|
||||
void _xre_xcb_gradient_fill_angle_set(XR_Gradient *gr, double angle);
|
||||
void _xre_xcb_gradient_fill_spread_set(XR_Gradient *gr, int spread);
|
||||
void _xre_xcb_gradient_angle_set(XR_Gradient *gr, double angle);
|
||||
void _xre_xcb_gradient_offset_set(XR_Gradient *gr, float offset);
|
||||
void _xre_xcb_gradient_direction_set(XR_Gradient *gr, int direction);
|
||||
void _xre_xcb_gradient_type_set(XR_Gradient *gr, char *name, char *params);
|
||||
void _xre_xcb_gradient_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, XR_Gradient *gr, int x, int y, int w, int h);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,208 +0,0 @@
|
|||
#include "evas_common.h"
|
||||
#include "evas_private.h"
|
||||
#include "evas_engine.h"
|
||||
#include "Evas_Engine_XRender_X11.h"
|
||||
#include <math.h>
|
||||
|
||||
XR_Gradient *
|
||||
_xre_xcb_gradient_new(Ximage_Info *xinf)
|
||||
{
|
||||
XR_Gradient *gr;
|
||||
|
||||
if (!xinf) return NULL;
|
||||
gr = calloc(1, sizeof(XR_Gradient));
|
||||
if (!gr) return NULL;
|
||||
gr->grad = evas_common_gradient_new();
|
||||
if (!gr->grad)
|
||||
{
|
||||
free(gr);
|
||||
return NULL;
|
||||
}
|
||||
gr->xinf = xinf;
|
||||
gr->xinf->references++;
|
||||
gr->changed = 1;
|
||||
return gr;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_free(XR_Gradient *gr)
|
||||
{
|
||||
if (!gr) return;
|
||||
if (gr->grad)
|
||||
evas_common_gradient_free(gr->grad);
|
||||
if (gr->surface)
|
||||
_xr_xcb_render_surface_free(gr->surface);
|
||||
_xr_xcb_image_info_free(gr->xinf);
|
||||
free(gr);
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_color_stop_add(XR_Gradient *gr, int r, int g, int b, int a, int delta)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_color_stop_add(gr->grad, r, g, b, a, delta);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_alpha_stop_add(XR_Gradient *gr, int a, int delta)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_alpha_stop_add(gr->grad, a, delta);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_clear(XR_Gradient *gr)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_clear(gr->grad);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_color_data_set(XR_Gradient *gr, void *map, int len, int has_alpha)
|
||||
{
|
||||
evas_common_gradient_color_data_set(gr->grad, map, len, has_alpha);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_alpha_data_set(XR_Gradient *gr, void *amap, int len)
|
||||
{
|
||||
evas_common_gradient_alpha_data_set(gr->grad, amap, len);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_fill_set(XR_Gradient *gr, int x, int y, int w, int h)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_fill_set(gr->grad, x, y, w, h);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_fill_angle_set(XR_Gradient *gr, double angle)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_fill_angle_set(gr->grad, angle);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_fill_spread_set(XR_Gradient *gr, int spread)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_fill_spread_set(gr->grad, spread);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_angle_set(XR_Gradient *gr, double angle)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_map_angle_set(gr->grad, angle);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_offset_set(XR_Gradient *gr, float offset)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_map_offset_set(gr->grad, offset);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_direction_set(XR_Gradient *gr, int direction)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_map_direction_set(gr->grad, direction);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_type_set(XR_Gradient *gr, char *name, char *params)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_type_set(gr->grad, name, params);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xcb_gradient_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, XR_Gradient *gr, int x, int y, int w, int h)
|
||||
{
|
||||
int alpha = 0;
|
||||
|
||||
if ((w < 1) || (h < 1)) return;
|
||||
if (!rs || !dc || !gr) return;
|
||||
if (!gr->xinf || !gr->grad || !gr->grad->type.geometer) return;
|
||||
|
||||
if (gr->grad->type.geometer->has_alpha(gr->grad, dc->render_op) ||
|
||||
gr->grad->type.geometer->has_mask(gr->grad, dc->render_op))
|
||||
alpha = 1;
|
||||
if (((gr->sw != w) || (gr->sh != h)) && gr->surface)
|
||||
{
|
||||
_xr_xcb_render_surface_free(gr->surface);
|
||||
gr->surface = NULL;
|
||||
gr->changed = 1;
|
||||
}
|
||||
if (!gr->surface)
|
||||
{
|
||||
gr->surface = _xr_xcb_render_surface_new(gr->xinf, w, h, gr->xinf->x11.fmt32, 1);
|
||||
if (!gr->surface) return;
|
||||
gr->changed = 1;
|
||||
}
|
||||
if (gr->changed)
|
||||
{
|
||||
int op = dc->render_op, cuse = dc->clip.use;
|
||||
RGBA_Image *im;
|
||||
Ximage_Image *xim;
|
||||
|
||||
xim = _xr_xcb_image_new(gr->xinf, w, h, gr->surface->depth);
|
||||
if (!xim)
|
||||
{
|
||||
_xr_xcb_render_surface_free(gr->surface);
|
||||
gr->surface = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
im = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
|
||||
w, h,
|
||||
(DATA32 *)xim->data,
|
||||
1, EVAS_COLORSPACE_ARGB8888);
|
||||
if (!im)
|
||||
{
|
||||
_xr_xcb_render_surface_free(gr->surface);
|
||||
gr->surface = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
dc->render_op = _EVAS_RENDER_FILL;
|
||||
dc->clip.use = 0;
|
||||
evas_common_gradient_draw(im, dc, 0, 0, w, h, gr->grad);
|
||||
if
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
(xim->x11.xcb.xim->byte_order == XCB_IMAGE_ORDER_LSB_FIRST)
|
||||
#else
|
||||
(xim->x11.xcb.xim->byte_order == XCB_IMAGE_ORDER_MSB_FIRST)
|
||||
#endif
|
||||
{
|
||||
DATA32 *p = im->image.data, *pe = p + (w * h);
|
||||
while (p < pe)
|
||||
{
|
||||
*p = (*p << 24) + ((*p << 8) & 0xff0000) + ((*p >> 8) & 0xff00) + (*p >> 24);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
_xr_xcb_image_put(xim, gr->surface->x11.xcb.draw, 0, 0, w, h);
|
||||
evas_cache_image_drop(&im->cache_entry);
|
||||
dc->render_op = op;
|
||||
dc->clip.use = cuse;
|
||||
}
|
||||
gr->surface->alpha = alpha;
|
||||
_xr_xcb_render_surface_composite(gr->surface, rs, dc, 0, 0, gr->surface->width, gr->surface->height, x, y, w, h, 0);
|
||||
gr->changed = 0;
|
||||
gr->sw = w; gr->sh = h;
|
||||
}
|
|
@ -1,209 +0,0 @@
|
|||
#include "evas_common.h"
|
||||
#include "evas_private.h"
|
||||
#include "evas_engine.h"
|
||||
#include "Evas_Engine_XRender_X11.h"
|
||||
#include <math.h>
|
||||
|
||||
XR_Gradient *
|
||||
_xre_xlib_gradient_new(Ximage_Info *xinf)
|
||||
{
|
||||
XR_Gradient *gr;
|
||||
|
||||
if (!xinf) return NULL;
|
||||
gr = calloc(1, sizeof(XR_Gradient));
|
||||
if (!gr) return NULL;
|
||||
gr->grad = evas_common_gradient_new();
|
||||
if (!gr->grad)
|
||||
{
|
||||
free(gr);
|
||||
return NULL;
|
||||
}
|
||||
gr->xinf = xinf;
|
||||
gr->xinf->references++;
|
||||
gr->changed = 1;
|
||||
return gr;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_free(XR_Gradient *gr)
|
||||
{
|
||||
if (!gr) return;
|
||||
if (gr->grad)
|
||||
evas_common_gradient_free(gr->grad);
|
||||
if (gr->surface)
|
||||
_xr_xlib_render_surface_free(gr->surface);
|
||||
_xr_xlib_image_info_free(gr->xinf);
|
||||
free(gr);
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_color_stop_add(XR_Gradient *gr, int r, int g, int b, int a, int delta)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_color_stop_add(gr->grad, r, g, b, a, delta);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_alpha_stop_add(XR_Gradient *gr, int a, int delta)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_alpha_stop_add(gr->grad, a, delta);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_clear(XR_Gradient *gr)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_clear(gr->grad);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_color_data_set(XR_Gradient *gr, void *map, int len, int has_alpha)
|
||||
{
|
||||
evas_common_gradient_color_data_set(gr->grad, map, len, has_alpha);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_alpha_data_set(XR_Gradient *gr, void *amap, int len)
|
||||
{
|
||||
evas_common_gradient_alpha_data_set(gr->grad, amap, len);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_fill_set(XR_Gradient *gr, int x, int y, int w, int h)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_fill_set(gr->grad, x, y, w, h);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_fill_angle_set(XR_Gradient *gr, double angle)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_fill_angle_set(gr->grad, angle);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_fill_spread_set(XR_Gradient *gr, int spread)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_fill_spread_set(gr->grad, spread);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_angle_set(XR_Gradient *gr, double angle)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_map_angle_set(gr->grad, angle);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_offset_set(XR_Gradient *gr, float offset)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_map_offset_set(gr->grad, offset);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_direction_set(XR_Gradient *gr, int direction)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_map_direction_set(gr->grad, direction);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_type_set(XR_Gradient *gr, char *name, char *params)
|
||||
{
|
||||
if (!gr) return;
|
||||
evas_common_gradient_type_set(gr->grad, name, params);
|
||||
gr->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
_xre_xlib_gradient_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, XR_Gradient *gr, int x, int y, int w, int h)
|
||||
{
|
||||
int alpha = 0;
|
||||
|
||||
if ((w < 1) || (h < 1)) return;
|
||||
if (!rs || !dc || !gr) return;
|
||||
if (!gr->xinf || !gr->grad || !gr->grad->type.geometer) return;
|
||||
|
||||
if (gr->grad->type.geometer->has_alpha(gr->grad, dc->render_op) ||
|
||||
gr->grad->type.geometer->has_mask(gr->grad, dc->render_op))
|
||||
alpha = 1;
|
||||
if (((gr->sw != w) || (gr->sh != h)) && gr->surface)
|
||||
{
|
||||
_xr_xlib_render_surface_free(gr->surface);
|
||||
gr->surface = NULL;
|
||||
gr->changed = 1;
|
||||
}
|
||||
if (!gr->surface)
|
||||
{
|
||||
gr->surface = _xr_xlib_render_surface_new(gr->xinf, w, h, gr->xinf->x11.fmt32, 1);
|
||||
if (!gr->surface) return;
|
||||
gr->changed = 1;
|
||||
}
|
||||
if (gr->changed)
|
||||
{
|
||||
int op = dc->render_op, cuse = dc->clip.use;
|
||||
RGBA_Image *im;
|
||||
Ximage_Image *xim;
|
||||
|
||||
xim = _xr_xlib_image_new(gr->xinf, w, h, gr->surface->depth);
|
||||
if (!xim)
|
||||
{
|
||||
_xr_xlib_render_surface_free(gr->surface);
|
||||
gr->surface = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
im = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
|
||||
w, h,
|
||||
(DATA32 *)xim->data,
|
||||
1, EVAS_COLORSPACE_ARGB8888);
|
||||
if (!im)
|
||||
{
|
||||
/* FIXME: xim is leaking. */
|
||||
_xr_xlib_render_surface_free(gr->surface);
|
||||
gr->surface = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
dc->render_op = _EVAS_RENDER_FILL;
|
||||
dc->clip.use = 0;
|
||||
evas_common_gradient_draw(im, dc, 0, 0, w, h, gr->grad);
|
||||
if
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
(xim->x11.xlib.xim->byte_order == LSBFirst)
|
||||
#else
|
||||
(xim->x11.xlib.xim->byte_order == MSBFirst)
|
||||
#endif
|
||||
{
|
||||
DATA32 *p = im->image.data, *pe = p + (w * h);
|
||||
while (p < pe)
|
||||
{
|
||||
*p = (*p << 24) + ((*p << 8) & 0xff0000) + ((*p >> 8) & 0xff00) + (*p >> 24);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
_xr_xlib_image_put(xim, gr->surface->x11.xlib.draw, 0, 0, w, h);
|
||||
evas_cache_image_drop(&im->cache_entry);
|
||||
dc->render_op = op;
|
||||
dc->clip.use = cuse;
|
||||
}
|
||||
gr->surface->alpha = alpha;
|
||||
_xr_xlib_render_surface_composite(gr->surface, rs, dc, 0, 0, gr->surface->width, gr->surface->height, x, y, w, h, 0);
|
||||
gr->changed = 0;
|
||||
gr->sw = w; gr->sh = h;
|
||||
}
|
Loading…
Reference in New Issue