static void
shader_array_flush(Evas_Engine_GL_Context *gc)
{
- int i, gw, gh, setclip, cy, fbo = 0, done = 0;
+ int i, gw, gh, setclip, fbo = 0, done = 0;
if (!gc->havestuff) return;
gw = gc->w;
}
if (gc->pipe[i].shader.clip != gc->state.current.clip)
{
-
- if (gc->pipe[i].shader.clip)
+ int cx, cy, cw, ch;
+
+ cx = gc->pipe[i].shader.cx;
+ cy = gc->pipe[i].shader.cy;
+ cw = gc->pipe[i].shader.cw;
+ ch = gc->pipe[i].shader.ch;
+ if ((gc->master_clip.enabled) && (!fbo))
+ {
+ if (gc->pipe[i].shader.clip)
+ {
+ RECTS_CLIP_TO_RECT(cx, cy, cw, ch,
+ gc->master_clip.x, gc->master_clip.y,
+ gc->master_clip.w, gc->master_clip.h);
+ }
+ else
+ {
+ cx = gc->master_clip.x;
+ cy = gc->master_clip.y;
+ cw = gc->master_clip.w;
+ ch = gc->master_clip.h;
+ }
+ }
+ if ((gc->pipe[i].shader.clip) || (gc->master_clip.enabled))
{
- cy = gh - gc->pipe[i].shader.cy - gc->pipe[i].shader.ch;
- if (fbo) cy = gc->pipe[i].shader.cy;
glEnable(GL_SCISSOR_TEST);
if (!fbo)
- scissor_rot(gc, gc->rot, gw, gh,
- gc->pipe[i].shader.cx,
- cy,
- gc->pipe[i].shader.cw,
- gc->pipe[i].shader.ch);
+ scissor_rot(gc, gc->rot, gw, gh, cx, gh - cy - ch, cw, ch);
else
- glScissor(gc->pipe[i].shader.cx, cy,
- gc->pipe[i].shader.cw, gc->pipe[i].shader.ch);
+ glScissor(cx, cy, cw, ch);
setclip = 1;
+ gc->state.current.cx = cx;
+ gc->state.current.cy = cy;
+ gc->state.current.cw = cw;
+ gc->state.current.ch = ch;
}
else
{
glDisable(GL_SCISSOR_TEST);
glScissor(0, 0, 0, 0);
+ gc->state.current.cx = 0;
+ gc->state.current.cy = 0;
+ gc->state.current.cw = 0;
+ gc->state.current.ch = 0;
}
}
- if ((gc->pipe[i].shader.clip) && (!setclip))
+ if (((gc->pipe[i].shader.clip) && (!setclip)) ||
+ (gc->master_clip.enabled))
{
- if ((gc->pipe[i].shader.cx != gc->state.current.cx) ||
- (gc->pipe[i].shader.cy != gc->state.current.cy) ||
- (gc->pipe[i].shader.cw != gc->state.current.cw) ||
- (gc->pipe[i].shader.ch != gc->state.current.ch))
+ int cx, cy, cw, ch;
+
+ cx = gc->pipe[i].shader.cx;
+ cy = gc->pipe[i].shader.cy;
+ cw = gc->pipe[i].shader.cw;
+ ch = gc->pipe[i].shader.ch;
+ if ((gc->master_clip.enabled) && (!fbo))
+ {
+ if (gc->pipe[i].shader.clip)
+ {
+ RECTS_CLIP_TO_RECT(cx, cy, cw, ch,
+ gc->master_clip.x, gc->master_clip.y,
+ gc->master_clip.w, gc->master_clip.h);
+ }
+ else
+ {
+ cx = gc->master_clip.x;
+ cy = gc->master_clip.y;
+ cw = gc->master_clip.w;
+ ch = gc->master_clip.h;
+ }
+ }
+ if ((cx != gc->state.current.cx) ||
+ (cy != gc->state.current.cy) ||
+ (cw != gc->state.current.cw) ||
+ (ch != gc->state.current.ch))
{
- cy = gh - gc->pipe[i].shader.cy - gc->pipe[i].shader.ch;
- if (fbo) cy = gc->pipe[i].shader.cy;
if (!fbo)
- scissor_rot(gc, gc->rot, gw, gh,
- gc->pipe[i].shader.cx,
- cy,
- gc->pipe[i].shader.cw,
- gc->pipe[i].shader.ch);
+ scissor_rot(gc, gc->rot, gw, gh, cx, gh - cy - ch, cw, ch);
else
- glScissor(gc->pipe[i].shader.cx, cy,
- gc->pipe[i].shader.cw, gc->pipe[i].shader.ch);
+ glScissor(cx, cy, cw, ch);
+ gc->state.current.cx = cx;
+ gc->state.current.cy = cy;
+ gc->state.current.cw = cw;
+ gc->state.current.ch = ch;
}
}
gc->state.current.cur_prog = gc->pipe[i].shader.cur_prog;
gc->state.current.cur_tex = gc->pipe[i].shader.cur_tex;
gc->state.current.render_op = gc->pipe[i].shader.render_op;
- gc->state.current.cx = gc->pipe[i].shader.cx;
- gc->state.current.cy = gc->pipe[i].shader.cy;
- gc->state.current.cw = gc->pipe[i].shader.cw;
- gc->state.current.ch = gc->pipe[i].shader.ch;
+// gc->state.current.cx = gc->pipe[i].shader.cx;
+// gc->state.current.cy = gc->pipe[i].shader.cy;
+// gc->state.current.cw = gc->pipe[i].shader.cw;
+// gc->state.current.ch = gc->pipe[i].shader.ch;
gc->state.current.smooth = gc->pipe[i].shader.smooth;
gc->state.current.blend = gc->pipe[i].shader.blend;
gc->state.current.clip = gc->pipe[i].shader.clip;