framebuffer: NOP _set_color_mask if mask isn't changing
This makes cogl_framebuffer_set_color_mask immediately bail out if the given mask equals the framebuffer's current mask, since the cost of flushing the journal and flushing the gl state will hugely outweigh the cost of the check. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit 925174d99df7f1f4b11098e748bcc23eaa396a21)
This commit is contained in:
parent
8d998b64c9
commit
c1724eff60
@ -1248,6 +1248,9 @@ void
|
|||||||
cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer,
|
||||||
CoglColorMask color_mask)
|
CoglColorMask color_mask)
|
||||||
{
|
{
|
||||||
|
if (framebuffer->color_mask == color_mask)
|
||||||
|
return;
|
||||||
|
|
||||||
/* XXX: Currently color mask changes don't go through the journal */
|
/* XXX: Currently color mask changes don't go through the journal */
|
||||||
_cogl_framebuffer_flush_journal (framebuffer);
|
_cogl_framebuffer_flush_journal (framebuffer);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user