Commit Graph

8 Commits

Author SHA1 Message Date
Neil Roberts
edf2bf3d8a cogl-path: Make cogl_path_arc_rel static
cogl_path_arc_rel was never in any public headers so it isn't part of
the public API. It also has a slightly inconsistent name because the
rest of the relative path functions are called cogl_path_rel_*. This
patch makes it static for now to make it more obvious that it isn't
public. The name has changed to _cogl_path_rel_arc.
2010-04-22 18:17:59 +01:00
Neil Roberts
308ca6cb14 cogl-path: Fix the truncation when adding to a copied path
If a path is copied and then appended to, the copy needs to have the
last sub path truncated so that it fits in the total path size in case
the original path was modified. However the path size check was broken
so if the copied path had more than one sub path it would fail.
2010-04-21 22:36:43 +01:00
Neil Roberts
8afea98437 cogl-path: Don't try to union sub paths
When drawing a path with only a single sub path, Cogl uses the
'even-odd' fill rule which means that if a part of the path intersects
with another part then the intersection would be inverted. However
when combining sub paths it treats them as separate paths and then
unions them together. This doesn't match the semantics of the even-odd
rule in SVG and Cairo. This patch makes it so that a new sub path is
just drawn as another triangle fan so that it will continue to invert
the stencil buffer. This is also much simpler and more efficient as
well as being more correct.

http://bugzilla.openedhand.com/show_bug.cgi?id=2088
2010-04-21 11:39:28 +01:00
Neil Roberts
f6f375cb36 Separate out CoglClipStackState from cogl-clip-stack.c
CoglClipStackState has now been renamed to CoglClipState and is moved
to a separate file. CoglClipStack now just maintains a stack and
doesn't worry about the rest of the state. CoglClipStack sill contains
the code to flush the stack to GL.
2010-04-15 14:51:00 +01:00
Neil Roberts
067a520f26 cogl: Support retained paths
This adds three new API calls:

  CoglHandle cogl_path_get()
  void cogl_path_set(CoglHandle path)
  CoglHandle cogl_path_copy(CoglHandle path)

All of the fields relating to the path have been moved from the Cogl
context to a new CoglPath handle type. The cogl context now just
contains a CoglPath handle. All of the existing path commands
manipulate the data in the current path handle. cogl_path_new now just
creates a new path handle and unrefs the old one.

The path handle can be stored for later with cogl_path_get. The path
can then be copied with cogl_path_copy. Internally it implements
copy-on-write semantics with an extra optimisation that it will only
copy the data if the new path is modified, but not if the original
path is modified. It can do this because the only way to modify a path
is by appending to it so the copied path is able to store its own path
length and only render the nodes up to that length. For this to work
the copied path also needs to keep its own copies of the path extents
because the parent path may change these by adding nodes.

The clip stack now uses the cogl_path_copy mechanism to store paths in
the stack instead of directly copying the data. This should save some
memory and processing time.
2010-04-08 19:53:38 +01:00
Robert Bragg
1f715ad153 cogl: rename cogl_enable to _cogl_enable
Every now and then someone sees the cogl_enable API and gets confused,
thinking its public API so this renames the symbol to be clear that it's
is an internal only API.
2010-04-01 12:34:42 +01:00
Emmanuele Bassi
72f4ddf532 Remove mentions of the FSF address
Since using addresses that might change is something that finally
the FSF acknowledge as a plausible scenario (after changing address
twice), the license blurb in the source files should use the URI
for getting the license in case the library did not come with it.

Not that URIs cannot possibly change, but at least it's easier to
set up a redirection at the same place.

As a side note: this commit closes the oldes bug in Clutter's bug
report tool.

http://bugzilla.openedhand.com/show_bug.cgi?id=521
2010-03-01 12:56:10 +00:00
Robert Bragg
7d9b733446 cogl: cleanly separate primitives + paths code
The function prototypes for the primitives API were spread between
cogl-path.h and cogl-texture.h and should have been in a
cogl-primitives.h.

As well as shuffling the prototypes around into more sensible places
this commit splits the cogl-path API out from cogl-primitives.c into
a cogl-path.c
2010-02-12 14:05:01 +00:00