third_party/cairo/src/cairo-cogl-surface.c
static CoglPipeline *
_cairo_cogl_setup_unbounded_area_pipeline (cairo_cogl_surface_t *surface,
                                           cairo_operator_t      op)
{
    CoglPipeline *unbounded_pipeline;
    CoglDepthState depth_state;
    CoglBool cogl_status;
    cairo_cogl_device_t *dev = to_device(surface->base.device);

    /* If a template pipeline exists for any given operator, the
     * corresponding solid template pipeline always exists */
    unbounded_pipeline =
        cogl_pipeline_copy (dev->template_pipelines[op][CAIRO_COGL_TEMPLATE_TYPE_SOLID]);
    cogl_pipeline_set_color4f (unbounded_pipeline, 0.0, 0.0, 0.0, 0.0);

    /* Enable depth test on second-pass pipeline */
    cogl_depth_state_init (&depth_state);
    cogl_depth_state_set_test_enabled (&depth_state, TRUE);
    cogl_status = cogl_pipeline_set_depth_state (unbounded_pipeline,
                                                 &depth_state,
                                                 NULL);
    if (unlikely (cogl_status != TRUE))
        g_warning ("Error setting depth state for unbounded render");

    return unbounded_pipeline;
}
/* Get the pipeline for the second pass */
Get the pipeline for the second pass
Get the pipeline for the second pass
static CoglPipeline *
_cairo_cogl_setup_unbounded_area_pipeline (cairo_cogl_surface_t *surface,
                                           cairo_operator_t      op)
{
    CoglPipeline *unbounded_pipeline;
    CoglDepthState depth_state;
    CoglBool cogl_status;
    cairo_cogl_device_t *dev = to_device(surface->base.device);
    unbounded_pipeline =
        cogl_pipeline_copy (dev->template_pipelines[op][CAIRO_COGL_TEMPLATE_TYPE_SOLID]);
    cogl_pipeline_set_color4f (unbounded_pipeline, 0.0, 0.0, 0.0, 0.0);
    cogl_depth_state_init (&depth_state);
    cogl_depth_state_set_test_enabled (&depth_state, TRUE);
    cogl_status = cogl_pipeline_set_depth_state (unbounded_pipeline,
                                                 &depth_state,
                                                 NULL);
    if (unlikely (cogl_status != TRUE))
        g_warning ("Error setting depth state for unbounded render");
    return unbounded_pipeline;
}
static CoglPipeline * _cairo_cogl_setup_unbounded_area_pipeline ( cairo_cogl_surface_t * surface , cairo_operator_t op ) { CoglPipeline * unbounded_pipeline ; CoglDepthState depth_state ; CoglBool cogl_status ; cairo_cogl_device_t * dev = to_device ( surface -> base . device ) ; unbounded_pipeline = cogl_pipeline_copy ( dev -> template_pipelines [ op ] [ CAIRO_COGL_TEMPLATE_TYPE_SOLID ] ) ; cogl_pipeline_set_color4f ( unbounded_pipeline , 0.0 , 0.0 , 0.0 , 0.0 ) ; cogl_depth_state_init ( & depth_state ) ; cogl_depth_state_set_test_enabled ( & depth_state , TRUE ) ; cogl_status = cogl_pipeline_set_depth_state ( unbounded_pipeline , & depth_state , NULL ) ; if ( unlikely ( cogl_status != TRUE ) ) g_warning ( " " ) ; return unbounded_pipeline ; }
Get the pipeline for the second pass
Get the pipeline for the second pass
/* If a template pipeline exists for any given operator, the
     * corresponding solid template pipeline always exists */ /* Enable depth test on second-pass pipeline */