Skip to content

Commit 37ae693

Browse files
authored
Add get_pipeline() API (#707)
In order to enable the full set of effect in the CinnamonBurnMyWindows extension, I need access to OffscreenEffect's CoglPipeline in Cjs. I had hopped that making get_target() available to Cjs (PR #702) would give me access to the pipeline, but it turns out that get_target() is returning the target as a CoglMaterial which I probably should have known would only give me access to the CoglMaterial APIs in Cjs. This proposed change copies the get_target() code and renames the copy to get_pipeline() and returns the target as a CoglPipeline rather than casting it to a CoglMaterial. I am not setup to build muffin for testing these changes, but the changes are minor modifications to copies of the existing get_target() code. If these changes are accepted, I am not sure what Cinnamon version it would be included in so I didn't update the libmuffin0.symbols file to include get_pipeline with this PR.
1 parent ad96ab1 commit 37ae693

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

clutter/clutter/clutter-offscreen-effect.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,30 @@ clutter_offscreen_effect_get_target (ClutterOffscreenEffect *effect)
603603
return (CoglMaterial *)effect->priv->target;
604604
}
605605

606+
/**
607+
* clutter_offscreen_effect_get_pipeline:
608+
* @effect: a #ClutterOffscreenEffect
609+
*
610+
* Retrieves the pipeline used as a render target for the offscreen
611+
* buffer created by @effect
612+
*
613+
* You should only use the returned #CoglPipeline when painting. The
614+
* returned pipeline might change between different frames.
615+
*
616+
* Return value: (transfer none): a #CoglPipeline or %NULL. The
617+
* returned pipeline is owned by Clutter and it should not be
618+
* modified or freed
619+
*
620+
*/
621+
CoglPipeline *
622+
clutter_offscreen_effect_get_pipeline (ClutterOffscreenEffect *effect)
623+
{
624+
g_return_val_if_fail (CLUTTER_IS_OFFSCREEN_EFFECT (effect),
625+
NULL);
626+
627+
return effect->priv->target;
628+
}
629+
606630
/**
607631
* clutter_offscreen_effect_paint_target:
608632
* @effect: a #ClutterOffscreenEffect

clutter/clutter/clutter-offscreen-effect.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ GType clutter_offscreen_effect_get_type (void) G_GNUC_CONST;
9898
CLUTTER_EXPORT
9999
CoglMaterial * clutter_offscreen_effect_get_target (ClutterOffscreenEffect *effect);
100100

101+
CLUTTER_EXPORT
102+
CoglPipeline * clutter_offscreen_effect_get_pipeline (ClutterOffscreenEffect *effect);
103+
101104
CLUTTER_EXPORT
102105
CoglHandle clutter_offscreen_effect_get_texture (ClutterOffscreenEffect *effect);
103106

0 commit comments

Comments
 (0)