mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 18:08:03 +02:00
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:
parent
5fa49462be
commit
81d2434b75
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue