diff options
author | Eric Anholt <eric@anholt.net> | 2011-01-30 20:11:11 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2011-02-13 11:53:15 -0800 |
commit | 81d2434b7595095e485019b38f8a348153c6bc93 (patch) | |
tree | 8ce0bf4ae52ba26ee4124f9c0a4c25998fc34efc | |
parent | 5fa49462be24b7fc7f32032d8577703f1d0f463a (diff) |
gl: Don't reset the FBO draw/readbuffers every time we bind the FBO.
Draw/readbuffers are a property of the framebuffer, not of the
context. So we can leave them in place across bindings. I left the
window drawbuffer setting in place until we decide how to handle
interoperating of cairo-gl with normal GL usage.
[ 0] before firefox-talos-gfx 67.552 67.561 0.22% 3/3
[ 0] after firefox-talos-gfx 66.689 66.913 0.41% 3/3
-rw-r--r-- | src/cairo-gl-device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cairo-gl-device.c b/src/cairo-gl-device.c index 3537dc907..d206da85f 100644 --- a/src/cairo-gl-device.c +++ b/src/cairo-gl-device.c @@ -248,6 +248,8 @@ _cairo_gl_ensure_framebuffer (cairo_gl_context_t *ctx, ctx->tex_target, surface->tex, 0); + glDrawBuffer (GL_COLOR_ATTACHMENT0); + glReadBuffer (GL_COLOR_ATTACHMENT0); status = dispatch->CheckFramebufferStatus (GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { @@ -324,8 +326,6 @@ _cairo_gl_context_set_destination (cairo_gl_context_t *ctx, if (_cairo_gl_surface_is_texture (surface)) { _cairo_gl_ensure_framebuffer (ctx, surface); ctx->dispatch.BindFramebuffer (GL_FRAMEBUFFER, surface->fb); - glDrawBuffer (GL_COLOR_ATTACHMENT0); - glReadBuffer (GL_COLOR_ATTACHMENT0); } else { ctx->make_current (ctx, surface); ctx->dispatch.BindFramebuffer (GL_FRAMEBUFFER, 0); |