[cogl-fbo] Bring the gles code more in line with gl code

Over time the two cogl-fbo.c files have needlessly diverged as bug fixes or
cleanups went into one version but not the other.  This tries to bring them
back in line with each other.  It should actually be simple enough to move
cogl-fbo.c to be a common file, and simply not build it for GLES 1.1, so
maybe I'll follow up with such a patch soon.
This commit is contained in:
Robert Bragg 2009-09-15 22:19:01 +01:00
parent cc0af441f2
commit 6b2ff320ca

View File

@ -152,6 +152,8 @@ cogl_set_draw_buffer (CoglBufferTarget target, CoglHandle offscreen)
_COGL_GET_CONTEXT (ctx, NO_RETVAL); _COGL_GET_CONTEXT (ctx, NO_RETVAL);
_cogl_journal_flush ();
g_assert (ctx->draw_buffer_stack != NULL); g_assert (ctx->draw_buffer_stack != NULL);
draw_buffer = ctx->draw_buffer_stack->data; draw_buffer = ctx->draw_buffer_stack->data;
@ -186,10 +188,16 @@ cogl_set_draw_buffer (CoglBufferTarget target, CoglHandle offscreen)
} }
/* Setup new viewport and matrices */ /* Setup new viewport and matrices */
<<<<<<< HEAD:clutter/cogl/cogl/driver/gles/cogl-fbo.c
GE( glViewport (0, 0, fbo->width, fbo->height) ); GE( glViewport (0, 0, fbo->width, fbo->height) );
_cogl_matrix_stack_translate (ctx->modelview_stack, -1.0f, -1.0f, 0.0f); _cogl_matrix_stack_translate (ctx->modelview_stack, -1.0f, -1.0f, 0.0f);
_cogl_matrix_stack_scale (ctx->modelview_stack, _cogl_matrix_stack_scale (ctx->modelview_stack,
2.0f / fbo->width, 2.0f / fbo->height, 1.0f); 2.0f / fbo->width, 2.0f / fbo->height, 1.0f);
=======
cogl_viewport (fbo->width, fbo->height);
_cogl_current_matrix_translate (-1.0f, -1.0f, 0.0f);
_cogl_current_matrix_scale (2.0f / fbo->width, 2.0f / fbo->height, 1.0f);
>>>>>>> c3e471c... [cogl-fbo] Bring the gles code more in line with gl code:clutter/cogl/cogl/driver/gles/cogl-fbo.c
/* Bind offscreen framebuffer object */ /* Bind offscreen framebuffer object */
GE( glBindFramebuffer (GL_FRAMEBUFFER, fbo->gl_handle) ); GE( glBindFramebuffer (GL_FRAMEBUFFER, fbo->gl_handle) );