diff options
author | Robert Bragg <robert@linux.intel.com> | 2013-10-15 14:04:12 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2013-10-15 14:04:12 +0100 |
commit | 925174d99df7f1f4b11098e748bcc23eaa396a21 (patch) | |
tree | 9b20b653dd405a66c2a656f72bdffb0f2def43c2 | |
parent | 88018b90361215ec33fa317a2c3caf54beffbffa (diff) | |
download | cogl-925174d99df7f1f4b11098e748bcc23eaa396a21.tar.gz |
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>
-rw-r--r-- | cogl/cogl-framebuffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c index b98719cd..b002f619 100644 --- a/cogl/cogl-framebuffer.c +++ b/cogl/cogl-framebuffer.c @@ -946,6 +946,9 @@ void cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer, CoglColorMask color_mask) { + if (framebuffer->color_mask == color_mask) + return; + /* XXX: Currently color mask changes don't go through the journal */ _cogl_framebuffer_flush_journal (framebuffer); |