[cairo-commit] src/cairo-gl-device.c

Eric Anholt anholt at kemper.freedesktop.org
Sun Feb 13 11:53:41 PST 2011


 src/cairo-gl-device.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 81d2434b7595095e485019b38f8a348153c6bc93
Author: Eric Anholt <eric at anholt.net>
Date:   Sun Jan 30 20:11:11 2011 -0800

    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

diff --git a/src/cairo-gl-device.c b/src/cairo-gl-device.c
index 3537dc9..d206da8 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);


More information about the cairo-commit mailing list