From: Stanislav Vorobiov Date: Thu, 6 Jun 2013 06:36:23 +0000 (+0400) Subject: VIGS: Replace glRasterPos with glWindowPos X-Git-Tag: TizenStudio_2.0_p2.3~759^2^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49d88d30b3188ffcc7873066928f8cf15fa6b36d;p=sdk%2Femulator%2Fqemu.git VIGS: Replace glRasterPos with glWindowPos We should always use glWindowPos instead of glRasterPos, because values passed to glWindowPos are neither transformed by the current modelview and projection matrices, nor by the viewport-to-window transform. This yields more accurate results, unlike glRasterPos, which may have rounding errors and as a result raster position may become invalid and entire drawing operation will have no effect --- diff --git a/hw/vigs_gl_backend.c b/hw/vigs_gl_backend.c index 0d1bcf0..61988d71 100644 --- a/hw/vigs_gl_backend.c +++ b/hw/vigs_gl_backend.c @@ -433,7 +433,7 @@ static void vigs_gl_surface_draw_pixels(struct vigs_surface *sfc, width, height); gl_backend->PixelStorei(GL_UNPACK_SKIP_PIXELS, x); gl_backend->PixelStorei(GL_UNPACK_SKIP_ROWS, y); - gl_backend->RasterPos2f(x, ws_sfc->base.base.height - y - 1); + gl_backend->WindowPos2f(x, ws_sfc->base.base.height - y); gl_backend->DrawPixels(width, height, ws_sfc->tex_format, diff --git a/hw/vigs_gl_backend.h b/hw/vigs_gl_backend.h index ee16427..99d053a 100644 --- a/hw/vigs_gl_backend.h +++ b/hw/vigs_gl_backend.h @@ -70,7 +70,7 @@ struct vigs_gl_backend void (GLAPIENTRY *VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); void (GLAPIENTRY *DrawArrays)(GLenum mode, GLint first, GLsizei count); void (GLAPIENTRY *Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); - void (GLAPIENTRY *RasterPos2f)(GLfloat x, GLfloat y); + void (GLAPIENTRY *WindowPos2f)(GLfloat x, GLfloat y); void (GLAPIENTRY *PixelZoom)(GLfloat xfactor, GLfloat yfactor); void (GLAPIENTRY *DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *data); void (GLAPIENTRY *BlendFunc)(GLenum sfactor, GLenum dfactor); diff --git a/hw/vigs_gl_backend_glx.c b/hw/vigs_gl_backend_glx.c index aa60dd6..4176072 100644 --- a/hw/vigs_gl_backend_glx.c +++ b/hw/vigs_gl_backend_glx.c @@ -290,7 +290,7 @@ struct vigs_backend *vigs_gl_backend_create(void *display) VIGS_GL_GET_PROC(VertexPointer, glVertexPointer); VIGS_GL_GET_PROC(DrawArrays, glDrawArrays); VIGS_GL_GET_PROC(Color4ub, glColor4ub); - VIGS_GL_GET_PROC(RasterPos2f, glRasterPos2f); + VIGS_GL_GET_PROC(WindowPos2f, glWindowPos2f); VIGS_GL_GET_PROC(PixelZoom, glPixelZoom); VIGS_GL_GET_PROC(DrawPixels, glDrawPixels); VIGS_GL_GET_PROC(BlendFunc, glBlendFunc); diff --git a/hw/vigs_gl_backend_wgl.c b/hw/vigs_gl_backend_wgl.c index 263e150..3313757 100644 --- a/hw/vigs_gl_backend_wgl.c +++ b/hw/vigs_gl_backend_wgl.c @@ -402,7 +402,7 @@ struct vigs_backend *vigs_gl_backend_create(void *display) VIGS_GL_GET_PROC(VertexPointer, glVertexPointer); VIGS_GL_GET_PROC(DrawArrays, glDrawArrays); VIGS_GL_GET_PROC(Color4ub, glColor4ub); - VIGS_GL_GET_PROC(RasterPos2f, glRasterPos2f); + VIGS_GL_GET_PROC(WindowPos2f, glWindowPos2f); VIGS_GL_GET_PROC(PixelZoom, glPixelZoom); VIGS_GL_GET_PROC(DrawPixels, glDrawPixels); VIGS_GL_GET_PROC(BlendFunc, glBlendFunc);