GdkGLArea: fix has_alpha changes at runtime
We need to completely reallocate the buffers if we switch has_alpha, because we may switch from render buffers to texture.
This commit is contained in:
parent
37d0159a84
commit
f66060c422
@ -367,6 +367,8 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area, int width, int height)
|
|||||||
else
|
else
|
||||||
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, width, height);
|
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
priv->needs_render = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -562,7 +564,6 @@ gtk_gl_area_size_allocate (GtkWidget *widget,
|
|||||||
priv->needs_resize = TRUE;
|
priv->needs_resize = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->needs_render = TRUE;
|
|
||||||
gtk_gl_area_maybe_allocate_buffers (area);
|
gtk_gl_area_maybe_allocate_buffers (area);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -957,7 +958,7 @@ gtk_gl_area_set_has_alpha (GtkGLArea *area,
|
|||||||
|
|
||||||
g_object_notify (G_OBJECT (area), "has-alpha");
|
g_object_notify (G_OBJECT (area), "has-alpha");
|
||||||
|
|
||||||
gtk_gl_area_maybe_allocate_buffers (area);
|
gtk_gl_area_delete_buffers (area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user