Skip to content

Commit c3a46d5

Browse files
committed
[Cleanup] Remove CoglPath and tesselator
This was used only in one place, and no needed anymore
1 parent f902ccb commit c3a46d5

57 files changed

Lines changed: 71 additions & 9555 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

clutter/clutter/clutter-paint-node-private.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ typedef enum
8383
PAINT_OP_INVALID = 0,
8484
PAINT_OP_TEX_RECT,
8585
PAINT_OP_MULTITEX_RECT,
86-
PAINT_OP_PATH,
8786
PAINT_OP_PRIMITIVE
8887
} PaintOpCode;
8988

@@ -96,8 +95,6 @@ struct _ClutterPaintOperation
9695
union {
9796
float texrect[8];
9897

99-
CoglPath *path;
100-
10198
CoglPrimitive *primitive;
10299
} op;
103100
};

clutter/clutter/clutter-paint-node.c

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -782,11 +782,6 @@ clutter_paint_operation_clear (ClutterPaintOperation *op)
782782
g_array_unref (op->multitex_coords);
783783
break;
784784

785-
case PAINT_OP_PATH:
786-
if (op->op.path != NULL)
787-
cogl_object_unref (op->op.path);
788-
break;
789-
790785
case PAINT_OP_PRIMITIVE:
791786
if (op->op.primitive != NULL)
792787
cogl_object_unref (op->op.primitive);
@@ -836,16 +831,6 @@ clutter_paint_op_init_multitex_rect (ClutterPaintOperation *op,
836831
op->op.texrect[3] = rect->y2;
837832
}
838833

839-
static inline void
840-
clutter_paint_op_init_path (ClutterPaintOperation *op,
841-
CoglPath *path)
842-
{
843-
clutter_paint_operation_clear (op);
844-
845-
op->opcode = PAINT_OP_PATH;
846-
op->op.path = cogl_object_ref (path);
847-
}
848-
849834
static inline void
850835
clutter_paint_op_init_primitive (ClutterPaintOperation *op,
851836
CoglPrimitive *primitive)
@@ -950,34 +935,6 @@ clutter_paint_node_add_multitexture_rectangle (ClutterPaintNode *node,
950935
g_array_append_val (node->operations, operation);
951936
}
952937

953-
/**
954-
* clutter_paint_node_add_path: (skip)
955-
* @node: a #ClutterPaintNode
956-
* @path: a Cogl path
957-
*
958-
* Adds a region described as a path to the @node.
959-
*
960-
* This function acquires a reference on the passed @path, so it
961-
* is safe to call cogl_object_unref() when it returns.
962-
*
963-
* Since: 1.10
964-
* Stability: unstable
965-
*/
966-
void
967-
clutter_paint_node_add_path (ClutterPaintNode *node,
968-
CoglPath *path)
969-
{
970-
ClutterPaintOperation operation = PAINT_OP_INIT;
971-
972-
g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
973-
g_return_if_fail (cogl_is_path (path));
974-
975-
clutter_paint_node_maybe_init_operations (node);
976-
977-
clutter_paint_op_init_path (&operation, path);
978-
g_array_append_val (node->operations, operation);
979-
}
980-
981938
/**
982939
* clutter_paint_node_add_primitive: (skip)
983940
* @node: a #ClutterPaintNode
@@ -1114,11 +1071,6 @@ clutter_paint_node_to_json (ClutterPaintNode *node)
11141071
json_builder_end_array (builder);
11151072
break;
11161073

1117-
case PAINT_OP_PATH:
1118-
json_builder_set_member_name (builder, "path");
1119-
json_builder_add_int_value (builder, (intptr_t) op->op.path);
1120-
break;
1121-
11221074
case PAINT_OP_PRIMITIVE:
11231075
json_builder_set_member_name (builder, "primitive");
11241076
json_builder_add_int_value (builder, (intptr_t) op->op.primitive);

clutter/clutter/clutter-paint-node.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ void clutter_paint_node_add_multitexture_rectangle (ClutterP
8484
unsigned int text_coords_len);
8585

8686
CLUTTER_EXPORT
87-
void clutter_paint_node_add_path (ClutterPaintNode *node,
88-
CoglPath *path);
89-
CLUTTER_EXPORT
87+
9088
void clutter_paint_node_add_primitive (ClutterPaintNode *node,
9189
CoglPrimitive *primitive);
9290

clutter/clutter/clutter-paint-nodes.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,6 @@ clutter_pipeline_node_draw (ClutterPaintNode *node,
477477
op->multitex_coords->len);
478478
break;
479479

480-
case PAINT_OP_PATH:
481-
cogl_framebuffer_fill_path (fb, pnode->pipeline, op->op.path);
482-
break;
483-
484480
case PAINT_OP_PRIMITIVE:
485481
cogl_framebuffer_draw_primitive (fb,
486482
pnode->pipeline,
@@ -876,7 +872,6 @@ clutter_text_node_draw (ClutterPaintNode *node,
876872
break;
877873

878874
case PAINT_OP_MULTITEX_RECT:
879-
case PAINT_OP_PATH:
880875
case PAINT_OP_PRIMITIVE:
881876
case PAINT_OP_INVALID:
882877
break;
@@ -1037,11 +1032,6 @@ clutter_clip_node_pre_draw (ClutterPaintNode *node,
10371032
retval = TRUE;
10381033
break;
10391034

1040-
case PAINT_OP_PATH:
1041-
cogl_framebuffer_push_path_clip (fb, op->op.path);
1042-
retval = TRUE;
1043-
break;
1044-
10451035
case PAINT_OP_MULTITEX_RECT:
10461036
case PAINT_OP_PRIMITIVE:
10471037
case PAINT_OP_INVALID:
@@ -1072,7 +1062,6 @@ clutter_clip_node_post_draw (ClutterPaintNode *node,
10721062

10731063
switch (op->opcode)
10741064
{
1075-
case PAINT_OP_PATH:
10761065
case PAINT_OP_TEX_RECT:
10771066
cogl_framebuffer_pop_clip (fb);
10781067
break;
@@ -1356,10 +1345,6 @@ clutter_layer_node_post_draw (ClutterPaintNode *node,
13561345
op->multitex_coords->len);
13571346
break;
13581347

1359-
case PAINT_OP_PATH:
1360-
cogl_framebuffer_fill_path (fb, lnode->state, op->op.path);
1361-
break;
1362-
13631348
case PAINT_OP_PRIMITIVE:
13641349
cogl_framebuffer_draw_primitive (fb, lnode->state, op->op.primitive);
13651350
break;

clutter/clutter/clutter-text.c

Lines changed: 56 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,14 +1906,6 @@ clutter_text_foreach_selection_rectangle (ClutterText *self,
19061906
g_free (utf8);
19071907
}
19081908

1909-
static void
1910-
add_selection_rectangle_to_path (ClutterText *text,
1911-
const ClutterActorBox *box,
1912-
gpointer user_data)
1913-
{
1914-
cogl_path_rectangle (user_data, box->x1, box->y1, box->x2, box->y2);
1915-
}
1916-
19171909
static void
19181910
clutter_text_foreach_selection_rectangle_prescaled (ClutterText *self,
19191911
ClutterTextSelectionFunc func,
@@ -1922,6 +1914,60 @@ clutter_text_foreach_selection_rectangle_prescaled (ClutterText *se
19221914
clutter_text_foreach_selection_rectangle (self, 1.0f, func, user_data);
19231915
}
19241916

1917+
static void
1918+
paint_selection_rectangle (ClutterText *self,
1919+
const ClutterActorBox *box,
1920+
gpointer user_data)
1921+
{
1922+
CoglFramebuffer *fb = user_data;
1923+
ClutterTextPrivate *priv = self->priv;
1924+
ClutterActor *actor = CLUTTER_ACTOR (self);
1925+
guint8 paint_opacity = clutter_actor_get_paint_opacity (actor);
1926+
CoglPipeline *color_pipeline = cogl_pipeline_copy (default_color_pipeline);
1927+
PangoLayout *layout = clutter_text_get_layout (self);
1928+
CoglColor cogl_color = { 0, };
1929+
const ClutterColor *color;
1930+
1931+
/* Paint selection background */
1932+
if (priv->selection_color_set)
1933+
color = &priv->selection_color;
1934+
else if (priv->cursor_color_set)
1935+
color = &priv->cursor_color;
1936+
else
1937+
color = &priv->text_color;
1938+
1939+
cogl_color_init_from_4ub (&cogl_color,
1940+
color->red,
1941+
color->green,
1942+
color->blue,
1943+
paint_opacity * color->alpha / 255);
1944+
cogl_color_premultiply (&cogl_color);
1945+
cogl_pipeline_set_color (color_pipeline, &cogl_color);
1946+
1947+
cogl_framebuffer_push_rectangle_clip (fb,
1948+
box->x1, box->y1,
1949+
box->x2, box->y2);
1950+
cogl_framebuffer_draw_rectangle (fb, color_pipeline,
1951+
box->x1, box->y1,
1952+
box->x2, box->y2);
1953+
1954+
if (priv->selected_text_color_set)
1955+
color = &priv->selected_text_color;
1956+
else
1957+
color = &priv->text_color;
1958+
1959+
cogl_color_init_from_4ub (&cogl_color,
1960+
color->red,
1961+
color->green,
1962+
color->blue,
1963+
paint_opacity * color->alpha / 255);
1964+
1965+
cogl_pango_show_layout (fb, layout, priv->text_x, 0, &cogl_color);
1966+
1967+
cogl_framebuffer_pop_clip (fb);
1968+
cogl_object_unref (color_pipeline);
1969+
}
1970+
19251971
/* Draws the selected text, its background, and the cursor */
19261972
static void
19271973
selection_paint (ClutterText *self,
@@ -1964,52 +2010,9 @@ selection_paint (ClutterText *self,
19642010
}
19652011
else
19662012
{
1967-
/* Paint selection background first */
1968-
CoglPipeline *color_pipeline = cogl_pipeline_copy (default_color_pipeline);
1969-
PangoLayout *layout = clutter_text_get_layout (self);
1970-
CoglPath *selection_path = cogl_path_new ();
1971-
CoglColor cogl_color = { 0, };
1972-
1973-
/* Paint selection background */
1974-
if (priv->selection_color_set)
1975-
color = &priv->selection_color;
1976-
else if (priv->cursor_color_set)
1977-
color = &priv->cursor_color;
1978-
else
1979-
color = &priv->text_color;
1980-
1981-
cogl_color_init_from_4ub (&cogl_color,
1982-
color->red,
1983-
color->green,
1984-
color->blue,
1985-
paint_opacity * color->alpha / 255);
1986-
cogl_color_premultiply (&cogl_color);
1987-
cogl_pipeline_set_color (color_pipeline, &cogl_color);
1988-
19892013
clutter_text_foreach_selection_rectangle_prescaled (self,
1990-
add_selection_rectangle_to_path,
1991-
selection_path);
1992-
1993-
cogl_framebuffer_fill_path (fb, color_pipeline, selection_path);
1994-
1995-
/* Paint selected text */
1996-
cogl_framebuffer_push_path_clip (fb, selection_path);
1997-
cogl_object_unref (selection_path);
1998-
1999-
if (priv->selected_text_color_set)
2000-
color = &priv->selected_text_color;
2001-
else
2002-
color = &priv->text_color;
2003-
2004-
cogl_color_init_from_4ub (&cogl_color,
2005-
color->red,
2006-
color->green,
2007-
color->blue,
2008-
paint_opacity * color->alpha / 255);
2009-
2010-
cogl_pango_show_layout (fb, layout, priv->text_x, 0, &cogl_color);
2011-
2012-
cogl_framebuffer_pop_clip (fb);
2014+
paint_selection_rectangle,
2015+
fb);
20132016
}
20142017
}
20152018

clutter/clutter/meson.build

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ libmuffin_clutter = shared_library(libmuffin_clutter_name,
421421
cally_sources,
422422
cally_headers,
423423
cally_private_headers,
424-
libmuffin_cogl_path_enum_types_h
425424
],
426425
version: '0.0.0',
427426
soversion: 0,
@@ -432,7 +431,6 @@ libmuffin_clutter = shared_library(libmuffin_clutter_name,
432431
link_with: [
433432
libmuffin_cogl,
434433
libmuffin_cogl_pango,
435-
libmuffin_cogl_path,
436434
],
437435
install_rpath: pkglibdir,
438436
install_dir: pkglibdir,

cogl/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ cogl-egl-defines.h
3636
cogl-enum-types.c
3737
cogl-enum-types.h
3838
cogl-gl-header.h
39-
cogl-path-enum-types.c
40-
cogl-path-enum-types.h
4139
cogl-config.h
4240
cogl-config.h.in
4341
cogl-muffin-config.h

cogl/cogl-pango/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ libmuffin_cogl_pango = shared_library('muffin-cogl-pango-' + libmuffin_api_versi
2525
version: '0.0.0',
2626
soversion: 0,
2727
c_args: cogl_c_args,
28-
include_directories: [cogl_includepath, cogl_path_includepath],
28+
include_directories: [cogl_includepath],
2929
gnu_symbol_visibility: 'hidden',
3030
dependencies: [cogl_pango_deps],
3131
install_rpath: pkglibdir,

cogl/cogl-path/cogl-path-enum-types.c.in

Lines changed: 0 additions & 47 deletions
This file was deleted.

cogl/cogl-path/cogl-path-enum-types.h.in

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)