diff --git a/cogl/cogl-matrix-stack.c b/cogl/cogl-matrix-stack.c index fd1bed06d..40d090344 100644 --- a/cogl/cogl-matrix-stack.c +++ b/cogl/cogl-matrix-stack.c @@ -430,7 +430,7 @@ _cogl_matrix_stack_flush_to_gl_builtins (CoglContext *ctx, if (disable_flip) needs_flip = FALSE; else - needs_flip = cogl_is_offscreen (cogl_get_draw_framebuffer ()); + needs_flip = cogl_is_offscreen (ctx->current_draw_buffer); cache = &ctx->builtin_flushed_projection; } diff --git a/cogl/cogl-pipeline-opengl.c b/cogl/cogl-pipeline-opengl.c index 3237dc4be..a76324027 100644 --- a/cogl/cogl-pipeline-opengl.c +++ b/cogl/cogl-pipeline-opengl.c @@ -593,10 +593,9 @@ _cogl_pipeline_flush_color_blend_alpha_depth_state ( _cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LOGIC_OPS); CoglPipelineLogicOpsState *logic_ops_state = &authority->big_state->logic_ops_state; CoglColorMask color_mask = logic_ops_state->color_mask; - CoglFramebuffer *draw_framebuffer = cogl_get_draw_framebuffer (); - if (draw_framebuffer) - color_mask &= draw_framebuffer->color_mask; + if (ctx->current_draw_buffer) + color_mask &= ctx->current_draw_buffer->color_mask; GE (ctx, glColorMask (!!(color_mask & COGL_COLOR_MASK_RED), !!(color_mask & COGL_COLOR_MASK_GREEN), @@ -616,7 +615,6 @@ _cogl_pipeline_flush_color_blend_alpha_depth_state ( GE( ctx, glDisable (GL_CULL_FACE) ); else { - CoglFramebuffer *draw_framebuffer = cogl_get_draw_framebuffer (); gboolean invert_winding; GE( ctx, glEnable (GL_CULL_FACE) ); @@ -642,7 +640,7 @@ _cogl_pipeline_flush_color_blend_alpha_depth_state ( /* 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 (draw_framebuffer); + invert_winding = cogl_is_offscreen (ctx->current_draw_buffer); switch (cull_face_state->front_winding) { diff --git a/cogl/cogl-pipeline-progend-glsl.c b/cogl/cogl-pipeline-progend-glsl.c index 5d65d709a..3bb6f797a 100644 --- a/cogl/cogl-pipeline-progend-glsl.c +++ b/cogl/cogl-pipeline-progend-glsl.c @@ -951,7 +951,7 @@ _cogl_pipeline_progend_glsl_pre_paint (CoglPipeline *pipeline) if (modelview_stack == NULL || projection_stack == NULL) return; - needs_flip = cogl_is_offscreen (cogl_get_draw_framebuffer ()); + needs_flip = cogl_is_offscreen (ctx->current_draw_buffer); #ifdef HAVE_COGL_GLES2 if (ctx->driver == COGL_DRIVER_GLES2)