summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2011-11-03 13:12:47 +0000
committerRobert Bragg <robert@linux.intel.com>2011-11-03 13:57:06 +0000
commit89731d160eb3fb955a30fc06f65e226e57e39333 (patch)
treebb2a5186223d4a15deaa4089ae4547ab81895df2
parente2c758c105c044f16e3834a34c28a957c5da1596 (diff)
downloadcogl-89731d160eb3fb955a30fc06f65e226e57e39333.tar.gz
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>
-rw-r--r--cogl/cogl-texture-2d.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cogl/cogl-texture-2d.c b/cogl/cogl-texture-2d.c
index 61847d4b..d83570dc 100644
--- a/cogl/cogl-texture-2d.c
+++ b/cogl/cogl-texture-2d.c
@@ -581,11 +581,12 @@ _cogl_texture_2d_copy_from_framebuffer (CoglHandle handle,
tex_2d = COGL_TEXTURE_2D (handle);
- /* Make sure the current framebuffers are bound. We explicitly avoid
- flushing the clip state so we can bind our own empty state */
+ /* Make sure the current framebuffers are bound, though we don't need to
+ * flush the clip state here since we aren't going to draw to the
+ * framebuffer. */
_cogl_framebuffer_flush_state (cogl_get_draw_framebuffer (),
_cogl_get_read_framebuffer (),
- 0);
+ COGL_FRAMEBUFFER_FLUSH_SKIP_CLIP_STATE);
_cogl_bind_gl_texture_transient (GL_TEXTURE_2D,
tex_2d->gl_texture,