static void
_format_command_init(void)
{
- /* if (fontstr) return;
- fontstr = eina_stringshare_add("font");
- font_fallbacksstr = eina_stringshare_add("font_fallbacks");
- font_sizestr = eina_stringshare_add("font_size");
- font_sourcestr = eina_stringshare_add("font_source");
- colorstr = eina_stringshare_add("color");
- underline_colorstr = eina_stringshare_add("underline_color");
- underline2_colorstr = eina_stringshare_add("underline2_color");
- outline_colorstr = eina_stringshare_add("outline_color");
- shadow_colorstr = eina_stringshare_add("shadow_color");
- glow_colorstr = eina_stringshare_add("glow_color");
- glow2_colorstr = eina_stringshare_add("glow2_color");
- backing_colorstr = eina_stringshare_add("backing_color");
- strikethrough_colorstr = eina_stringshare_add("strikethrough_color");
- alignstr = eina_stringshare_add("align");
- valignstr = eina_stringshare_add("valign");
- wrapstr = eina_stringshare_add("wrap");
- left_marginstr = eina_stringshare_add("left_margin");
- right_marginstr = eina_stringshare_add("right_margin");
- underlinestr = eina_stringshare_add("underline");
- strikethroughstr = eina_stringshare_add("strikethrough");
- backingstr = eina_stringshare_add("backing");
- stylestr = eina_stringshare_add("style");
- tabstopsstr = eina_stringshare_add("tabstops");
- linesizestr = eina_stringshare_add("linesize");
- linerelsizestr = eina_stringshare_add("linerelsize");
- linegapstr = eina_stringshare_add("linegap");
- linerelgapstr = eina_stringshare_add("linerelgap");
- itemstr = eina_stringshare_add("item"); */
- if (format_refcount == 0)
+ if (format_refcount == 0)
{
fontstr = eina_stringshare_add("font");
font_fallbacksstr = eina_stringshare_add("font_fallbacks");
if (should_merge)
{
+ /* We call this function instead of the cursor one because we already
+ * updated the cursors */
_evas_textblock_nodes_merge(o, n1);
}
+
#ifdef BIDI_SUPPORT
evas_bidi_paragraph_props_unref(n1->bidi_props);
n1->bidi_props = evas_bidi_paragraph_props_get(
/* The size of fribidichar is different than eina_unicode, convert */
/*FIXME: Make this comparison at compile time and compile out
- * unwanted code. - In all of this source file. */
+ * unwanted code. - In all of this source file. (including the actual
+ * function declerations. */
if (sizeof(Eina_Unicode) != sizeof(FriBidiChar))
{
base_ustr = ustr = calloc(len + 1, sizeof(FriBidiChar));
/**
* @internal
- * Updates the bidi properties according to ustr. First checks to see if the
- * passed has rtl chars, if not, it cleans intl_props and returns.
- * Otherwise, it essentially frees the old fields, allocates new fields, and
- * populates them.
- * On error: bidi_props is cleaned.
+ * Allocates bidi properties according to ustr. First checks to see if the
+ * passed has rtl chars, if not, it returns NULL.
*
* @param ustr The string to update according to.
- * @param bidi_props the bidi_props to update.
- * @return returns the length of the string on success, a negative value on error.
+ * @return returns allocated paragraph props on success, NULL otherwise.
*/
Evas_BiDi_Paragraph_Props *
* @internal
* Reorders ustr according to the bidi props.
*
- * @param ustr the string to reorder.
+ * @param ustr the string to reorder. - Null is ok, will just populate the map.
* @param intl_props the intl properties to rerorder according to.
* @param _v_to_l The visual to logical map to populate - if NULL it won't populate it.
* @return #EINA_FALSE on success, #EINA_TRUE on error.
* Checks if the char is rtl oriented. I.e even a neutral char can become rtl
* if surrounded by rtl chars.
*
- * @param embedded_level_list the bidi embedding list.
+ * @param bidi_props The bidi properties
* @param index the index of the string.
* @return #EINA_TRUE if true, #EINA_FALSE otherwise.
*/
evas_bidi_paragraph_props_ref(Evas_BiDi_Paragraph_Props *bidi_props)
{
if (!bidi_props) return NULL;
+ BIDILOCK();
bidi_props->refcount++;
+ BIDIUNLOCK();
return bidi_props;
}
int clip, int cx, int cy, int cw, int ch,
int r, int g, int b, int a,
Eina_Bool smooth,
- Eina_Bool tex_only);
+ Eina_Bool tex_only,
+ Eina_Bool yuv);
void evas_gl_common_context_flush(Evas_GL_Context *gc);
int evas_gl_common_shader_program_init(Evas_GL_Program *p,
RGBA_Map_Point *p,
int clip, int cx, int cy, int cw, int ch,
int r, int g, int b, int a,
- Eina_Bool smooth, Eina_Bool tex_only)
+ Eina_Bool smooth, Eina_Bool tex_only,
+ Eina_Bool yuv)
{
- int pnum, nv, nc, nu, nu2, nt, i;
+ int pnum, nv, nc, nu, nu2, nu3, nt, i;
const int points[6] = { 0, 1, 2, 0, 2, 3 };
int x = 0, y = 0, w = 0, h = 0, px = 0, py = 0;
- GLfloat tx[4], ty[4];
+ GLfloat tx[4], ty[4], t2x[4], t2y[4];
Eina_Bool blend = 1;
DATA32 cmul;
GLuint prog = gc->shared->shader.img.prog;
(A_VAL(&(p[2].col)) < 0xff) || (A_VAL(&(p[3].col)) < 0xff))
blend = 1;
+ if (yuv)
+ {
+ prog = gc->shared->shader.yuv.prog;
+ if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
+ {
+ if ((p[0].col == 0xffffffff) && (p[1].col == 0xffffffff) &&
+ (p[2].col == 0xffffffff) && (p[3].col == 0xffffffff))
+ prog = gc->shared->shader.yuv_nomul.prog;
+ else
+ prog = gc->shared->shader.yuv.prog;
+ }
+ else
+ prog = gc->shared->shader.yuv.prog;
+ }
+ else
+ {
if (tex_only)
{
if (tex->pt->dyn.img)
prog = gc->shared->shader.img.prog;
}
}
+ }
- /*xxx*/ shader_array_flush(gc);
+// /*xxx*/ shader_array_flush(gc);
again:
pn = gc->state.top_pipe;
#ifdef GLPIPES
{
gc->pipe[pn].region.type = RTYPE_MAP;
gc->pipe[pn].shader.cur_tex = tex->pt->texture;
+ if (yuv)
+ {
+ gc->pipe[pn].shader.cur_texu = tex->ptu->texture;
+ gc->pipe[pn].shader.cur_texv = tex->ptv->texture;
+ }
gc->pipe[pn].shader.cur_prog = prog;
gc->pipe[pn].shader.smooth = smooth;
gc->pipe[pn].shader.blend = blend;
gc->pipe[pn].array.use_vertex = 1;
gc->pipe[pn].array.use_color = 1;
gc->pipe[pn].array.use_texuv = 1;
+ if (yuv)
+ {
+ gc->pipe[pn].array.use_texuv2 = 1;
+ gc->pipe[pn].array.use_texuv3 = 1;
+ }
+ else
+ {
gc->pipe[pn].array.use_texuv2 = 0;
gc->pipe[pn].array.use_texuv3 = 0;
+ }
}
else
{
gc->state.top_pipe = pn;
gc->pipe[pn].region.type = RTYPE_MAP;
gc->pipe[pn].shader.cur_tex = tex->pt->texture;
+ if (yuv)
+ {
+ gc->pipe[pn].shader.cur_texu = tex->ptu->texture;
+ gc->pipe[pn].shader.cur_texv = tex->ptv->texture;
+ }
gc->pipe[pn].shader.cur_prog = prog;
gc->pipe[pn].shader.smooth = smooth;
gc->pipe[pn].shader.blend = blend;
gc->pipe[pn].array.use_vertex = 1;
gc->pipe[pn].array.use_color = 1;
gc->pipe[pn].array.use_texuv = 1;
+ if (yuv)
+ {
+ gc->pipe[pn].array.use_texuv2 = 1;
+ gc->pipe[pn].array.use_texuv3 = 1;
+ }
+ else
+ {
gc->pipe[pn].array.use_texuv2 = 0;
gc->pipe[pn].array.use_texuv3 = 0;
+ }
}
}
if ((tex->im) && (tex->im->native.data))
gc->pipe[pn].array.use_vertex = 1;
gc->pipe[pn].array.use_color = 1;
gc->pipe[pn].array.use_texuv = 1;
+ if (yuv)
+ {
+ gc->pipe[pn].array.use_texuv2 = 1;
+ gc->pipe[pn].array.use_texuv3 = 1;
+ }
+ else
+ {
gc->pipe[pn].array.use_texuv2 = 0;
gc->pipe[pn].array.use_texuv3 = 0;
+ }
#endif
x = w = (p[points[0]].x >> FP);
py = (p[points[i]].y >> FP);
if (py < y) y = py;
else if (py > h) h = py;
+ if (yuv)
+ {
+ t2x[i] = ((((double)p[i].u / 2) / FP1)) / (double)tex->ptu->w;
+ t2y[i] = ((((double)p[i].v / 2) / FP1)) / (double)tex->ptu->h;
+ }
}
w = w - x;
h = h - y;
pnum = gc->pipe[pn].array.num;
nv = pnum * 3; nc = pnum * 4; nu = pnum * 2; nu2 = pnum * 2;
- nt = pnum * 4;
+ nu2 = pnum * 2; nu3 = pnum * 2; nt = pnum * 4;
gc->pipe[pn].array.num += 6;
array_alloc(gc, pn);
PUSH_TEXUV(pn,
tx[points[i]],
ty[points[i]]);
+ if (yuv)
+ {
+ PUSH_TEXUV2(pn,
+ t2x[points[i]],
+ t2y[points[i]]);
+ PUSH_TEXUV3(pn,
+ t2x[points[i]],
+ t2y[points[i]]);
+ }
PUSH_COLOR(pn,
R_VAL(&cl),
RGBA_Draw_Context *dc;
int r, g, b, a;
int c, cx, cy, cw, ch;
+ Eina_Bool yuv = 0;
dc = gc->dc;
if (dc->mul.use)
cx = gc->dc->clip.x; cy = gc->dc->clip.y;
cw = gc->dc->clip.w; ch = gc->dc->clip.h;
im->tex->im = im;
+ if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
+ (im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL))
+ yuv = 1;
evas_gl_common_context_image_map4_push(gc, im->tex, p,
c, cx, cy, cw, ch,
- r, g, b, a, smooth, im->tex_only);
+ r, g, b, a, smooth, im->tex_only,
+ yuv);
}
void