cogl: Use 'is_y_flipped()' instead of instance-of checking

This is what it was effectively used for in these places, so use the
appropriate API instead.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
This commit is contained in:
Jonas Ådahl 2020-10-20 15:07:54 +02:00 committed by Robert Mader
parent 6b5d7f45cb
commit b07994b606
3 changed files with 7 additions and 7 deletions

View File

@ -453,8 +453,10 @@ _cogl_clip_stack_gl_flush (CoglClipStack *stack,
* down so in this case no conversion is needed. * down so in this case no conversion is needed.
*/ */
if (COGL_IS_OFFSCREEN (framebuffer)) if (cogl_framebuffer_is_y_flipped (framebuffer))
scissor_y_start = scissor_y0; {
scissor_y_start = scissor_y0;
}
else else
{ {
int framebuffer_height = int framebuffer_height =

View File

@ -425,10 +425,8 @@ _cogl_pipeline_flush_color_blend_alpha_depth_state (
break; break;
} }
/* If we are painting to an offscreen framebuffer then we invert_winding =
need to invert the winding of the front face because cogl_framebuffer_is_y_flipped (ctx->current_draw_buffer);
everything is painted upside down */
invert_winding = COGL_IS_OFFSCREEN (ctx->current_draw_buffer);
switch (cull_face_state->front_winding) switch (cull_face_state->front_winding)
{ {

View File

@ -1016,7 +1016,7 @@ _cogl_pipeline_progend_glsl_pre_paint (CoglPipeline *pipeline,
if (modelview_entry == NULL || projection_entry == NULL) if (modelview_entry == NULL || projection_entry == NULL)
return; return;
needs_flip = COGL_IS_OFFSCREEN (ctx->current_draw_buffer); needs_flip = cogl_framebuffer_is_y_flipped (ctx->current_draw_buffer);
projection_changed = projection_changed =
_cogl_matrix_entry_cache_maybe_update (&program_state->projection_cache, _cogl_matrix_entry_cache_maybe_update (&program_state->projection_cache,