cairo


Drawing in a Clutter Texture with Cairo


I have a collection of objects that I use for drawing and have always used Cairo for that. I've decided to switch to Clutter with Cogl for the drawing, but Cogl seems to be somewhat limited for 2D. So far I'm already missing being able set the dash pattern for a line as well as the line width. I've read two things, that you can use raw GL calls within Cogl and that you can use a ClutterCairoTexture. Unfortunately I can't find any documentation on using GL calls inside of cogl_begin_gl/cogl_end_gl and ClutterCairoTexture has apparently been deprecated.
It would be incredibly useful to know either how to use a Cairo context with a Clutter texture, or how 2D drawing is accomplished now in Cogl. I can't really understand why you wouldn't be given the ability to change the line width in Cogl, but it doesn't seem to be in any of the documentation that I've read. The dash pattern I can deal with if I had to, but it would definitely be better if I could either continue to use Cairo in an Actor/Texture, or if Cogl had some way to do it.
Thanks.
Turns out the answer is to continue using Cairo but create a ClutterCanvas and add it to whatever ClutterActor you're drawing to. After that you just need to connect a function to the draw signal which gives the CairoContext as a parameter.

Related Links

How to clear cairo_region_t
Filling a custom-shaped Clutter Actor with a Cairo-drawn canvas
Why does Cairo.set_source_rgb paint the whole canvas?
Howto sub class a Clutter.Actor (involves Cairo/Clutter.Canvas)
'CAIRO_GOBJECT_TYPE_SURFACE' undeclared
Drawing in a Clutter Texture with Cairo
can't render text in cairo
Why when painting one source to another am i getting the wrong colors
Can I automatically flow two font styles in a Pango Cairo Layout?
Cairo Radial Gradient
How to create gradient between two curves?
Cairo in scrollable drawing area
Can cairo load a PDF?
How to get Pango Cairo to word wrap properly?
Using named colors with Cairo graphics
How does compositor work on X?

Categories

HOME
jsf
semantic-ui
crate
vb6
mapping
ubuntu-12.04
windows-store-apps
simpy
ng-admin
structuremap
hosts
iso
dryioc
phoenix
symfony2-easyadmin
rebol2
sql-tuning
google-people
jsonserializer
sensu
kitematic
nsmenuitem
binutils
csh
non-deterministic
solidworks
partial-application
piecewise
broadleaf-commerce
wfp
agent
wcf-security
knockout-3.0
distributed-transactions
pytest-django
range-v3
production-environment
dimple.js
broadcast
gce
selenium-firefoxdriver
unity3d-editor
ingres
festival
onresume
keycode
hspec
slam-algorithm
children
angularjs-ng-pattern
nofollow
multilingual-app-toolkit
fps
dac
handlebars.java
altbeacon
except
asymptote
kendo-menu
sevenzipsharp
mogrify
criteria-api
uos
google-earth-plugin
obfuscar
viewflipper
and-operator
ogr2ogr
mov
code-testing
mfmailcomposeviewcontroll
level
magic-numbers
anjuta
flash-cc
json-patch
winrt-httpclient
opendata
ftp4j
visual-studio-2003
multiple-conditions
justgage
dwolla
mailcore
graph-coloring
maven-ear-plugin
concurrent-programming
nssavepanel
executable-format
adobe-contribute
pantheios
jquery-ui-button
economics
weborb
msf

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App