本文整理汇总了C++中clutter_get_default_backend函数的典型用法代码示例。如果您正苦于以下问题:C++ clutter_get_default_backend函数的具体用法?C++ clutter_get_default_backend怎么用?C++ clutter_get_default_backend使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clutter_get_default_backend函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: _st_create_shadow_pipeline
CoglPipeline *
_st_create_shadow_pipeline (StShadow *shadow_spec,
CoglTexture *src_texture)
{
ClutterBackend *backend = clutter_get_default_backend ();
CoglContext *ctx = clutter_backend_get_cogl_context (backend);
static CoglPipeline *shadow_pipeline_template = NULL;
CoglPipeline *pipeline;
CoglTexture *texture;
guchar *pixels_in, *pixels_out;
gint width_in, height_in, rowstride_in;
gint width_out, height_out, rowstride_out;
g_return_val_if_fail (shadow_spec != NULL, NULL);
g_return_val_if_fail (src_texture != NULL, NULL);
width_in = cogl_texture_get_width (src_texture);
height_in = cogl_texture_get_height (src_texture);
rowstride_in = (width_in + 3) & ~3;
pixels_in = g_malloc0 (rowstride_in * height_in);
cogl_texture_get_data (src_texture, COGL_PIXEL_FORMAT_A_8,
rowstride_in, pixels_in);
pixels_out = blur_pixels (pixels_in, width_in, height_in, rowstride_in,
shadow_spec->blur,
&width_out, &height_out, &rowstride_out);
g_free (pixels_in);
texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (ctx, width_out, height_out,
COGL_PIXEL_FORMAT_A_8,
rowstride_out,
pixels_out,
NULL));
g_free (pixels_out);
if (G_UNLIKELY (shadow_pipeline_template == NULL))
{
CoglContext *ctx =
clutter_backend_get_cogl_context (clutter_get_default_backend ());
shadow_pipeline_template = cogl_pipeline_new (ctx);
/* We set up the pipeline to blend the shadow texture with the combine
* constant, but defer setting the latter until painting, so that we can
* take the actor's overall opacity into account. */
cogl_pipeline_set_layer_combine (shadow_pipeline_template, 0,
"RGBA = MODULATE (CONSTANT, TEXTURE[A])",
NULL);
}
pipeline = cogl_pipeline_copy (shadow_pipeline_template);
cogl_pipeline_set_layer_texture (pipeline, 0, texture);
cogl_object_unref (texture);
return pipeline;
}
开发者ID:meetparikh7,项目名称:gnome-shell,代码行数:60,代码来源:st-private.c
示例2: _clutter_paint_node_init_types
/*< private >
* _clutter_paint_node_init_types:
*
* Initializes the required types for ClutterPaintNode subclasses
*/
void
_clutter_paint_node_init_types (void)
{
CoglContext *ctx;
CoglColor cogl_color;
GType node_type G_GNUC_UNUSED;
if (G_LIKELY (default_color_pipeline != NULL))
return;
ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
node_type = clutter_paint_node_get_type ();
cogl_color_init_from_4f (&cogl_color, 1.0, 1.0, 1.0, 1.0);
default_color_pipeline = cogl_pipeline_new (ctx);
cogl_pipeline_set_color (default_color_pipeline, &cogl_color);
default_texture_pipeline = cogl_pipeline_new (ctx);
cogl_pipeline_set_layer_null_texture (default_texture_pipeline, 0,
COGL_TEXTURE_TYPE_2D);
cogl_pipeline_set_color (default_texture_pipeline, &cogl_color);
cogl_pipeline_set_layer_wrap_mode (default_texture_pipeline, 0,
COGL_PIPELINE_WRAP_MODE_AUTOMATIC);
}
开发者ID:endlessm,项目名称:mutter,代码行数:31,代码来源:clutter-paint-nodes.c
示例3: clutter_device_manager_get_default
/**
* clutter_device_manager_get_default:
*
* Retrieves the device manager singleton
*
* Return value: (transfer none): the #ClutterDeviceManager singleton.
* The returned instance is owned by Clutter and it should not be
* modified or freed
*
* Since: 1.2
*/
ClutterDeviceManager *
clutter_device_manager_get_default (void)
{
ClutterBackend *backend = clutter_get_default_backend ();
return backend->device_manager;
}
开发者ID:Distrotech,项目名称:clutter,代码行数:18,代码来源:clutter-device-manager.c
示例4: clutter_x11_get_current_event_time
/**
* clutter_x11_get_current_event_time: (skip)
*
* Retrieves the timestamp of the last X11 event processed by
* Clutter. This might be different from the timestamp returned
* by clutter_get_current_event_time(), as Clutter may synthesize
* or throttle events.
*
* Return value: a timestamp, in milliseconds
*
* Since: 1.0
*/
Time
clutter_x11_get_current_event_time (void)
{
ClutterBackend *backend = clutter_get_default_backend ();
return CLUTTER_BACKEND_X11 (backend)->last_event_time;
}
开发者ID:Distrotech,项目名称:clutter,代码行数:19,代码来源:clutter-event-x11.c
示例5: wayland_swap_buffers
static void
wayland_swap_buffers (ClutterStageWayland *stage_wayland)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend);
ClutterStageWaylandWaylandBuffer *buffer;
buffer = stage_wayland->front_buffer;
stage_wayland->front_buffer = stage_wayland->back_buffer;
stage_wayland->back_buffer = buffer;
wayland_damage_buffer(stage_wayland->front_buffer);
wl_surface_attach (stage_wayland->wayland_surface,
stage_wayland->front_buffer->wayland_buffer,
/* 0,0 here is "relative to the old buffer," not absolute */
0, 0);
wl_surface_map_toplevel (stage_wayland->wayland_surface);
stage_wayland->pending_swaps++;
wl_display_frame_callback (backend_wayland->wayland_display,
wayland_frame_callback,
stage_wayland);
_cogl_swap_buffers_notify ();
}
开发者ID:nobled,项目名称:clutter,代码行数:26,代码来源:clutter-stage-wayland.c
示例6: texture_tower_create_texture
static void
texture_tower_create_texture (MetaTextureTower *tower,
int level,
int width,
int height)
{
if ((!is_power_of_two (width) || !is_power_of_two (height)) &&
meta_texture_rectangle_check (tower->textures[level - 1]))
{
ClutterBackend *backend = clutter_get_default_backend ();
CoglContext *context = clutter_backend_get_cogl_context (backend);
tower->textures[level] = cogl_texture_rectangle_new_with_size (context, width, height);
}
else
{
tower->textures[level] = cogl_texture_new_with_size (width, height,
COGL_TEXTURE_NO_AUTO_MIPMAP,
TEXTURE_FORMAT);
}
tower->invalid[level].x1 = 0;
tower->invalid[level].y1 = 0;
tower->invalid[level].x2 = width;
tower->invalid[level].y2 = height;
}
开发者ID:darkxst,项目名称:mtest,代码行数:26,代码来源:meta-texture-tower.c
示例7: meta_texture_rectangle_new
CoglTexture *
meta_texture_rectangle_new (unsigned int width,
unsigned int height,
CoglPixelFormat format,
unsigned int rowstride,
const guint8 *data)
{
ClutterBackend *backend =
clutter_get_default_backend ();
CoglContext *context =
clutter_backend_get_cogl_context (backend);
CoglTextureRectangle *tex_rect;
tex_rect = cogl_texture_rectangle_new_with_size (context, width, height);
if (tex_rect == NULL)
return NULL;
if (data)
cogl_texture_set_region (COGL_TEXTURE (tex_rect),
0, 0, /* src_x/y */
0, 0, /* dst_x/y */
width, height, /* dst_width/height */
width, height, /* width/height */
format,
rowstride,
data);
return COGL_TEXTURE (tex_rect);
}
开发者ID:RCcola310,项目名称:mutter,代码行数:29,代码来源:meta-texture-rectangle.c
示例8: clutter_colorize_effect_init
static void
clutter_colorize_effect_init (ClutterColorizeEffect *self)
{
ClutterColorizeEffectClass *klass = CLUTTER_COLORIZE_EFFECT_GET_CLASS (self);
if (G_UNLIKELY (klass->base_pipeline == NULL))
{
CoglSnippet *snippet;
CoglContext *ctx =
clutter_backend_get_cogl_context (clutter_get_default_backend ());
klass->base_pipeline = cogl_pipeline_new (ctx);
snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_FRAGMENT,
colorize_glsl_declarations,
colorize_glsl_source);
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
cogl_object_unref (snippet);
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
}
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
self->tint_uniform =
cogl_pipeline_get_uniform_location (self->pipeline, "tint");
self->tint = default_tint;
update_tint_uniform (self);
}
开发者ID:GNOME,项目名称:mutter,代码行数:31,代码来源:clutter-colorize-effect.c
示例9: shell_anamorphosis_effect_init
static void
shell_anamorphosis_effect_init (ShellAnamorphosisEffect *self)
{
static CoglPipeline *pipeline_template;
ShellAnamorphosisEffectPrivate *priv = shell_anamorphosis_effect_get_instance_private (self);
if (G_UNLIKELY (pipeline_template == NULL))
{
CoglSnippet *snippet;
CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
pipeline_template = cogl_pipeline_new (ctx);
snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_TEXTURE_LOOKUP, anamorphosis_decls, NULL);
cogl_snippet_set_pre (snippet, anamorphosis_pre);
cogl_pipeline_add_layer_snippet (pipeline_template, 0, snippet);
cogl_object_unref (snippet);
cogl_pipeline_set_layer_null_texture (pipeline_template,
0, /* layer number */
COGL_TEXTURE_TYPE_2D);
}
priv->pipeline = cogl_pipeline_copy (pipeline_template);
priv->tex_width_uniform = cogl_pipeline_get_uniform_location (priv->pipeline, "tex_width");
priv->tex_height_uniform = cogl_pipeline_get_uniform_location (priv->pipeline, "tex_height");
priv->_x_uniform = cogl_pipeline_get_uniform_location (priv->pipeline, "_x");
priv->_y_uniform = cogl_pipeline_get_uniform_location (priv->pipeline, "_y");
priv->_z_uniform = cogl_pipeline_get_uniform_location (priv->pipeline, "_z");
update_uniforms (self);
}
开发者ID:ErwanDouaille,项目名称:Lille1-Master-Info,代码行数:33,代码来源:shell-anamorphosis-effect.c
示例10: meta_overlay_init
static void
meta_overlay_init (MetaOverlay *overlay)
{
CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
overlay->pipeline = cogl_pipeline_new (ctx);
}
开发者ID:brownsr,项目名称:mutter,代码行数:7,代码来源:meta-stage.c
示例11: clutter_cex100_get_egl_display
/**
* clutter_cex100_get_egl_display:
*
* Retrieves the EGL display used by Clutter, if it supports the
* EGL windowing system and if it is running using an EGL backend.
*
* Return value: the EGL display used by Clutter, or 0
*
* Since: 1.10
*/
EGLDisplay
clutter_cex100_get_egl_display (void)
{
ClutterBackend *backend;
if (!_clutter_context_is_initialized ())
{
g_critical ("The Clutter backend has not been initialized yet");
return 0;
}
backend = clutter_get_default_backend ();
if (!CLUTTER_IS_BACKEND_CEX100 (backend))
{
g_critical ("The Clutter backend is not a CEX100 backend");
return 0;
}
#if COGL_HAS_EGL_SUPPORT
return cogl_egl_context_get_egl_display (backend->cogl_context);
#else
return 0;
#endif
}
开发者ID:ChrisCummins,项目名称:clutter,代码行数:35,代码来源:clutter-backend-cex100.c
示例12: shell_glsl_quad_constructed
static void
shell_glsl_quad_constructed (GObject *object)
{
ShellGLSLQuad *self;
ShellGLSLQuadClass *klass;
ShellGLSLQuadPrivate *priv;
CoglContext *ctx =
clutter_backend_get_cogl_context (clutter_get_default_backend ());
G_OBJECT_CLASS (shell_glsl_quad_parent_class)->constructed (object);
/* Note that, differently from ClutterBlurEffect, we are calling
this inside constructed, not init, so klass points to the most-derived
GTypeClass, not ShellGLSLQuadClass.
*/
klass = SHELL_GLSL_QUAD_GET_CLASS (object);
self = SHELL_GLSL_QUAD (object);
priv = shell_glsl_quad_get_instance_private (self);
if (G_UNLIKELY (klass->base_pipeline == NULL))
{
klass->base_pipeline = cogl_pipeline_new (ctx);
cogl_pipeline_set_blend (klass->base_pipeline, "RGBA = ADD (SRC_COLOR * (SRC_COLOR[A]), DST_COLOR * (1-SRC_COLOR[A]))", NULL);
if (klass->build_pipeline != NULL)
klass->build_pipeline (self);
}
priv->pipeline = cogl_pipeline_copy (klass->base_pipeline);
cogl_pipeline_set_layer_null_texture (priv->pipeline, 0, COGL_TEXTURE_TYPE_2D);
}
开发者ID:SamKeightley,项目名称:gnome-shell,代码行数:32,代码来源:shell-glsl-quad.c
示例13: _st_create_texture_pipeline
/**
* _st_create_texture_pipeline:
* @src_texture: The CoglTexture for the pipeline
*
* Creates a simple pipeline which contains the given texture as a
* single layer.
*/
CoglPipeline *
_st_create_texture_pipeline (CoglTexture *src_texture)
{
static CoglPipeline *texture_pipeline_template = NULL;
CoglPipeline *pipeline;
g_return_val_if_fail (src_texture != NULL, NULL);
/* The only state used in the pipeline that would affect the shader
generation is the texture type on the layer. Therefore we create
a template pipeline which sets this state and all texture
pipelines are created as a copy of this. That way Cogl can find
the shader state for the pipeline more quickly by looking at the
pipeline ancestry instead of resorting to the shader cache. */
if (G_UNLIKELY (texture_pipeline_template == NULL))
{
CoglContext *ctx =
clutter_backend_get_cogl_context (clutter_get_default_backend ());
texture_pipeline_template = cogl_pipeline_new (ctx);
cogl_pipeline_set_layer_null_texture (texture_pipeline_template,
0, /* layer */
COGL_TEXTURE_TYPE_2D);
}
pipeline = cogl_pipeline_copy (texture_pipeline_template);
if (src_texture != NULL)
cogl_pipeline_set_layer_texture (pipeline, 0, src_texture);
return pipeline;
}
开发者ID:meetparikh7,项目名称:gnome-shell,代码行数:39,代码来源:st-private.c
示例14: units_em_to_pixels
static gfloat
units_em_to_pixels (const gchar *font_name,
gfloat em)
{
ClutterBackend *backend = clutter_get_default_backend ();
if (font_name == NULL || *font_name == '\0')
return em * _clutter_backend_get_units_per_em (backend, NULL);
else
{
PangoFontDescription *font_desc;
gfloat res;
font_desc = pango_font_description_from_string (font_name);
if (font_desc == NULL)
res = -1.0;
else
{
res = em * _clutter_backend_get_units_per_em (backend, font_desc);
pango_font_description_free (font_desc);
}
return res;
}
}
开发者ID:linuxmint,项目名称:muffin,代码行数:26,代码来源:clutter-units.c
示例15: clutter_x11_add_filter
/**
* clutter_x11_add_filter: (skip)
* @func: a filter function
* @data: user data to be passed to the filter function, or %NULL
*
* Adds an event filter function.
*
* Since: 0.6
*/
void
clutter_x11_add_filter (ClutterX11FilterFunc func,
gpointer data)
{
ClutterX11EventFilter *filter;
ClutterBackend *backend = clutter_get_default_backend ();
ClutterBackendX11 *backend_x11;
g_return_if_fail (func != NULL);
if (backend == NULL)
{
g_critical ("The Clutter backend has not been initialised");
return;
}
if (!CLUTTER_IS_BACKEND_X11 (backend))
{
g_critical ("The Clutter backend is not a X11 backend");
return;
}
backend_x11 = CLUTTER_BACKEND_X11 (backend);
filter = g_new0 (ClutterX11EventFilter, 1);
filter->func = func;
filter->data = data;
backend_x11->event_filters =
g_slist_append (backend_x11->event_filters, filter);
return;
}
开发者ID:MaximeMorel,项目名称:mutter,代码行数:42,代码来源:clutter-backend-x11.c
示例16: wayland_create_buffer
static ClutterStageWaylandWaylandBuffer *
wayland_create_buffer (ClutterGeometry *geom)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend);
ClutterStageWaylandWaylandBuffer *buffer;
cairo_rectangle_int_t rect;
if (backend_wayland->drm_enabled &&
backend_wayland->wayland_drm != NULL)
buffer = wayland_create_drm_buffer (backend_wayland, geom);
else if (backend_wayland->wayland_shm != NULL)
buffer = wayland_create_shm_buffer (backend_wayland, geom);
else
return NULL;
buffer->offscreen = cogl_offscreen_new_to_texture (buffer->tex);
rect.x = geom->x;
rect.y = geom->y;
rect.width = geom->width;
rect.height = geom->height;
buffer->dirty_region = cairo_region_create_rectangle (&rect);
return buffer;
}
开发者ID:nobled,项目名称:clutter,代码行数:26,代码来源:clutter-stage-wayland.c
示例17: clutter_stage_glx_unrealize
static void
clutter_stage_glx_unrealize (ClutterStageWindow *stage_window)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window);
ClutterStageGLX *stage_glx = CLUTTER_STAGE_GLX (stage_window);
/* Note unrealize should free up any backend stage related resources */
CLUTTER_NOTE (BACKEND, "Unrealizing stage");
clutter_x11_trap_x_errors ();
if (stage_glx->glxwin != None)
{
glXDestroyWindow (backend_x11->xdpy, stage_glx->glxwin);
stage_glx->glxwin = None;
}
if (!stage_x11->is_foreign_xwin && stage_x11->xwin != None)
{
XDestroyWindow (backend_x11->xdpy, stage_x11->xwin);
stage_x11->xwin = None;
}
else
stage_x11->xwin = None;
XSync (backend_x11->xdpy, False);
clutter_x11_untrap_x_errors ();
CLUTTER_MARK ();
}
开发者ID:gramozeka,项目名称:GSB-NEW,代码行数:33,代码来源:clutter-stage-glx.c
示例18: clutter_desaturate_effect_init
static void
clutter_desaturate_effect_init (ClutterDesaturateEffect *self)
{
ClutterDesaturateEffectClass *klass = CLUTTER_DESATURATE_EFFECT_GET_CLASS (self);
if (G_UNLIKELY (klass->base_pipeline == NULL))
{
CoglContext *ctx =
clutter_backend_get_cogl_context (clutter_get_default_backend ());
CoglSnippet *snippet;
klass->base_pipeline = cogl_pipeline_new (ctx);
snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_FRAGMENT,
desaturate_glsl_declarations,
desaturate_glsl_source);
cogl_pipeline_add_snippet (klass->base_pipeline, snippet);
cogl_object_unref (snippet);
cogl_pipeline_set_layer_null_texture (klass->base_pipeline,
0, /* layer number */
COGL_TEXTURE_TYPE_2D);
}
self->pipeline = cogl_pipeline_copy (klass->base_pipeline);
self->factor_uniform =
cogl_pipeline_get_uniform_location (self->pipeline, "factor");
self->factor = 1.0;
update_factor_uniform (self);
}
开发者ID:ChrisCummins,项目名称:clutter,代码行数:33,代码来源:clutter-desaturate-effect.c
示例19: clutter_x11_handle_event
/**
* clutter_x11_handle_event:
* @xevent: pointer to XEvent structure
*
* This function processes a single X event; it can be used to hook
* into external X11 event processing (for example, a GDK filter
* function).
*
* If clutter_x11_disable_event_retrieval() has been called, you must
* let this function process events to update Clutter's internal state.
*
* Return value: #ClutterX11FilterReturn. %CLUTTER_X11_FILTER_REMOVE
* indicates that Clutter has internally handled the event and the
* caller should do no further processing. %CLUTTER_X11_FILTER_CONTINUE
* indicates that Clutter is either not interested in the event,
* or has used the event to update internal state without taking
* any exclusive action. %CLUTTER_X11_FILTER_TRANSLATE will not
* occur.
*
* Since: 0.8
*/
ClutterX11FilterReturn
clutter_x11_handle_event (XEvent *xevent)
{
ClutterX11FilterReturn result;
ClutterBackend *backend;
ClutterEvent *event;
gint spin = 1;
/* The return values here are someone approximate; we return
* CLUTTER_X11_FILTER_REMOVE if a clutter event is
* generated for the event. This mostly, but not entirely,
* corresponds to whether other event processing should be
* excluded. As long as the stage window is not shared with another
* toolkit it should be safe, and never return
* %CLUTTER_X11_FILTER_REMOVE when more processing is needed.
*/
result = CLUTTER_X11_FILTER_CONTINUE;
clutter_threads_enter ();
backend = clutter_get_default_backend ();
event = clutter_event_new (CLUTTER_NOTHING);
if (_clutter_backend_translate_event (backend, xevent, event))
{
_clutter_event_push (event, FALSE);
result = CLUTTER_X11_FILTER_REMOVE;
}
else
{
clutter_event_free (event);
goto out;
}
/*
* Motion events can generate synthetic enter and leave events, so if we
* are processing a motion event, we need to spin the event loop at least
* two extra times to pump the enter/leave events through (otherwise they
* just get pushed down the queue and never processed).
*/
if (event->type == CLUTTER_MOTION)
spin += 2;
while (spin > 0 && (event = clutter_event_get ()))
{
/* forward the event into clutter for emission etc. */
clutter_do_event (event);
clutter_event_free (event);
--spin;
}
out:
clutter_threads_leave ();
return result;
}
开发者ID:nobled,项目名称:clutter,代码行数:80,代码来源:clutter-event-x11.c
示例20: clutter_input_device_evdev_bell_notify
static void
clutter_input_device_evdev_bell_notify (void)
{
ClutterBackend *backend;
backend = clutter_get_default_backend ();
clutter_backend_bell_notify (backend);
}
开发者ID:GNOME,项目名称:mutter,代码行数:8,代码来源:clutter-input-device-evdev.c
注:本文中的clutter_get_default_backend函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论