cogl: Remove unused _cogl_matrix_entry_flush_to_gl_builtins

https://gitlab.gnome.org/GNOME/mutter/merge_requests/880
This commit is contained in:
Adam Jackson 2019-10-21 13:07:34 -04:00 committed by Georges Basile Stavracas Neto
parent a60457c2d8
commit d6bf4800ed
2 changed files with 0 additions and 128 deletions

View File

@ -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);

View File

@ -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)