All pastes #1875506 Raw Edit

bob

public text v1 · immutable
#1875506 ·published 2010-06-01 18:11 UTC
rendered paste body
From 6867977b6b63bc720824c037ec692ebc807ee5ea Mon Sep 17 00:00:00 2001From: Robert Bragg <robert@linux.intel.com>Date: Tue, 1 Jun 2010 17:34:59 +0100Subject: [PATCH] cogl-path: Renames cogl_path_get/set cogl_get/set_pathThese aren't path methods so aren't consistent with thecogl_object_method naming style we are aiming for.--- clutter/cogl/cogl/cogl-clip-state.c  |    2 +- clutter/cogl/cogl/cogl-path.c        |   47 +++++++++++++++++---------------- clutter/cogl/cogl/cogl-path.h        |    8 +++--- doc/reference/cogl/cogl-sections.txt |    4 +- tests/conform/test-cogl-path.c       |   16 ++++++------ 5 files changed, 39 insertions(+), 38 deletions(-)diff --git a/clutter/cogl/cogl/cogl-clip-state.c b/clutter/cogl/cogl/cogl-clip-state.cindex bb8ec1e..9e1798f 100644--- a/clutter/cogl/cogl/cogl-clip-state.c+++ b/clutter/cogl/cogl/cogl-clip-state.c@@ -235,7 +235,7 @@ cogl_clip_push_from_path_preserve (void)    cogl_get_modelview_matrix (&modelview_matrix); -  _cogl_clip_stack_push_from_path (stack, cogl_path_get (),+  _cogl_clip_stack_push_from_path (stack, cogl_get_path (),                                    &modelview_matrix);    clip_state->stack_dirty = TRUE;diff --git a/clutter/cogl/cogl/cogl-path.c b/clutter/cogl/cogl/cogl-path.cindex b89d29f..9c1475a 100644--- a/clutter/cogl/cogl/cogl-path.c+++ b/clutter/cogl/cogl/cogl-path.c@@ -1061,29 +1061,6 @@ cogl_path_rel_curve_to (float x_1, }  CoglPath *-cogl_path_get (void)-{-  _COGL_GET_CONTEXT (ctx, NULL);--  return ctx->current_path;-}--void-cogl_path_set (CoglPath *path)-{-  _COGL_GET_CONTEXT (ctx, NO_RETVAL);--  if (!cogl_is_path (path))-    return;--  /* Reference the new object first in case it is the same as the old-     object */-  cogl_object_ref (path);-  cogl_object_unref (ctx->current_path);-  ctx->current_path = path;-}--CoglPath * _cogl_path_new (void) {   CoglPath *path;@@ -1241,3 +1218,27 @@ cogl_rel_curve2_to (float x_1, }  #endif++CoglPath *+cogl_get_path (void)+{+  _COGL_GET_CONTEXT (ctx, NULL);++  return ctx->current_path;+}++void+cogl_set_path (CoglPath *path)+{+  _COGL_GET_CONTEXT (ctx, NO_RETVAL);++  if (!cogl_is_path (path))+    return;++  /* Reference the new object first in case it is the same as the old+     object */+  cogl_object_ref (path);+  cogl_object_unref (ctx->current_path);+  ctx->current_path = path;+}+diff --git a/clutter/cogl/cogl/cogl-path.h b/clutter/cogl/cogl/cogl-path.hindex 618f320..aa8bfd2 100644--- a/clutter/cogl/cogl/cogl-path.h+++ b/clutter/cogl/cogl/cogl-path.h@@ -368,7 +368,7 @@ cogl_path_round_rectangle (float x_1,                            float arc_step);  /**- * cogl_path_get:+ * cogl_get_path:  *  * Gets a pointer to the current path. The path can later be used  * again by calling cogl_path_set(). Note that the path isn't copied@@ -382,10 +382,10 @@ cogl_path_round_rectangle (float x_1,  * Since: 1.4  */ CoglPath *-cogl_path_get (void);+cogl_get_path (void);  /**- * cogl_path_set:+ * cogl_set_path:  * @path: A #CoglPath object  *  * Replaces the current path with @path. A reference is taken on the@@ -395,7 +395,7 @@ cogl_path_get (void);  * Since: 1.4  */ void-cogl_path_set (CoglPath *path);+cogl_set_path (CoglPath *path);  /**  * cogl_path_copy:diff --git a/doc/reference/cogl/cogl-sections.txt b/doc/reference/cogl/cogl-sections.txtindex 900a882..755a582 100644--- a/doc/reference/cogl/cogl-sections.txt+++ b/doc/reference/cogl/cogl-sections.txt@@ -155,8 +155,8 @@ cogl_polygon  <SUBSECTION> cogl_path_new-cogl_path_get-cogl_path_set+cogl_get_path+cogl_set_path cogl_path_copy cogl_path_move_to cogl_path_closediff --git a/tests/conform/test-cogl-path.c b/tests/conform/test-cogl-path.cindex 4c127b5..35ee843 100644--- a/tests/conform/test-cogl-path.c+++ b/tests/conform/test-cogl-path.c@@ -82,27 +82,27 @@ on_paint (ClutterActor *actor, TestState *state)                        BLOCK_SIZE, BLOCK_SIZE);   cogl_path_rectangle (BLOCK_SIZE / 2, BLOCK_SIZE / 2,                        BLOCK_SIZE * 3 / 4, BLOCK_SIZE);-  path_a = cogl_handle_ref (cogl_path_get ());+  path_a = cogl_handle_ref (cogl_get_path ());   draw_path_at (0, 0);    /* Create another path filling the whole block */   cogl_path_rectangle (0, 0, BLOCK_SIZE, BLOCK_SIZE);-  path_b = cogl_handle_ref (cogl_path_get ());+  path_b = cogl_handle_ref (cogl_get_path ());   draw_path_at (1, 0);    /* Draw the first path again */-  cogl_path_set (path_a);+  cogl_set_path (path_a);   draw_path_at (2, 0);    /* Draw a copy of path a */   path_c = cogl_path_copy (path_a);-  cogl_path_set (path_c);+  cogl_set_path (path_c);   draw_path_at (3, 0);    /* Add another rectangle to path a. We'll use line_to's instead of      cogl_rectangle so that we don't create another sub-path because      that is more likely to break the copy */-  cogl_path_set (path_a);+  cogl_set_path (path_a);   cogl_path_line_to (0, BLOCK_SIZE / 2);   cogl_path_line_to (0, 0);   cogl_path_line_to (BLOCK_SIZE / 2, 0);@@ -110,13 +110,13 @@ on_paint (ClutterActor *actor, TestState *state)   draw_path_at (4, 0);    /* Draw the copy again. It should not have changed */-  cogl_path_set (path_c);+  cogl_set_path (path_c);   draw_path_at (5, 0);    /* Add another rectangle to path c. It will be added in two halves,      one as an extension of the previous path and the other as a new      sub path */-  cogl_path_set (path_c);+  cogl_set_path (path_c);   cogl_path_line_to (BLOCK_SIZE / 2, 0);   cogl_path_line_to (BLOCK_SIZE * 3 / 4, 0);   cogl_path_line_to (BLOCK_SIZE * 3 / 4, BLOCK_SIZE / 2);@@ -125,7 +125,7 @@ on_paint (ClutterActor *actor, TestState *state)   draw_path_at (6, 0);    /* Draw the original path again. It should not have changed */-  cogl_path_set (path_a);+  cogl_set_path (path_a);   draw_path_at (7, 0);    cogl_handle_unref (path_a);-- 1.6.3.3