Top | ![]() |
![]() |
![]() |
![]() |
ClutterActor * | clutter_cairo_texture_new () |
void | clutter_cairo_texture_set_surface_size () |
void | clutter_cairo_texture_get_surface_size () |
void | clutter_cairo_texture_set_auto_resize () |
gboolean | clutter_cairo_texture_get_auto_resize () |
cairo_t * | clutter_cairo_texture_create () |
cairo_t * | clutter_cairo_texture_create_region () |
void | clutter_cairo_texture_invalidate_rectangle () |
void | clutter_cairo_texture_invalidate () |
void | clutter_cairo_texture_clear () |
ClutterCairoTexture is a ClutterTexture that displays the contents of a Cairo context. The ClutterCairoTexture actor will create a Cairo image surface which will then be uploaded to a GL texture when needed.
Since ClutterCairoTexture uses a Cairo image surface internally all the drawing operations will be performed in software and not using hardware acceleration. This can lead to performance degradation if the contents of the texture change frequently.
In order to use a ClutterCairoTexture you should connect to the
“draw” signal; the signal is emitted each time
the ClutterCairoTexture has been told to invalidate its contents,
by using clutter_cairo_texture_invalidate_rectangle()
or its
sister function, clutter_cairo_texture_invalidate()
.
Each callback to the “draw” signal will receive a cairo_t context which can be used for drawing; the Cairo context is owned by the ClutterCairoTexture and should not be destroyed explicitly.
ClutterCairoTexture is available since Clutter 1.0.
ClutterCairoTexture is deprecated since Clutter 1.12. You should use ClutterCanvas instead.
ClutterActor * clutter_cairo_texture_new (guint width
,guint height
);
clutter_cairo_texture_new
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterCanvas instead
Creates a new ClutterCairoTexture actor, with a surface of width
by
height
pixels.
Since: 1.0
void clutter_cairo_texture_set_surface_size (ClutterCairoTexture *self
,guint width
,guint height
);
clutter_cairo_texture_set_surface_size
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterCanvas instead
Resizes the Cairo surface used by self
to width
and height
.
This function will not invalidate the contents of the Cairo
texture: you will have to explicitly call either
clutter_cairo_texture_invalidate_rectangle()
or
clutter_cairo_texture_invalidate()
.
Since: 1.0
void clutter_cairo_texture_get_surface_size (ClutterCairoTexture *self
,guint *width
,guint *height
);
clutter_cairo_texture_get_surface_size
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterCanvas instead
Retrieves the surface width and height for self
.
self |
||
width |
return location for the surface width, or |
[out] |
height |
return location for the surface height, or |
[out] |
Since: 1.0
void clutter_cairo_texture_set_auto_resize (ClutterCairoTexture *self
,gboolean value
);
clutter_cairo_texture_set_auto_resize
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterCanvas instead
Sets whether the ClutterCairoTexture should ensure that the backing Cairo surface used matches the allocation assigned to the actor. If the allocation changes, the contents of the ClutterCairoTexture will also be invalidated automatically.
self |
||
value |
|
Since: 1.8
gboolean
clutter_cairo_texture_get_auto_resize (ClutterCairoTexture *self
);
clutter_cairo_texture_get_auto_resize
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterCanvas instead
Retrieves the value set using clutter_cairo_texture_set_auto_resize()
.
Since: 1.8
cairo_t *
clutter_cairo_texture_create (ClutterCairoTexture *self
);
clutter_cairo_texture_create
has been deprecated since version 1.8 and should not be used in newly-written code.
Use the “draw” signal and
the clutter_cairo_texture_invalidate()
function to obtain a
Cairo context for 2D drawing.
Creates a new Cairo context for the cairo
texture. It is
similar to using clutter_cairo_texture_create_region()
with x_offset
and y_offset
of 0, width
equal to the cairo
texture surface width
and height
equal to the cairo
texture surface height.
Do not call this function within the paint virtual function or from a callback to the “paint” signal.
a newly created Cairo context. Use cairo_destroy()
to upload the contents of the context when done drawing
Since: 1.0
cairo_t * clutter_cairo_texture_create_region (ClutterCairoTexture *self
,gint x_offset
,gint y_offset
,gint width
,gint height
);
clutter_cairo_texture_create_region
has been deprecated since version 1.8 and should not be used in newly-written code.
Use the “draw” signal and
clutter_cairo_texture_invalidate_rectangle()
to obtain a
clipped Cairo context for 2D drawing.
Creates a new Cairo context that will updat the region defined
by x_offset
, y_offset
, width
and height
.
Do not call this function within the paint virtual function or from a callback to the “paint” signal.
self |
||
x_offset |
offset of the region on the X axis |
|
y_offset |
offset of the region on the Y axis |
|
width |
width of the region, or -1 for the full surface width |
|
height |
height of the region, or -1 for the full surface height |
a newly created Cairo context. Use cairo_destroy()
to upload the contents of the context when done drawing
Since: 1.0
void clutter_cairo_texture_invalidate_rectangle (ClutterCairoTexture *self
,cairo_rectangle_int_t *rect
);
clutter_cairo_texture_invalidate_rectangle
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterCanvas instead
Invalidates a rectangular region of a ClutterCairoTexture.
The invalidation will cause the “draw” signal to be emitted.
See also: clutter_cairo_texture_invalidate()
self |
||
rect |
a rectangle with the area to invalida,
or |
[allow-none] |
Since: 1.8
void
clutter_cairo_texture_invalidate (ClutterCairoTexture *self
);
clutter_cairo_texture_invalidate
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterCanvas instead
Invalidates the whole surface of a ClutterCairoTexture.
This function will cause the “draw” signal to be emitted.
See also: clutter_cairo_texture_invalidate_rectangle()
Since: 1.8
void
clutter_cairo_texture_clear (ClutterCairoTexture *self
);
clutter_cairo_texture_clear
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterCanvas instead
Clears self
's internal drawing surface, so that the next upload
will replace the previous contents of the ClutterCairoTexture
rather than adding to it.
Calling this function from within a “draw” signal handler will clear the invalidated area.
Since: 1.0
struct ClutterCairoTexture { };
ClutterCairoTexture
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterCanvas instead
The ClutterCairoTexture struct contains only private data.
Since: 1.0
struct ClutterCairoTextureClass { cairo_surface_t *(* create_surface) (ClutterCairoTexture *texture, guint width, guint height); gboolean (* draw) (ClutterCairoTexture *texture, cairo_t *cr); };
ClutterCairoTextureClass
has been deprecated since version 1.12 and should not be used in newly-written code.
Use ClutterCanvas instead
The ClutterCairoTextureClass struct contains only private data.
Since: 1.0