From d6bf4800ed7c700b9c7353ac33b6afb2b96beab7 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 21 Oct 2019 13:07:34 -0400 Subject: [PATCH] cogl: Remove unused _cogl_matrix_entry_flush_to_gl_builtins https://gitlab.gnome.org/GNOME/mutter/merge_requests/880 --- cogl/cogl/cogl-matrix-stack-private.h | 7 -- cogl/cogl/cogl-matrix-stack.c | 121 -------------------------- 2 files changed, 128 deletions(-) diff --git a/cogl/cogl/cogl-matrix-stack-private.h b/cogl/cogl/cogl-matrix-stack-private.h index c442782cf..264394ebe 100644 --- a/cogl/cogl/cogl-matrix-stack-private.h +++ b/cogl/cogl/cogl-matrix-stack-private.h @@ -161,13 +161,6 @@ typedef enum COGL_MATRIX_TEXTURE } CoglMatrixMode; -void -_cogl_matrix_entry_flush_to_gl_builtins (CoglContext *ctx, - CoglMatrixEntry *entry, - CoglMatrixMode mode, - CoglFramebuffer *framebuffer, - gboolean disable_flip); - void _cogl_matrix_entry_cache_init (CoglMatrixEntryCache *cache); diff --git a/cogl/cogl/cogl-matrix-stack.c b/cogl/cogl/cogl-matrix-stack.c index fb0330089..2e5150afa 100644 --- a/cogl/cogl/cogl-matrix-stack.c +++ b/cogl/cogl/cogl-matrix-stack.c @@ -781,127 +781,6 @@ cogl_matrix_entry_is_identity (CoglMatrixEntry *entry) return entry ? entry->op == COGL_MATRIX_OP_LOAD_IDENTITY : FALSE; } -static void -_cogl_matrix_flush_to_gl_builtin (CoglContext *ctx, - gboolean is_identity, - CoglMatrix *matrix, - CoglMatrixMode mode) -{ - g_assert (_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_GL_FIXED)); - -#ifdef HAVE_COGL_GL - if (ctx->flushed_matrix_mode != mode) - { - GLenum gl_mode = 0; - - switch (mode) - { - case COGL_MATRIX_MODELVIEW: - gl_mode = GL_MODELVIEW; - break; - - case COGL_MATRIX_PROJECTION: - gl_mode = GL_PROJECTION; - break; - - case COGL_MATRIX_TEXTURE: - gl_mode = GL_TEXTURE; - break; - } - - GE (ctx, glMatrixMode (gl_mode)); - ctx->flushed_matrix_mode = mode; - } - - if (is_identity) - GE (ctx, glLoadIdentity ()); - else - GE (ctx, glLoadMatrixf (cogl_matrix_get_array (matrix))); -#endif -} - -void -_cogl_matrix_entry_flush_to_gl_builtins (CoglContext *ctx, - CoglMatrixEntry *entry, - CoglMatrixMode mode, - CoglFramebuffer *framebuffer, - gboolean disable_flip) -{ - g_assert (_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_GL_FIXED)); - -#ifdef HAVE_COGL_GL - { - gboolean needs_flip; - CoglMatrixEntryCache *cache; - - if (mode == COGL_MATRIX_PROJECTION) - { - /* Because Cogl defines texture coordinates to have a top left - * origin and because offscreen framebuffers may be used for - * rendering to textures we always render upside down to - * offscreen buffers. Also for some backends we need to render - * onscreen buffers upside-down too. - */ - if (disable_flip) - needs_flip = FALSE; - else - needs_flip = cogl_is_offscreen (framebuffer); - - cache = &ctx->builtin_flushed_projection; - } - else - { - needs_flip = FALSE; - - if (mode == COGL_MATRIX_MODELVIEW) - cache = &ctx->builtin_flushed_modelview; - else - cache = NULL; - } - - /* We don't need to do anything if the state is the same */ - if (!cache || - _cogl_matrix_entry_cache_maybe_update (cache, entry, needs_flip)) - { - gboolean is_identity; - CoglMatrix matrix; - - if (entry->op == COGL_MATRIX_OP_LOAD_IDENTITY) - is_identity = TRUE; - else - { - is_identity = FALSE; - cogl_matrix_entry_get (entry, &matrix); - } - - if (needs_flip) - { - CoglMatrix flipped_matrix; - - cogl_matrix_multiply (&flipped_matrix, - &ctx->y_flip_matrix, - is_identity ? - &ctx->identity_matrix : - &matrix); - - _cogl_matrix_flush_to_gl_builtin (ctx, - /* not identity */ - FALSE, - &flipped_matrix, - mode); - } - else - { - _cogl_matrix_flush_to_gl_builtin (ctx, - is_identity, - &matrix, - mode); - } - } - } -#endif -} - gboolean cogl_matrix_entry_equal (CoglMatrixEntry *entry0, CoglMatrixEntry *entry1)