mirror of
https://github.com/brl/mutter.git
synced 2025-04-13 05:39:38 +00:00
cogl/pipeline: Use the pipeline context instead of the default context
In practise they are the same right now but this prepares CoglPipeline for a future where we have multiple contexts. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3446>
This commit is contained in:
parent
a9944b27aa
commit
6749151ac9
@ -1044,7 +1044,7 @@ _cogl_pipeline_pre_change_notify (CoglPipeline *pipeline,
|
|||||||
const CoglColor *new_color,
|
const CoglColor *new_color,
|
||||||
gboolean from_layer_change)
|
gboolean from_layer_change)
|
||||||
{
|
{
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
CoglContext *ctx = pipeline->context;
|
||||||
|
|
||||||
/* If primitives have been logged in the journal referencing the
|
/* If primitives have been logged in the journal referencing the
|
||||||
* current state of this pipeline we need to flush the journal
|
* current state of this pipeline we need to flush the journal
|
||||||
@ -1567,7 +1567,7 @@ _cogl_pipeline_get_layer_with_flags (CoglPipeline *pipeline,
|
|||||||
CoglPipelineLayer *layer;
|
CoglPipelineLayer *layer;
|
||||||
int unit_index;
|
int unit_index;
|
||||||
int i;
|
int i;
|
||||||
CoglContext *ctx;
|
CoglContext *ctx = pipeline->context;
|
||||||
|
|
||||||
/* The layer index of the layer we want info about */
|
/* The layer index of the layer we want info about */
|
||||||
layer_info.layer_index = layer_index;
|
layer_info.layer_index = layer_index;
|
||||||
@ -1596,8 +1596,6 @@ _cogl_pipeline_get_layer_with_flags (CoglPipeline *pipeline,
|
|||||||
if (layer_info.layer || (flags & COGL_PIPELINE_GET_LAYER_NO_CREATE))
|
if (layer_info.layer || (flags & COGL_PIPELINE_GET_LAYER_NO_CREATE))
|
||||||
return layer_info.layer;
|
return layer_info.layer;
|
||||||
|
|
||||||
ctx = _cogl_context_get_default ();
|
|
||||||
|
|
||||||
unit_index = layer_info.insert_after + 1;
|
unit_index = layer_info.insert_after + 1;
|
||||||
if (unit_index == 0)
|
if (unit_index == 0)
|
||||||
layer = _cogl_pipeline_layer_copy (ctx->default_layer_0);
|
layer = _cogl_pipeline_layer_copy (ctx->default_layer_0);
|
||||||
@ -1721,6 +1719,7 @@ fallback_layer_cb (CoglPipelineLayer *layer, void *user_data)
|
|||||||
{
|
{
|
||||||
CoglPipelineFallbackState *state = user_data;
|
CoglPipelineFallbackState *state = user_data;
|
||||||
CoglPipeline *pipeline = state->pipeline;
|
CoglPipeline *pipeline = state->pipeline;
|
||||||
|
CoglContext *ctx = pipeline->context;
|
||||||
CoglTexture *texture = NULL;
|
CoglTexture *texture = NULL;
|
||||||
COGL_STATIC_COUNTER (layer_fallback_counter,
|
COGL_STATIC_COUNTER (layer_fallback_counter,
|
||||||
"layer fallback counter",
|
"layer fallback counter",
|
||||||
@ -1728,8 +1727,6 @@ fallback_layer_cb (CoglPipelineLayer *layer, void *user_data)
|
|||||||
"forced to a fallback texture",
|
"forced to a fallback texture",
|
||||||
0 /* no application private data */);
|
0 /* no application private data */);
|
||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, FALSE);
|
|
||||||
|
|
||||||
if (!(state->fallback_layers & 1<<state->i))
|
if (!(state->fallback_layers & 1<<state->i))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
@ -2563,10 +2560,9 @@ _cogl_pipeline_deep_copy (CoglPipeline *pipeline,
|
|||||||
unsigned long layer_differences)
|
unsigned long layer_differences)
|
||||||
{
|
{
|
||||||
CoglPipeline *new, *authority;
|
CoglPipeline *new, *authority;
|
||||||
|
CoglContext *ctx = pipeline->context;
|
||||||
gboolean copy_layer_state;
|
gboolean copy_layer_state;
|
||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NULL);
|
|
||||||
|
|
||||||
if ((differences & COGL_PIPELINE_STATE_LAYERS))
|
if ((differences & COGL_PIPELINE_STATE_LAYERS))
|
||||||
{
|
{
|
||||||
copy_layer_state = TRUE;
|
copy_layer_state = TRUE;
|
||||||
@ -2769,11 +2765,10 @@ int
|
|||||||
cogl_pipeline_get_uniform_location (CoglPipeline *pipeline,
|
cogl_pipeline_get_uniform_location (CoglPipeline *pipeline,
|
||||||
const char *uniform_name)
|
const char *uniform_name)
|
||||||
{
|
{
|
||||||
|
CoglContext *ctx = pipeline->context;
|
||||||
void *location_ptr;
|
void *location_ptr;
|
||||||
char *uniform_name_copy;
|
char *uniform_name_copy;
|
||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, -1);
|
|
||||||
|
|
||||||
/* This API is designed as if the uniform locations are specific to
|
/* This API is designed as if the uniform locations are specific to
|
||||||
a pipeline but they are actually unique across a whole
|
a pipeline but they are actually unique across a whole
|
||||||
CoglContext. Potentially this could just be
|
CoglContext. Potentially this could just be
|
||||||
|
Loading…
x
Reference in New Issue
Block a user