From 8ca17f52627f6d6191973352ee5c2624bc0b93bf Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 22 Oct 2009 19:09:20 +0100 Subject: [PATCH] [cogl] avoid any state changes when cogl_set_backface_culling_enable is a nop This is a simple optimization to bail out of cogl_set_backface_culling_enable if it's not resulting in a change of state. --- cogl/cogl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cogl/cogl.c b/cogl/cogl.c index 18a51fa90..b1cef8b5b 100644 --- a/cogl/cogl.c +++ b/cogl/cogl.c @@ -270,6 +270,9 @@ cogl_set_backface_culling_enabled (gboolean setting) { _COGL_GET_CONTEXT (ctx, NO_RETVAL); + if (ctx->enable_backface_culling == setting) + return; + /* Currently the journal can't track changes to backface culling state... */ _cogl_journal_flush ();