From b07994b6066e42d76ec8da47a6073dec24428e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 20 Oct 2020 15:07:54 +0200 Subject: [PATCH] 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: --- cogl/cogl/driver/gl/cogl-clip-stack-gl.c | 6 ++++-- cogl/cogl/driver/gl/cogl-pipeline-opengl.c | 6 ++---- cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cogl/cogl/driver/gl/cogl-clip-stack-gl.c b/cogl/cogl/driver/gl/cogl-clip-stack-gl.c index 3f2b98ba1..11a353f39 100644 --- a/cogl/cogl/driver/gl/cogl-clip-stack-gl.c +++ b/cogl/cogl/driver/gl/cogl-clip-stack-gl.c @@ -453,8 +453,10 @@ _cogl_clip_stack_gl_flush (CoglClipStack *stack, * down so in this case no conversion is needed. */ - if (COGL_IS_OFFSCREEN (framebuffer)) - scissor_y_start = scissor_y0; + if (cogl_framebuffer_is_y_flipped (framebuffer)) + { + scissor_y_start = scissor_y0; + } else { int framebuffer_height = diff --git a/cogl/cogl/driver/gl/cogl-pipeline-opengl.c b/cogl/cogl/driver/gl/cogl-pipeline-opengl.c index 802dd07fe..9d487714b 100644 --- a/cogl/cogl/driver/gl/cogl-pipeline-opengl.c +++ b/cogl/cogl/driver/gl/cogl-pipeline-opengl.c @@ -425,10 +425,8 @@ _cogl_pipeline_flush_color_blend_alpha_depth_state ( break; } - /* If we are painting to an offscreen framebuffer then we - need to invert the winding of the front face because - everything is painted upside down */ - invert_winding = COGL_IS_OFFSCREEN (ctx->current_draw_buffer); + invert_winding = + cogl_framebuffer_is_y_flipped (ctx->current_draw_buffer); switch (cull_face_state->front_winding) { diff --git a/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c b/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c index 3064fc4da..c2614d2d2 100644 --- a/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c +++ b/cogl/cogl/driver/gl/cogl-pipeline-progend-glsl.c @@ -1016,7 +1016,7 @@ _cogl_pipeline_progend_glsl_pre_paint (CoglPipeline *pipeline, if (modelview_entry == NULL || projection_entry == NULL) return; - needs_flip = COGL_IS_OFFSCREEN (ctx->current_draw_buffer); + needs_flip = cogl_framebuffer_is_y_flipped (ctx->current_draw_buffer); projection_changed = _cogl_matrix_entry_cache_maybe_update (&program_state->projection_cache,