Skip clip flush in _texture_2d_copy_from_framebuffer

Although there was a comment in cogl_texture_2d_copy_from_framebuffer
explaining that we shouldn't flush the clip state, the comment was a bit
miss-leading implying we were going to explicitly set a NULL clip. Also
we weren't actually avoiding flushing the clip state since we were
passing 0 for the CoglDrawFlags.

We now pass COGL_FRAMEBUFFER_FLUSH_SKIP_CLIP_STATE in to the flags when
flushing the framebuffer state and the comment has be updated to explain
that clipping won't affect reading from the framebuffer so we don't need
to flush it.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Robert Bragg 2011-11-03 13:12:47 +00:00
parent e2c758c105
commit 89731d160e

View File

@ -581,11 +581,12 @@ _cogl_texture_2d_copy_from_framebuffer (CoglHandle handle,
tex_2d = COGL_TEXTURE_2D (handle); tex_2d = COGL_TEXTURE_2D (handle);
/* Make sure the current framebuffers are bound. We explicitly avoid /* Make sure the current framebuffers are bound, though we don't need to
flushing the clip state so we can bind our own empty state */ * flush the clip state here since we aren't going to draw to the
* framebuffer. */
_cogl_framebuffer_flush_state (cogl_get_draw_framebuffer (), _cogl_framebuffer_flush_state (cogl_get_draw_framebuffer (),
_cogl_get_read_framebuffer (), _cogl_get_read_framebuffer (),
0); COGL_FRAMEBUFFER_FLUSH_SKIP_CLIP_STATE);
_cogl_bind_gl_texture_transient (GL_TEXTURE_2D, _cogl_bind_gl_texture_transient (GL_TEXTURE_2D,
tex_2d->gl_texture, tex_2d->gl_texture,