Makefile
Makefile.in
*.so
+.*.sw[po]
/README
/aclocal.m4
/autom4te.cache/
/ltmain.sh
/missing
/stamp-h1
+tags
+cscope.out
EVAS_COLORSPACE_YCBCR422P601_PL, /**< YCbCr 4:2:2 Planar, ITU.BT-601 specifications. The data poitned to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
EVAS_COLORSPACE_YCBCR422P709_PL,/**< YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data poitned to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
- EVAS_COLORSPACE_GRY8 /**< 8bit grayscale */
+ EVAS_COLORSPACE_GRY8, /**< 8bit grayscale */
} Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
/**
{
EVAS_PIXEL_FORMAT_NONE = 0, /**< No pixel format */
EVAS_PIXEL_FORMAT_ARGB32 = 1, /**< ARGB 32bit pixel format with A in the high byte per 32bit pixel word */
- EVAS_PIXEL_FORMAT_YUV420P_601 = 2 /**< YUV 420 Planar format with CCIR 601 color encoding wuth contiguous planes in the order Y, U and V */
+ EVAS_PIXEL_FORMAT_YUV420P_601 = 2, /**< YUV 420 Planar format with CCIR 601 color encoding wuth contiguous planes in the order Y, U and V */
} Evas_Pixel_Import_Pixel_Format; /**< Pixel format for import call. See evas_object_image_pixels_import() */
struct _Evas_Pixel_Import_Source
EAPI Eina_Bool evas_map_alpha_get (const Evas_Map *m);
EAPI Evas_Map *evas_map_dup (const Evas_Map *m);
EAPI void evas_map_free (Evas_Map *m);
+ EAPI int evas_map_count_get (const Evas_Map *m) EINA_CONST;
EAPI void evas_map_point_coord_set (Evas_Map *m, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
EAPI void evas_map_point_coord_get (const Evas_Map *m, int idx, Evas_Coord *x, Evas_Coord *y, Evas_Coord *z);
EAPI void evas_map_point_image_uv_set (Evas_Map *m, int idx, double u, double v);
*
* R = (r * a) / 32; G = (g * a) / 32; B = (b * a) / 32;
*
+ * EVAS_COLORSPACE_A8:
+ *
+ * The image is just a alpha mask (8 bit's per pixel). This is used for alpha
+ * masking.
+ *
* @ingroup Evas_Object_Specific
*/
typedef void (*Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o);
EAPI void evas_object_image_content_hint_set (Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
EAPI Evas_Image_Content_Hint evas_object_image_content_hint_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
+ EAPI void evas_object_image_alpha_mask_set (Evas_Object *, Eina_Bool) EINA_ARG_NONNULL(1);
+
/**
* @defgroup Evas_Object_Text Text Object Functions
*
/**
* @defgroup Evas_Proxy Evas Proxy Objects
*
- * Provides a way of applying effects to complete objects.
+ * @brief Provides a way of applying effects to complete objects.
+ *
+ * A proxy object is a visible copy of another object. Generally a map or
+ * similar effect will be applied to the proxy to apply some sort of rendering
+ * effect to.
+ *
+ * Proxies are generally used for special effects.
*/
EAPI Evas_Object *evas_object_proxy_add (Evas *e) EINA_MALLOC;
EAPI Eina_Bool evas_object_proxy_source_set (Evas_Object *o, Evas_Object *source);
_evas_map_new(int count)
{
int i;
- Evas_Map *m = calloc(1, sizeof(Evas_Map) + (count * sizeof(Evas_Map_Point)));
+ int alloc;
+ Evas_Map *m;
+
+ /* Adjust allocation such that: at least 4 points, and always an even
+ * number: this allows the software engine to work efficiently */
+ alloc = (count < 4) ? 4 : count;
+ if (alloc & 0x1) alloc ++;
+
+ m = calloc(1, sizeof(Evas_Map) + (alloc * sizeof(Evas_Map_Point)));
if (!m) return NULL;
m->count = count;
m->persp.foc = 0;
evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y,
Evas_Coord *mx, Evas_Coord *my, int grab)
{
- int i, j, edges, edge[4][2], douv;
+ int i, j, edges, edge[m->count][2], douv;
Evas_Coord xe[2];
double u[2] = { 0.0, 0.0 };
double v[2] = { 0.0, 0.0 };
- if (m->count != 4) return 0;
+ if (m->count < 4) return 0;
// FIXME need to handle grab mode and extrapolte coords outside
// map
if (grab)
{
Evas_Coord ymin, ymax;
-
+
ymin = m->points[0].y;
ymax = m->points[0].y;
for (i = 1; i < m->count; i++)
{
- if (m->points[i].y < ymin) ymin = m->points[i].y;
- else if (m->points[i].y > ymax) ymax = m->points[i].y;
+ if (m->points[i].y < ymin) ymin = m->points[i].y;
+ else if (m->points[i].y > ymax) ymax = m->points[i].y;
}
if (y <= ymin) y = ymin + 1;
if (y >= ymax) y = ymax - 1;
if (xe[0] > xe[1])
{
int ti;
-
+
ti = xe[0]; xe[0] = xe[1]; xe[1] = ti;
if (douv)
{
double td;
-
+
td = u[0]; u[0] = u[1]; u[1] = td;
td = v[0]; v[0] = v[1]; v[1] = td;
}
{
if (douv)
{
- if (mx)
- *mx = u[0] + (((x - xe[0]) * (u[1] - u[0])) /
+ if (mx)
+ *mx = u[0] + (((x - xe[0]) * (u[1] - u[0])) /
(xe[1] - xe[0]));
if (my)
- *my = v[0] + (((x - xe[0]) * (v[1] - v[0])) /
+ *my = v[0] + (((x - xe[0]) * (v[1] - v[0])) /
(xe[1] - xe[0]));
}
return 1;
{
if (douv)
{
- if (mx)
- *mx = u[0] + (((x - xe[0]) * (u[1] - u[0])) /
+ if (mx)
+ *mx = u[0] + (((x - xe[0]) * (u[1] - u[0])) /
(xe[1] - xe[0]));
if (my)
- *my = v[0] + (((x - xe[0]) * (v[1] - v[0])) /
+ *my = v[0] + (((x - xe[0]) * (v[1] - v[0])) /
(xe[1] - xe[0]));
}
return 1;
}
return;
}
- if (!obj->cur.map)
- {
- obj->cur.map = _evas_map_dup(map);
- if (obj->cur.usemap)
- evas_object_mapped_clip_across_mark(obj);
- }
- else
+
+ if (obj->cur.map && obj->cur.map->count == map->count)
{
Evas_Map *omap = obj->cur.map;
- obj->cur.map = _evas_map_new(4);
- memcpy(obj->cur.map, omap, sizeof(Evas_Map) + (4 * sizeof(Evas_Map_Point)));
+ obj->cur.map = _evas_map_new(map->count);
+ memcpy(obj->cur.map, omap, sizeof(Evas_Map) + (map->count * sizeof(Evas_Map_Point)));
_evas_map_copy(obj->cur.map, map);
if (obj->prev.map == omap) obj->prev.map = NULL;
free(omap);
}
+ else
+ {
+ if (obj->cur.map) evas_map_free(obj->cur.map);
+ obj->cur.map = _evas_map_dup(map);
+ if (obj->cur.usemap)
+ evas_object_mapped_clip_across_mark(obj);
+ }
_evas_map_calc_map_geometry(obj);
}
EAPI Evas_Map *
evas_map_new(int count)
{
- if (count != 4)
+ if (count < 4)
{
- ERR("num (%i) != 4 is unsupported!", count);
+ ERR("num (%i) < 4 is unsupported!", count);
return NULL;
}
return _evas_map_new(count);
}
/**
+ * Get a maps size.
+ *
+ * Returns the number of points in a map. Should be at least 4.
+ *
+ * @param m map to get size.
+ * @return -1 on error, points otherwise.
+ */
+EAPI int
+evas_map_count_get(const Evas_Map *m)
+{
+ if (!m) return -1;
+ return m->count;
+}
+
+/**
* Change the map point's coordinate.
*
* This sets the fixen point's coordinate in the map. Note that points
x = m->points[i].x;
y = m->points[i].y;
z = m->points[i].z;
-
+printf("Normal %d\n",i);
// calc normal
- h = (i + m->count - 1) % m->count; // prev point
- j = (i + 1) % m->count; // next point
+ h = (i - 1 + 4) % 4 + (i & ~0x3); // prev point
+ j = (i + 1) % 4 + (i & ~0x3); // next point
+printf("\tNext/Prev: %2d/%2d\n",h,j);
x1 = m->points[h].x - x;
y1 = m->points[h].y - y;
x2 = m->points[j].x - x;
y2 = m->points[j].y - y;
z2 = m->points[j].z - z;
-
+printf("\tX: %3.2lf,%3.2lf,%3.2lf\n",x,y,z);
+printf("\tX1: %3.2lf,%3.2lf,%3.2lf\n",x1,y1,z1);
+printf("\tX2: %3.2lf,%3.2lf,%3.2lf\n",x2,y2,z2);
nx = (y1 * z2) - (z1 * y2);
ny = (z1 * x2) - (x1 * z2);
nz = (x1 * y2) - (y1 * x2);
ln = (nx * nx) + (ny * ny) + (nz * nz);
ln = sqrt(ln);
+printf("\tLength: %3.2lf\n",ln);
if (ln != 0.0)
{
ny /= ln;
nz /= ln;
}
-
+printf("\tpoint %2d: %3.2lf,%3.2lf,%3.2lf normal: %3.2lf %3.2lf %3.2lf\n",i,x,y,z,nx,ny,nz);
+
// calc point -> light vector
x = lx - x;
y = ly - y;
mr = ar + ((lr - ar) * br);
mg = ag + ((lg - ag) * br);
mb = ab + ((lb - ab) * br);
- mr = (mr * m->points[i].a) / 255;
- mg = (mg * m->points[i].a) / 255;
- mb = (mb * m->points[i].a) / 255;
+ if (m->points[i].a != 255){
+ mr = (mr * m->points[i].a) / 255;
+ mg = (mg * m->points[i].a) / 255;
+ mb = (mb * m->points[i].a) / 255;
+ }
m->points[i].r = (m->points[i].r * mr) / 255;
m->points[i].g = (m->points[i].g * mg) / 255;
m->points[i].b = (m->points[i].b * mb) / 255;
}
/**
+ * Enable an image to be used as an alpha mask.
+ *
+ * This will set any flags, and discard any excess image data not used as an
+ * alpha mask.
+ *
+ * Note there is little point in using a image as alpha mask unless it has an
+ * alpha channel.
+ *
+ * @param obj Object to use as an alpha mask.
+ * @param ismask Use image as alphamask, must be true.
+ */
+EAPI void
+evas_object_image_alpha_mask_set(Evas_Object *obj, Eina_Bool ismask)
+{
+ Evas_Object_Image *o;
+
+ if (!ismask) return;
+
+ MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+ return;
+ MAGIC_CHECK_END();
+ o = (Evas_Object_Image *)(obj->object_data);
+ MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
+ return;
+ MAGIC_CHECK_END();
+
+ /* Convert to A8 if not already */
+
+ /* done */
+
+}
+
+/**
* Get the content hint of a given image of the canvas.
*
* @param obj The given canvas pointer.
}
o->dirty_pixels = 0;
}
- if ((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap))
+ if ((obj->cur.map) && (obj->cur.map->count > 3) && (obj->cur.usemap))
{
const Evas_Map_Point *p, *p_end;
- RGBA_Map_Point pts[4], *pt;
+ RGBA_Map_Point pts[obj->cur.map->count], *pt;
p = obj->cur.map->points;
- p_end = p + 4;
+ p_end = p + obj->cur.map->count;
pt = pts;
pts[0].px = obj->cur.map->persp.px << FP;
else if (pt->v > (o->cur.image.h * FP1)) pt->v = (o->cur.image.h * FP1);
pt->col = ARGB_JOIN(p->a, p->r, p->g, p->b);
}
- obj->layer->evas->engine.func->image_map4_draw
- (output, context, surface, o->engine_data, pts,
- o->cur.smooth_scale | obj->cur.map->smooth, 0);
+ if (obj->cur.map->count & 0x1)
+ {
+ pts[obj->cur.map->count] = pts[obj->cur.map->count -1];
+ }
+
+ obj->layer->evas->engine.func->image_map_draw
+ (output, context, surface, o->engine_data, obj->cur.map->count,
+ pts, o->cur.smooth_scale | obj->cur.map->smooth, 0);
}
else
{
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
evas_object_image_fill_set(obj, 0, 0, w, h);
}
+
+/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
Evas_Map *defmap;
Eina_Bool mapupdate;
+ Eina_Bool rendering;
} Evas_Object_Proxy;
};
+/**
+ * Add a new proxy object.
+ *
+ * The proxy object must have a source set before it is useful.
+ *
+ * @param e Evas canvas to add proxy too.
+ * @return New proxy object.
+ */
EAPI Evas_Object *
evas_object_proxy_add(Evas *e)
{
return obj;
}
+/**
+ * Set the source object on a proxy object.
+ *
+ * Any existing source object will be removed. Setting the src to NULL clears
+ * the proxy object.
+ *
+ * You cannot set a proxy on a proxy.
+ *
+ * @param obj Proxy object.
+ * @param src Source of the proxy.
+ * @return EINA_TRUE on success, EINA_FALSE on error.
+ */
EAPI Eina_Bool
evas_object_proxy_source_set(Evas_Object *obj, Evas_Object *src)
{
- Evas_Object_Proxy *o,*so;
+ Evas_Object_Proxy *o;
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
- return false;
+ return EINA_FALSE;
MAGIC_CHECK_END();
o = obj->object_data;
MAGIC_CHECK(o, Evas_Object_Proxy, MAGIC_OBJ_PROXY);
- return false;
+ return EINA_FALSE;
MAGIC_CHECK_END();
- if (o->source == src) return true;
-
- if (src)
- {
- MAGIC_CHECK(src, Evas_Object, MAGIC_OBJ);
- return false;
- MAGIC_CHECK_END();
- so = src->object_data;
- /* Stop the loop _now_ */
- /* FIXME: Should I check for smarts that contain proxies too? */
- if (so->magic == MAGIC_OBJ_PROXY)
- return false;
- }
+ if (src == obj) return EINA_FALSE;
+ if (o->source == src) return EINA_TRUE;
if (o->source)
{
_proxy_set(obj, src);
}
- return true;
+ return EINA_TRUE;
}
+/**
+ * Get the current source object of a proxy.
+ *
+ * @param obj Proxy object
+ * @return Source object, or NULL on error.
+ */
EAPI Evas_Object *
evas_object_proxy_source_get(Evas_Object *obj)
{
return o->source;
}
+/**
+ * Clear the source on a proxy.
+ *
+ * This is equivalent to calling evas_object_proxy_source_set with a NULL
+ * source.
+ *
+ * @param obj Proxy object to clear source of.
+ * @return EINA_TRUE on success, EINA_FALSE on error.
+ */
EAPI Eina_Bool
-evas_object_proxy_source_unset(Evas_Object *o)
+evas_object_proxy_source_unset(Evas_Object *obj)
{
- return evas_object_proxy_source_set(o, NULL);
+ return evas_object_proxy_source_set(obj, NULL);
}
-
/* Internal helpers */
static void
evas_object_proxy_init(Evas_Object *obj)
o = obj->object_data;
+ if (o->rendering)
+ {
+ int r = rand() % 255;
+ int g = rand() % 255;
+ int b = rand() % 255;
+ printf("Ahh: Recursive proxies: Go away!\n");
+ obj->layer->evas->engine.func->context_color_set(output,
+ context,
+ r,g,b,255);
+ obj->layer->evas->engine.func->context_multiplier_unset(output,
+ context);
+ obj->layer->evas->engine.func->context_render_op_set(output, context,
+ obj->cur.render_op);
+ obj->layer->evas->engine.func->rectangle_draw(output,
+ context,
+ surface,
+ obj->cur.geometry.x + x,
+ obj->cur.geometry.y + y,
+ obj->cur.geometry.w,
+ obj->cur.geometry.h);
+ return;
+ }
+
+
if (!o->source) return;
// ENFN->context_multiplier_unset(output, context);
}
else
{
+ o->rendering = true;
_proxy_subrender(obj->layer->evas, o->source);
pixels = o->source->proxy.surface;
+ o->rendering = false;
}
if (o->mapupdate) _proxy_map_update(obj);
pt->v = p->v * FP1;
pt->col = ARGB_JOIN(p->a, p->r, p->g, p->b);
}
- obj->layer->evas->engine.func->image_map4_draw
- (output, context, surface, pixels, pts, map->smooth, 0);
+ obj->layer->evas->engine.func->image_map_draw
+ (output, context, surface, pixels, map->count, pts,
+ map->smooth, 0);
}
else
{
// set render_pre - for child objs that may not have gotten it.
obj->pre_render_done = 1;
-
+ RD(" Hasmap: %p (%d) %p %d -> %d\n",obj->func->can_map,
+ obj->func->can_map ? obj->func->can_map(obj): -1,
+ obj->cur.map, obj->cur.usemap,
+ _evas_render_has_map(obj));
if (_evas_render_has_map(obj))
{
const Evas_Map_Point *p, *p_end;
pts[0].z0 = obj->cur.map->persp.z0 << FP;
p = obj->cur.map->points;
- p_end = p + 4;
+ p_end = p + obj->cur.map->count;
pt = pts;
for (; p < p_end; p++, pt++)
{
else if (pt->v > (sh * FP1)) pt->v = (sh * FP1);
pt->col = ARGB_JOIN(p->a, p->r, p->g, p->b);
}
+ /* Copy last for software engine */
+ if (obj->cur.map->count & 0x1)
+ {
+ pts[obj->cur.map->count] = pts[obj->cur.map->count - 1];
+ }
+
if (obj->cur.map->surface)
{
}
}
if (obj->cur.cache.clip.visible)
- obj->layer->evas->engine.func->image_map4_draw
+ obj->layer->evas->engine.func->image_map_draw
(e->engine.data.output, e->engine.data.context, surface,
- obj->cur.map->surface, pts, obj->cur.map->smooth, 0);
+ obj->cur.map->surface, obj->cur.map->count, pts,
+ obj->cur.map->smooth, 0);
// FIXME: needs to cache these maps and
// keep them only rendering updates
// obj->layer->evas->engine.func->image_map_surface_free
#define CONVERT_A5P_TO_A8(s) \
((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7))
+#define CONVERT_ARGB_8888_TO_A_8(s) ((s) >> 24)
+
+
static inline void *
evas_common_convert_argb8888_to_rgb565_a5p(void *data __UNUSED__, int w __UNUSED__, int h __UNUSED__, int stride __UNUSED__, Eina_Bool has_alpha __UNUSED__)
{
return ret;
}
+static inline void *
+evas_common_convert_argb8888_to_a8(void *data, int w, int h, int stride, Eina_Bool has_alpha)
+{
+ uint32_t *src, *end;
+ uint8_t *ret, *dst;
+
+ src = data;
+ end = src + (stride * h);
+ ret = malloc(w * h);
+
+ if (!has_alpha)
+ {
+ return memset(ret,0xff, w * h);
+ }
+
+ for ( ; src < end ; src ++, dst ++)
+ *dst = CONVERT_ARGB_8888_TO_A_8(*src);
+ return ret;
+}
+
+
+
EAPI void *
evas_common_convert_argb8888_to(void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace)
{
{
case EVAS_COLORSPACE_RGB565_A5P:
return evas_common_convert_argb8888_to_rgb565_a5p(data, w, h, stride, has_alpha);
+ case EVAS_COLORSPACE_A8:
+ return evas_common_convert_argb8888_to_a8(data, w, h, stride, has_alpha);
default:
break;
}
}
return NULL;
}
+
+
+/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
#ifdef BUILD_SCALE_SMOOTH
# ifdef BUILD_MMX
# undef FUNC_NAME
-# define FUNC_NAME evas_common_map4_rgba_internal_mmx
+# define FUNC_NAME evas_common_map_rgba_internal_mmx
# undef SCALE_USING_MMX
# define SCALE_USING_MMX
# include "evas_map_image_internal.c"
# endif
# ifdef BUILD_C
# undef FUNC_NAME
-# define FUNC_NAME evas_common_map4_rgba_internal
+# define FUNC_NAME evas_common_map_rgba_internal
# undef SCALE_USING_MMX
# include "evas_map_image_internal.c"
# endif
#endif
EAPI void
-evas_common_map4_rgba(RGBA_Image *src, RGBA_Image *dst,
+evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc,
- RGBA_Map_Point *p,
+ int npoints, RGBA_Map_Point *p,
int smooth, int level)
{
#ifdef BUILD_MMX
{
#ifdef BUILD_MMX
if (mmx)
- evas_common_map4_rgba_internal_mmx(src, dst, dc, p, smooth, level);
+ evas_common_map_rgba_internal_mmx(src, dst, dc, p, smooth, level);
else
#endif
#ifdef BUILD_C
- evas_common_map4_rgba_internal(src, dst, dc, p, smooth, level);
+ evas_common_map_rgba_internal(src, dst, dc, p, smooth, level);
#endif
return;
}
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
#ifdef BUILD_MMX
if (mmx)
- evas_common_map4_rgba_internal_mmx(src, dst, dc, p, smooth, level);
+ evas_common_map_rgba_internal_mmx(src, dst, dc, p, smooth, level);
else
#endif
#ifdef BUILD_C
- evas_common_map4_rgba_internal(src, dst, dc, p, smooth, level);
+ evas_common_map_rgba_internal(src, dst, dc, p, smooth, level);
#endif
}
evas_common_draw_context_apply_clear_cutouts(rects);
#define _EVAS_MAP_H
EAPI void
-evas_common_map4_rgba(RGBA_Image *src, RGBA_Image *dst,
+evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc,
- RGBA_Map_Point *points,
+ int npoints, RGBA_Map_Point *points,
int smooth, int level);
#endif /* _EVAS_MAP_H */
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_Text_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);
-EAPI void evas_common_pipe_map4_begin(RGBA_Image *root);
-EAPI void evas_common_pipe_map4_draw(RGBA_Image *src, RGBA_Image *dst,
+EAPI void evas_common_pipe_map_begin(RGBA_Image *root);
+EAPI void evas_common_pipe_map_draw(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc, RGBA_Map_Point *p,
int smooth, int level);
EAPI void evas_common_pipe_flush(RGBA_Image *im);
DATA32 col;
} col;
struct RGBA_Draw_Context_clip {
+ DATA8 *mask;
int x, y, w, h;
Eina_Bool use : 1;
} clip;
int (*image_scale_hint_get) (void *data, void *image);
int (*font_last_up_to_pos) (void *data, void *font, const Eina_Unicode *text, const Evas_Text_Props *intl_props, int x, int y);
- void (*image_map4_draw) (void *data, void *context, void *surface, void *image, RGBA_Map_Point *p, int smooth, int level);
+ void (*image_map_draw) (void *data, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level);
void *(*image_map_surface_new) (void *data, int w, int h, int alpha);
void (*image_map_surface_free) (void *data, void *surface);
--- /dev/null
+"#ifdef GL_ES\n"
+"precision mediump float;\n"
+"#endif\n"
+"uniform sampler2D tex, texm;\n"
+"varying vec4 col;\n"
+"varying vec2 tex_c, tex_cm;\n"
+"void main()\n"
+"{\n"
+" gl_FragColor = texture2D(texm, tex_cm.xy).aaaa * texture2D(tex, tex_c.xy).rgba * col;\n"
+"}\n"
+"\n"
--- /dev/null
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2D tex, texm;
+varying vec4 col;
+varying vec2 tex_c, tex_cm;
+void main()
+{
+ gl_FragColor = texture2D(texm, tex_cm.xy).aaaa * texture2D(tex, tex_c.xy).rgba * col;
+}
+
--- /dev/null
+"#ifdef GL_ES\n"
+"precision mediump float;\n"
+"#endif\n"
+"attribute vec4 vertex;\n"
+"attribute vec4 color;\n"
+"attribute vec2 tex_coord, tex_coordm;\n"
+"uniform mat4 mvp;\n"
+"varying vec4 col;\n"
+"varying vec2 tex_c, tex_cm;\n"
+"void main()\n"
+"{\n"
+" gl_Position = mvp * vertex;\n"
+" col = color;\n"
+" tex_c = tex_coord;\n"
+" tex_cm = tex_coordm;\n"
+"}\n"
--- /dev/null
+#ifdef GL_ES
+precision mediump float;
+#endif
+attribute vec4 vertex;
+attribute vec4 color;
+attribute vec2 tex_coord, tex_coordm;
+uniform mat4 mvp;
+varying vec4 col;
+varying vec2 tex_c, tex_cm;
+void main()
+{
+ gl_Position = mvp * vertex;
+ col = color;
+ tex_c = tex_coord;
+ tex_cm = tex_coordm;
+}
}
static void
-eng_image_map4_draw(void *data __UNUSED__, void *context, void *surface, void *image, RGBA_Map_Point *p, int smooth, int level)
+eng_image_map_draw(void *data __UNUSED__, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level)
{
Evas_GL_Image *gim = image;
Render_Engine *re;
ORD(image_scale_hint_get);
ORD(image_stride_get);
- ORD(image_map4_draw);
+ ORD(image_map_draw);
ORD(image_map_surface_new);
ORD(image_map_surface_free);
}
static void
-eng_image_map4_draw(void *data __UNUSED__, void *context, void *surface, void *image, RGBA_Map_Point *p, int smooth, int level)
+eng_image_map_draw(void *data __UNUSED__, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level)
{
RGBA_Image *im;
if (!image) return;
+ if (npoints < 3) return;
im = image;
+
if ((p[0].x == p[3].x) &&
(p[1].x == p[2].x) &&
(p[0].y == p[1].y) &&
&& evas_common_frameq_enabled()
# endif
)
- evas_common_pipe_map4_draw(im, surface, context, p, smooth, level);
+ evas_common_pipe_map_draw(im, surface, context, npoints, p, smooth, level);
else
#endif
- evas_common_map4_rgba(im, surface, context, p, smooth, level);
+ evas_common_map_rgba(im, surface, context, npoints, p, smooth, level);
}
evas_common_cpu_end_opt();
+
+ if (npoints > 4)
+ {
+ eng_image_map_draw(data, context, surface, image, npoints - 2, p + 2,
+ smooth, level);
+ }
}
static void *
/* more font draw functions */
eng_font_last_up_to_pos,
/* FUTURE software generic calls go here (done) */
- eng_image_map4_draw,
+ eng_image_map_draw,
eng_image_map_surface_new,
eng_image_map_surface_free,
NULL, // eng_image_content_hint_set - software doesn't use it