mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
Query the framebuffer stencil bits instead of assuming it's global
Previously when the context was initialised Cogl would query the number of stencil bits and set a private feature flag to mark that it can use the buffer for clipping if there was at least 3. The problem with this is that the number of stencil bits returned by GL_STENCIL_BITS depends on the currently bound framebuffer. This patch adds an internal function to query the number of stencil bits in a framebuffer and makes it use that instead when determining whether it can push the clip using the stencil buffer. Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit e928d21516a6c07798655341f4f0f8e3c1d1686c)
This commit is contained in:

committed by
Robert Bragg

parent
109e576b1f
commit
520ccba49d
@ -1144,6 +1144,17 @@ cogl_framebuffer_get_depth_bits (CoglFramebuffer *framebuffer)
|
||||
return bits.depth;
|
||||
}
|
||||
|
||||
int
|
||||
_cogl_framebuffer_get_stencil_bits (CoglFramebuffer *framebuffer)
|
||||
{
|
||||
CoglContext *ctx = framebuffer->context;
|
||||
CoglFramebufferBits bits;
|
||||
|
||||
ctx->driver_vtable->framebuffer_query_bits (framebuffer, &bits);
|
||||
|
||||
return bits.stencil;
|
||||
}
|
||||
|
||||
CoglColorMask
|
||||
cogl_framebuffer_get_color_mask (CoglFramebuffer *framebuffer)
|
||||
{
|
||||
|
Reference in New Issue
Block a user