[cairo-commit]
glitz/src glitz.c, 1.7, 1.8 glitz_glx_surface.c, 1.8, 1.9
David Reveman
commit at pdx.freedesktop.org
Thu May 13 14:19:59 PDT 2004
Committed by: davidr
Update of /cvs/cairo/glitz/src
In directory pdx:/tmp/cvs-serv31014/src
Modified Files:
glitz.c glitz_glx_surface.c
Log Message:
A few fixes to copy area operation
Index: glitz.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** a/glitz.c 13 May 2004 00:47:32 -0000 1.7
--- b/glitz.c 13 May 2004 21:19:56 -0000 1.8
***************
*** 886,889 ****
--- 886,890 ----
int y_dst)
{
+ glitz_gl_proc_address_list_t *gl;
glitz_bounding_box_t box, src_box, dst_box;
int status;
***************
*** 892,895 ****
--- 893,898 ----
return;
+ gl = dst->gl;
+
box.x1 = x_src;
box.y1 = y_src;
***************
*** 936,954 ****
if (status) {
if (src->format->doublebuffer)
! dst->gl->read_buffer (GLITZ_GL_BACK);
if (dst->format->doublebuffer)
! dst->gl->draw_buffer (GLITZ_GL_BACK);
! dst->gl->disable (GLITZ_GL_SCISSOR_TEST);
! dst->gl->disable (GLITZ_GL_DITHER);
! glitz_set_operator (dst->gl, GLITZ_OPERATOR_SRC);
! dst->gl->pixel_zoom (1.0, 1.0);
! glitz_set_raster_pos (dst->gl, x_dst, dst->height - (y_dst + height));
! dst->gl->copy_pixels (x_src, src->height - (y_src + height),
! width, height, GLITZ_GL_COLOR);
! } else
! glitz_composite (GLITZ_OPERATOR_SRC, src, NULL, dst,
! x_src, y_src, 0, 0, x_dst, y_dst, width, height);
status = 1;
glitz_surface_pop_current (dst);
--- 939,999 ----
if (status) {
if (src->format->doublebuffer)
! gl->read_buffer (GLITZ_GL_BACK);
if (dst->format->doublebuffer)
! gl->draw_buffer (GLITZ_GL_BACK);
! gl->disable (GLITZ_GL_SCISSOR_TEST);
! gl->disable (GLITZ_GL_DITHER);
! glitz_set_operator (gl, GLITZ_OPERATOR_SRC);
! gl->pixel_zoom (1.0, 1.0);
! glitz_set_raster_pos (gl, x_dst, dst->height - (y_dst + height));
! gl->copy_pixels (x_src, src->height - (y_src + height),
! width, height, GLITZ_GL_COLOR);
! } else {
! glitz_texture_t *texture = glitz_surface_get_texture (src);
! if (texture) {
! glitz_point_t tl, br;
!
! gl->disable (GLITZ_GL_SCISSOR_TEST);
! gl->disable (GLITZ_GL_DITHER);
!
! glitz_texture_bind (gl, texture);
!
! gl->tex_env_f (GLITZ_GL_TEXTURE_ENV,
! GLITZ_GL_TEXTURE_ENV_MODE,
! GLITZ_GL_REPLACE);
!
! glitz_set_operator (gl, GLITZ_OPERATOR_SRC);
!
! glitz_texture_ensure_repeat (gl, texture, 0);
! glitz_texture_ensure_filter (gl, texture, GLITZ_FILTER_NEAREST);
!
! tl.x = (x_src / (double) src->width) * texture->texcoord_width;
! tl.y = (y_src / (double) src->height) * texture->texcoord_height;
!
! br.x = ((x_src + width) / (double) src->width) *
! texture->texcoord_width;
! br.y = ((y_src + height) / (double) src->height) *
! texture->texcoord_height;
!
! tl.y = texture->texcoord_height - tl.y;
! br.y = texture->texcoord_height - br.y;
!
! gl->begin (GLITZ_GL_QUADS);
! gl->tex_coord_2d (tl.x, tl.y);
! gl->vertex_2d (x_dst, y_dst);
! gl->tex_coord_2d (br.x, tl.y);
! gl->vertex_2d (x_dst + width, y_dst);
! gl->tex_coord_2d (br.x, br.y);
! gl->vertex_2d (x_dst + width, y_dst + height);
! gl->tex_coord_2d (tl.x, br.y);
! gl->vertex_2d (x_dst, y_dst + height);
! gl->end ();
!
! glitz_texture_unbind (gl, texture);
! }
! gl->flush ();
! }
status = 1;
glitz_surface_pop_current (dst);
***************
*** 969,973 ****
char *pixel_buf;
! bytes_per_pixel = MAX ((dst->format->bpp / 8), (src->format->bpp / 8));
rowstride = width * bytes_per_pixel;
--- 1014,1018 ----
char *pixel_buf;
! bytes_per_pixel = MAX (dst->format->bpp, src->format->bpp) / 8;
rowstride = width * bytes_per_pixel;
***************
*** 980,983 ****
--- 1025,1029 ----
glitz_surface_read_pixels (src, x_src, y_src, width, height, pixel_buf);
glitz_surface_draw_pixels (dst, x_dst, y_dst, width, height, pixel_buf);
+ free (pixel_buf);
}
Index: glitz_glx_surface.c
===================================================================
RCS file: /cvs/cairo/glitz/src/glitz_glx_surface.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** a/glitz_glx_surface.c 13 May 2004 00:47:32 -0000 1.8
--- b/glitz_glx_surface.c 13 May 2004 21:19:56 -0000 1.9
***************
*** 88,103 ****
_glitz_glx_surface_make_current_read (void *abstract_surface)
{
glitz_glx_surface_t *surface = (glitz_glx_surface_t *) abstract_surface;
glitz_glx_static_proc_address_list_t *glx =
&surface->screen_info->display_info->thread_info->glx;
! if (glx->make_context_current && surface->drawable)
! return
! glx->make_context_current (surface->screen_info->display_info->display,
! glXGetCurrentDrawable (),
! surface->drawable,
! glXGetCurrentContext ());
! else
! return 0;
}
--- 88,109 ----
_glitz_glx_surface_make_current_read (void *abstract_surface)
{
+ /* This doesn't seem to work.
glitz_glx_surface_t *surface = (glitz_glx_surface_t *) abstract_surface;
glitz_glx_static_proc_address_list_t *glx =
&surface->screen_info->display_info->thread_info->glx;
+
+ if (glx->make_context_current && surface->drawable) {
+ GLXContext context = glXGetCurrentContext ();
! if (context == surface->context->context)
! return
! glx->make_context_current (surface->screen_info->display_info->display,
! glXGetCurrentDrawable (),
! surface->drawable,
! context);
! }
! */
!
! return 0;
}
More information about the cairo-commit
mailing list