Clutter::CairoTexture(3) Texture with Cairo integration

SYNOPSIS


my $texture = Clutter::CairoTexture->new(64, 64);
my $cr = $texture->create_context();
# use Cairo API to draw on the Cairo::Context
# destroys the Context and uploads the contents to the
# CairoTexture; alternatively, you can let $cr go out
# of scope
$cr = undef;

DESCRIPTION

Clutter::CairoTexture is a Clutter::Texture that displays the contents of a Cairo::Context. The Clutter::CairoTexture actor will create a Cairo image surface which will then be uploaded to a GL texture when needed.

Clutter::CairoTexture will provide a Cairo::Context by using the Clutter::CairoTexture::create_context() and the Clutter::CairoTexture::create_context_for_region() methods; you can use the Cairo API to draw on the context and then destroy the context when done.

As soon as the context is destroyed, the contents of the surface will be uploaded into the Clutter::CairoTexture actor.

Although a new Cairo::Context is created each time you call the create_context() or the create_context_for_region() methods, the CairoTexture will use the same image surface. You can call Clutter::CairoTexturr::clear() to erase the contents between calls.

Warning: Note that you should never use the code above inside the Clutter::Actor::PAINT or Clutter::Actor::PICK virtual functions or signal handlers because it will lead to performance degradation.

HIERARCHY

  Glib::Object
  +----Glib::InitiallyUnowned
       +----Clutter::Actor
            +----Clutter::Texture
                 +----Clutter::CairoTexture

INTERFACES

  Glib::Object::_Unregistered::ClutterScriptable

METHODS

actor = Clutter::CairoTexture->new ($width, $height)

  • $width (integer)
  • $height (integer)

$texture->clear

scalar = $texture->create_context

scalar = $texture->create_context_for_region ($x_offset, $y_offset, $width, $height)

  • $x_offset (integer)
  • $y_offset (integer)
  • $width (integer)
  • $height (integer)

list = $texture->get_surface_size

$texture->set_surface_size ($width, $height)

  • $width (integer)
  • $height (integer)

PROPERTIES

'surface-height' (Glib::UInt : readable / writable / private)
Surface Height
'surface-width' (Glib::UInt : readable / writable / private)
Surface Width

Clutter::Texture, Cairo

COPYRIGHT

Copyright (C) 2006, 2007, 2008 OpenedHand Ltd

Copyright (C) 2009 Intel Corporation

This module is free software; you can redistribute it and/or modify it under the terms of either:

  • the GNU Lesser General Public Library version 2.1; or
  • the Artistic License, version 2.0.

See Clutter for the full copyright notice.