eng_window_use(re->win);
evas_gl_common_context_resize(re->win->gl_context, re->win->w, re->win->h, re->win->rot);
evas_common_tilebuf_add_redraw(re->tb, x, y, w, h);
-/*
+
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, re->win->w, re->win->h);
if ((w <= 0) || (h <= 0)) return;
if (!re->win->draw.redraw)
{
-#if 0
+#if 1
re->win->draw.x1 = x;
re->win->draw.y1 = y;
re->win->draw.x2 = x + w - 1;
if ((y + h - 1) > re->win->draw.y2) re->win->draw.y2 = y + h - 1;
}
re->win->draw.redraw = 1;
- */
}
static void
//#define FRAMECOUNT 1
-#ifdef FRAMECOUNT
-double
+//#ifdef FRAMECOUNT
+static double
get_time(void)
{
struct timeval timev;
gettimeofday(&timev, NULL);
return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
}
-#endif
+//#endif
static int safe_native = -1;
{
re->info->callback.pre_swap(re->info->callback.data, re->evas);
}
-/*
- if ((1)
-// (re->win->draw.x1 == 0) &&
-// (re->win->draw.y1 == 0) &&
-// (re->win->draw.x2 == (re->win->w - 1)) &&
-// (re->win->draw.y2 == (re->win->h - 1))
- )
- */
+#if 1
+ if (1)
+#else
+ if ((re->win->draw.x1 == 0) && (re->win->draw.y1 == 0) && (re->win->draw.x2 == (re->win->w - 1)) && (re->win->draw.y2 == (re->win->h - 1)))
+#endif
{
+// double t, t2 = 0.0;
+// t = get_time();
glXSwapBuffers(re->win->disp, re->win->win);
- if (!safe_native) glXWaitGL();
+// t = get_time() - t;
+// if (!safe_native)
+// {
+// t2 = get_time();
+// glXWaitGL();
+// t2 = get_time() - t2;
+// }
+// printf("swap: %3.5f (%3.5fms), x wait gl: %3.5f (%3.5fms)\n",
+// t, t * 1000.0, t2, t2 * 1000.0);
}
-/*
else
{
// FIXME: this doesn't work.. why oh why?
int sx, sy, sw, sh;
- // fimxe - reset when done
-// glEnable(GL_SCISSOR_TEST);
- glDrawBuffer(GL_FRONT);
-
sx = re->win->draw.x1;
sy = re->win->draw.y1;
sw = (re->win->draw.x2 - re->win->draw.x1) + 1;
sh = (re->win->draw.y2 - re->win->draw.y1) + 1;
sy = re->win->h - sy - sh;
-
-// glScissor(sx, sy, sw, sh);
+
+ glPixelZoom(1.0, 1.0);
+ glDisable(GL_BLEND);
+ glDisable(GL_SCISSOR_TEST);
glRasterPos2i(sx, re->win->h - sy);
+ glReadBuffer(GL_BACK);
+ glDrawBuffer(GL_FRONT);
glCopyPixels(sx, sy, sw, sh, GL_COLOR);
- glRasterPos2i(0, 0);
-
-// glDisable(GL_SCISSOR_TEST);
glDrawBuffer(GL_BACK);
+ glReadBuffer(GL_BACK);
+ glRasterPos2i(0, 0);
glFlush();
}
- */
if (re->info->callback.post_swap)
{
re->info->callback.post_swap(re->info->callback.data, re->evas);