Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions clutter/clutter/clutter-paint-node-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ typedef enum
PAINT_OP_INVALID = 0,
PAINT_OP_TEX_RECT,
PAINT_OP_MULTITEX_RECT,
PAINT_OP_PATH,
PAINT_OP_PRIMITIVE
} PaintOpCode;

Expand All @@ -96,8 +95,6 @@ struct _ClutterPaintOperation
union {
float texrect[8];

CoglPath *path;

CoglPrimitive *primitive;
} op;
};
Expand Down
48 changes: 0 additions & 48 deletions clutter/clutter/clutter-paint-node.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,11 +782,6 @@ clutter_paint_operation_clear (ClutterPaintOperation *op)
g_array_unref (op->multitex_coords);
break;

case PAINT_OP_PATH:
if (op->op.path != NULL)
cogl_object_unref (op->op.path);
break;

case PAINT_OP_PRIMITIVE:
if (op->op.primitive != NULL)
cogl_object_unref (op->op.primitive);
Expand Down Expand Up @@ -836,16 +831,6 @@ clutter_paint_op_init_multitex_rect (ClutterPaintOperation *op,
op->op.texrect[3] = rect->y2;
}

static inline void
clutter_paint_op_init_path (ClutterPaintOperation *op,
CoglPath *path)
{
clutter_paint_operation_clear (op);

op->opcode = PAINT_OP_PATH;
op->op.path = cogl_object_ref (path);
}

static inline void
clutter_paint_op_init_primitive (ClutterPaintOperation *op,
CoglPrimitive *primitive)
Expand Down Expand Up @@ -950,34 +935,6 @@ clutter_paint_node_add_multitexture_rectangle (ClutterPaintNode *node,
g_array_append_val (node->operations, operation);
}

/**
* clutter_paint_node_add_path: (skip)
* @node: a #ClutterPaintNode
* @path: a Cogl path
*
* Adds a region described as a path to the @node.
*
* This function acquires a reference on the passed @path, so it
* is safe to call cogl_object_unref() when it returns.
*
* Since: 1.10
* Stability: unstable
*/
void
clutter_paint_node_add_path (ClutterPaintNode *node,
CoglPath *path)
{
ClutterPaintOperation operation = PAINT_OP_INIT;

g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
g_return_if_fail (cogl_is_path (path));

clutter_paint_node_maybe_init_operations (node);

clutter_paint_op_init_path (&operation, path);
g_array_append_val (node->operations, operation);
}

/**
* clutter_paint_node_add_primitive: (skip)
* @node: a #ClutterPaintNode
Expand Down Expand Up @@ -1114,11 +1071,6 @@ clutter_paint_node_to_json (ClutterPaintNode *node)
json_builder_end_array (builder);
break;

case PAINT_OP_PATH:
json_builder_set_member_name (builder, "path");
json_builder_add_int_value (builder, (intptr_t) op->op.path);
break;

case PAINT_OP_PRIMITIVE:
json_builder_set_member_name (builder, "primitive");
json_builder_add_int_value (builder, (intptr_t) op->op.primitive);
Expand Down
4 changes: 1 addition & 3 deletions clutter/clutter/clutter-paint-node.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ void clutter_paint_node_add_multitexture_rectangle (ClutterP
unsigned int text_coords_len);

CLUTTER_EXPORT
void clutter_paint_node_add_path (ClutterPaintNode *node,
CoglPath *path);
CLUTTER_EXPORT

void clutter_paint_node_add_primitive (ClutterPaintNode *node,
CoglPrimitive *primitive);

Expand Down
15 changes: 0 additions & 15 deletions clutter/clutter/clutter-paint-nodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,6 @@ clutter_pipeline_node_draw (ClutterPaintNode *node,
op->multitex_coords->len);
break;

case PAINT_OP_PATH:
cogl_framebuffer_fill_path (fb, pnode->pipeline, op->op.path);
break;

case PAINT_OP_PRIMITIVE:
cogl_framebuffer_draw_primitive (fb,
pnode->pipeline,
Expand Down Expand Up @@ -876,7 +872,6 @@ clutter_text_node_draw (ClutterPaintNode *node,
break;

case PAINT_OP_MULTITEX_RECT:
case PAINT_OP_PATH:
case PAINT_OP_PRIMITIVE:
case PAINT_OP_INVALID:
break;
Expand Down Expand Up @@ -1037,11 +1032,6 @@ clutter_clip_node_pre_draw (ClutterPaintNode *node,
retval = TRUE;
break;

case PAINT_OP_PATH:
cogl_framebuffer_push_path_clip (fb, op->op.path);
retval = TRUE;
break;

case PAINT_OP_MULTITEX_RECT:
case PAINT_OP_PRIMITIVE:
case PAINT_OP_INVALID:
Expand Down Expand Up @@ -1072,7 +1062,6 @@ clutter_clip_node_post_draw (ClutterPaintNode *node,

switch (op->opcode)
{
case PAINT_OP_PATH:
case PAINT_OP_TEX_RECT:
cogl_framebuffer_pop_clip (fb);
break;
Expand Down Expand Up @@ -1356,10 +1345,6 @@ clutter_layer_node_post_draw (ClutterPaintNode *node,
op->multitex_coords->len);
break;

case PAINT_OP_PATH:
cogl_framebuffer_fill_path (fb, lnode->state, op->op.path);
break;

case PAINT_OP_PRIMITIVE:
cogl_framebuffer_draw_primitive (fb, lnode->state, op->op.primitive);
break;
Expand Down
109 changes: 56 additions & 53 deletions clutter/clutter/clutter-text.c
Original file line number Diff line number Diff line change
Expand Up @@ -1906,14 +1906,6 @@ clutter_text_foreach_selection_rectangle (ClutterText *self,
g_free (utf8);
}

static void
add_selection_rectangle_to_path (ClutterText *text,
const ClutterActorBox *box,
gpointer user_data)
{
cogl_path_rectangle (user_data, box->x1, box->y1, box->x2, box->y2);
}

static void
clutter_text_foreach_selection_rectangle_prescaled (ClutterText *self,
ClutterTextSelectionFunc func,
Expand All @@ -1922,6 +1914,60 @@ clutter_text_foreach_selection_rectangle_prescaled (ClutterText *se
clutter_text_foreach_selection_rectangle (self, 1.0f, func, user_data);
}

static void
paint_selection_rectangle (ClutterText *self,
const ClutterActorBox *box,
gpointer user_data)
{
CoglFramebuffer *fb = user_data;
ClutterTextPrivate *priv = self->priv;
ClutterActor *actor = CLUTTER_ACTOR (self);
guint8 paint_opacity = clutter_actor_get_paint_opacity (actor);
CoglPipeline *color_pipeline = cogl_pipeline_copy (default_color_pipeline);
PangoLayout *layout = clutter_text_get_layout (self);
CoglColor cogl_color = { 0, };
const ClutterColor *color;

/* Paint selection background */
if (priv->selection_color_set)
color = &priv->selection_color;
else if (priv->cursor_color_set)
color = &priv->cursor_color;
else
color = &priv->text_color;

cogl_color_init_from_4ub (&cogl_color,
color->red,
color->green,
color->blue,
paint_opacity * color->alpha / 255);
cogl_color_premultiply (&cogl_color);
cogl_pipeline_set_color (color_pipeline, &cogl_color);

cogl_framebuffer_push_rectangle_clip (fb,
box->x1, box->y1,
box->x2, box->y2);
cogl_framebuffer_draw_rectangle (fb, color_pipeline,
box->x1, box->y1,
box->x2, box->y2);

if (priv->selected_text_color_set)
color = &priv->selected_text_color;
else
color = &priv->text_color;

cogl_color_init_from_4ub (&cogl_color,
color->red,
color->green,
color->blue,
paint_opacity * color->alpha / 255);

cogl_pango_show_layout (fb, layout, priv->text_x, 0, &cogl_color);

cogl_framebuffer_pop_clip (fb);
cogl_object_unref (color_pipeline);
}

/* Draws the selected text, its background, and the cursor */
static void
selection_paint (ClutterText *self,
Expand Down Expand Up @@ -1964,52 +2010,9 @@ selection_paint (ClutterText *self,
}
else
{
/* Paint selection background first */
CoglPipeline *color_pipeline = cogl_pipeline_copy (default_color_pipeline);
PangoLayout *layout = clutter_text_get_layout (self);
CoglPath *selection_path = cogl_path_new ();
CoglColor cogl_color = { 0, };

/* Paint selection background */
if (priv->selection_color_set)
color = &priv->selection_color;
else if (priv->cursor_color_set)
color = &priv->cursor_color;
else
color = &priv->text_color;

cogl_color_init_from_4ub (&cogl_color,
color->red,
color->green,
color->blue,
paint_opacity * color->alpha / 255);
cogl_color_premultiply (&cogl_color);
cogl_pipeline_set_color (color_pipeline, &cogl_color);

clutter_text_foreach_selection_rectangle_prescaled (self,
add_selection_rectangle_to_path,
selection_path);

cogl_framebuffer_fill_path (fb, color_pipeline, selection_path);

/* Paint selected text */
cogl_framebuffer_push_path_clip (fb, selection_path);
cogl_object_unref (selection_path);

if (priv->selected_text_color_set)
color = &priv->selected_text_color;
else
color = &priv->text_color;

cogl_color_init_from_4ub (&cogl_color,
color->red,
color->green,
color->blue,
paint_opacity * color->alpha / 255);

cogl_pango_show_layout (fb, layout, priv->text_x, 0, &cogl_color);

cogl_framebuffer_pop_clip (fb);
paint_selection_rectangle,
fb);
}
}

Expand Down
2 changes: 0 additions & 2 deletions clutter/clutter/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ libmuffin_clutter = shared_library(libmuffin_clutter_name,
cally_sources,
cally_headers,
cally_private_headers,
libmuffin_cogl_path_enum_types_h
],
version: '0.0.0',
soversion: 0,
Expand All @@ -432,7 +431,6 @@ libmuffin_clutter = shared_library(libmuffin_clutter_name,
link_with: [
libmuffin_cogl,
libmuffin_cogl_pango,
libmuffin_cogl_path,
],
install_rpath: pkglibdir,
install_dir: pkglibdir,
Expand Down
2 changes: 0 additions & 2 deletions cogl/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ cogl-egl-defines.h
cogl-enum-types.c
cogl-enum-types.h
cogl-gl-header.h
cogl-path-enum-types.c
cogl-path-enum-types.h
cogl-config.h
cogl-config.h.in
cogl-muffin-config.h
Expand Down
2 changes: 1 addition & 1 deletion cogl/cogl-pango/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ libmuffin_cogl_pango = shared_library('muffin-cogl-pango-' + libmuffin_api_versi
version: '0.0.0',
soversion: 0,
c_args: cogl_c_args,
include_directories: [cogl_includepath, cogl_path_includepath],
include_directories: [cogl_includepath],
gnu_symbol_visibility: 'hidden',
dependencies: [cogl_pango_deps],
install_rpath: pkglibdir,
Expand Down
47 changes: 0 additions & 47 deletions cogl/cogl-path/cogl-path-enum-types.c.in

This file was deleted.

25 changes: 0 additions & 25 deletions cogl/cogl-path/cogl-path-enum-types.h.in

This file was deleted.

Loading
Loading