//DBG( "\e[1;32m Img[%d %d %d %d] Original [%d %d %d %d] Transformed[%d %d %d %d] Clip[%d %d %d %d] Clipped[%d %d %d %d] \e[m", img_x, img_y, img_w, img_h, imgc[0], imgc[1], imgc[2], imgc[3], objc[0], objc[1], objc[2], objc[3], clip[0], clip[1], clip[2], clip[3], cc[0], cc[1], cc[2], cc[3]);
}
+static void
+_evgl_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+ EVGL_Resource *rsc;
+
+ if (!(rsc=_evgl_tls_resource_get()))
+ {
+ ERR("Unable to execute GL command. Error retrieving tls");
+ return;
+ }
+
+ if (_evgl_direct_enabled())
+ {
+ rsc->clear_color.a = alpha;
+ rsc->clear_color.r = red;
+ rsc->clear_color.g = green;
+ rsc->clear_color.b = blue;
+ }
+ glClearColor(red, green, blue, alpha);
+}
+
static void
_evgl_glClear(GLbitfield mask)
{
{
if (!(rsc->current_ctx->current_fbo))
{
+ /* Skip glClear() if clearing with transparent color
+ * Note: There will be side effects if the object itself is not
+ * marked as having an alpha channel!
+ */
+ if (ctx->current_sfc->alpha && (mask & GL_COLOR_BUFFER_BIT))
+ {
+ if ((rsc->clear_color.a == 0) &&
+ (rsc->clear_color.r == 0) &&
+ (rsc->clear_color.g == 0) &&
+ (rsc->clear_color.b == 0))
+ {
+ // Skip clear color as we don't want to write black
+ mask &= ~GL_COLOR_BUFFER_BIT;
+ }
+ else if (rsc->clear_color.a != 1.0)
+ {
+ // TODO: Draw a rectangle? This will never be the perfect solution though.
+ WRN("glClear() used with a semi-transparent color and direct rendering. "
+ "This will erase the previous contents of the evas!");
+ }
+ if (!mask) return;
+ }
+
if ((!ctx->direct_scissor))
{
glEnable(GL_SCISSOR_TEST);
}
glClear(mask);
+
+ // TODO/FIXME: Restore previous client-side scissors.
}
else
{
_evgld_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
EVGL_FUNC_BEGIN();
- glClearColor(red, green, blue, alpha);
+ _evgl_glClearColor(red, green, blue, alpha);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
EVGL_FUNC_END();
}
ORD(glBufferSubData);
ORD(glCheckFramebufferStatus);
// ORD(glClear);
- ORD(glClearColor);
+// ORD(glClearColor);
// ORD(glClearDepthf);
ORD(glClearStencil);
ORD(glColorMask);
// For Direct Rendering
ORD(glClear);
+ ORD(glClearColor);
ORD(glDisable);
ORD(glEnable);
ORD(glGetIntegerv);
#define ORD(f) EVAS_API_OVERRIDE(f, funcs,)
// For Direct Rendering
ORD(glClear);
+ ORD(glClearColor);
ORD(glDisable);
ORD(glEnable);
ORD(glGetIntegerv);
void
_evgl_api_get(Evas_GL_API *funcs, int debug)
{
+ memset(funcs, 0, sizeof(Evas_GL_API));
+
if (debug)
_debug_gl_api_get(funcs);
else