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
This commit is contained in:
Eric Anholt 2011-01-30 20:11:11 -08:00
parent 5fa49462be
commit 81d2434b75

View file

@ -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);