From fe3192169ac970ecee883fe5bcba68501d5830d0 Mon Sep 17 00:00:00 2001
From: Bilal Elmoussaoui
Date: Wed, 4 Sep 2024 14:28:13 +0200
Subject: [PATCH] Merge CoglPango inside of Clutter
As that is where the whole text rendering integration happens
And would allow us to get rid of some over-abstraction in cogl-pango,
simplify
ClutterSnapshot integration as well
Part-of:
---
.gitlab-ci.yml | 2 +-
README.md | 1 -
clutter/clutter/clutter-actor.c | 2 +-
clutter/clutter/clutter-context.c | 1 +
clutter/clutter/clutter-context.h | 4 +-
clutter/clutter/clutter-main.c | 1 -
clutter/clutter/clutter-main.h | 51 +++++++++-
clutter/clutter/clutter-paint-nodes.c | 14 +--
clutter/clutter/clutter-private.h | 2 -
clutter/clutter/clutter-text.c | 16 ++--
clutter/clutter/meson.build | 11 ++-
.../clutter/pango}/cogl-pango-display-list.c | 10 +-
.../clutter/pango}/cogl-pango-display-list.h | 10 +-
.../clutter/pango}/cogl-pango-fontmap.c | 3 +-
.../clutter/pango}/cogl-pango-glyph-cache.c | 11 ++-
.../clutter/pango}/cogl-pango-glyph-cache.h | 10 +-
.../pango}/cogl-pango-pipeline-cache.c | 6 +-
.../pango}/cogl-pango-pipeline-cache.h | 4 +-
.../clutter/pango}/cogl-pango-private.h | 10 +-
.../clutter/pango}/cogl-pango-render.c | 33 +++----
cogl/cogl-pango/cogl-pango.h | 92 -------------------
cogl/cogl-pango/meson.build | 82 -----------------
cogl/meson.build | 1 -
doc/debugging.md | 2 +-
doc/reference/clutter/meson.build | 2 -
doc/reference/cogl-pango/cogl-pango.toml.in | 46 ----------
doc/reference/cogl-pango/logo.svg | 1 -
doc/reference/cogl-pango/meson.build | 30 ------
doc/reference/cogl-pango/urlmap.js | 10 --
doc/reference/meson.build | 1 -
doc/reference/meta/meson.build | 2 -
doc/website/index.html | 5 -
src/meson.build | 1 -
src/tests/cogl/conform/test-alpha-textures.c | 2 +-
src/tests/meson.build | 1 -
35 files changed, 132 insertions(+), 348 deletions(-)
rename {cogl/cogl-pango => clutter/clutter/pango}/cogl-pango-display-list.c (98%)
rename {cogl/cogl-pango => clutter/clutter/pango}/cogl-pango-display-list.h (93%)
rename {cogl/cogl-pango => clutter/clutter/pango}/cogl-pango-fontmap.c (97%)
rename {cogl/cogl-pango => clutter/clutter/pango}/cogl-pango-glyph-cache.c (98%)
rename {cogl/cogl-pango => clutter/clutter/pango}/cogl-pango-glyph-cache.h (95%)
rename {cogl/cogl-pango => clutter/clutter/pango}/cogl-pango-pipeline-cache.c (98%)
rename {cogl/cogl-pango => clutter/clutter/pango}/cogl-pango-pipeline-cache.h (97%)
rename {cogl/cogl-pango => clutter/clutter/pango}/cogl-pango-private.h (91%)
rename {cogl/cogl-pango => clutter/clutter/pango}/cogl-pango-render.c (96%)
delete mode 100644 cogl/cogl-pango/cogl-pango.h
delete mode 100644 cogl/cogl-pango/meson.build
delete mode 100644 doc/reference/cogl-pango/cogl-pango.toml.in
delete mode 120000 doc/reference/cogl-pango/logo.svg
delete mode 100644 doc/reference/cogl-pango/meson.build
delete mode 100644 doc/reference/cogl-pango/urlmap.js
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 19ac5da5e..8efad898b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -801,7 +801,7 @@ reference:
script:
- mkdir references
- cp -r doc/website/* ./references
- - mv build/doc/reference/{clutter/clutter,cogl/cogl,cogl-pango/cogl-pango,meta/meta,mtk/mtk} references/
+ - mv build/doc/reference/{clutter/clutter,cogl/cogl,meta/meta,mtk/mtk} references/
artifacts:
expire_in: 1 week
expose_as: 'Documentation'
diff --git a/README.md b/README.md
index fb3c2cf8a..81eacc967 100644
--- a/README.md
+++ b/README.md
@@ -44,7 +44,6 @@ documentation and API references below first.
- Meta:
- Clutter:
- Cogl:
-- CoglPango:
- Mtk:
## Meetings
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 2abfc5eb2..80134ff42 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -13055,7 +13055,7 @@ update_pango_context (ClutterBackend *backend,
* stored by the #ClutterBackend change.
*
* You can use the returned #PangoContext to create a #PangoLayout
- * and render text using cogl_pango_show_layout() to reuse the
+ * and render text using clutter_show_layout() to reuse the
* glyphs cache also used by Clutter.
*
* Return value: (transfer none): the #PangoContext for a #ClutterActor.
diff --git a/clutter/clutter/clutter-context.c b/clutter/clutter/clutter-context.c
index ec689ccf8..b79d35ad1 100644
--- a/clutter/clutter/clutter-context.c
+++ b/clutter/clutter/clutter-context.c
@@ -31,6 +31,7 @@
#include "clutter/clutter-private.h"
#include "clutter/clutter-paint-node-private.h"
#include "clutter/clutter-settings-private.h"
+#include "clutter/pango/cogl-pango-private.h"
static gboolean clutter_show_fps = FALSE;
static gboolean clutter_enable_accessibility = TRUE;
diff --git a/clutter/clutter/clutter-context.h b/clutter/clutter/clutter-context.h
index 8ec8c7609..370d1227d 100644
--- a/clutter/clutter/clutter-context.h
+++ b/clutter/clutter/clutter-context.h
@@ -19,10 +19,10 @@
#pragma once
+#include
+
#include "clutter-backend.h"
#include "clutter-settings.h"
-#include "cogl-pango/cogl-pango.h"
-
typedef ClutterBackend * (* ClutterBackendConstructor) (ClutterContext *context,
gpointer user_data);
diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c
index 27d622ee8..23e5af20f 100644
--- a/clutter/clutter/clutter-main.c
+++ b/clutter/clutter/clutter-main.c
@@ -42,7 +42,6 @@
#include "clutter/clutter-backend-private.h"
#include "cogl/cogl.h"
-#include "cogl-pango/cogl-pango.h"
typedef struct
diff --git a/clutter/clutter/clutter-main.h b/clutter/clutter/clutter-main.h
index a07f644b8..82e4bdedf 100644
--- a/clutter/clutter/clutter-main.h
+++ b/clutter/clutter/clutter-main.h
@@ -27,9 +27,12 @@
#error "Only can be included directly."
#endif
+#include
+#include
+
#include "clutter/clutter-actor.h"
#include "clutter/clutter-stage.h"
-#include
+#include "cogl/cogl.h"
G_BEGIN_DECLS
@@ -157,4 +160,50 @@ void clutter_debug_set_max_render_time_constant (int max_rend
CLUTTER_EXPORT
ClutterTextDirection clutter_get_text_direction (void);
+typedef void (* ClutterPipelineSetup) (CoglPipeline *pipeline,
+ gpointer user_data);
+
+/**
+ * clutter_font_map_new:
+ *
+ * Creates a new font map.
+ *
+ * Return value: (transfer full): the newly created #PangoFontMap
+ */
+CLUTTER_EXPORT PangoFontMap *
+clutter_font_map_new (CoglContext *context);
+
+/**
+ * clutter_ensure_glyph_cache_for_layout:
+ * @layout: A #PangoLayout
+ *
+ * This updates any internal glyph cache textures as necessary to be
+ * able to render the given @layout.
+ *
+ * This api should be used to avoid mid-scene modifications of
+ * glyph-cache textures which can lead to undefined rendering results.
+ */
+CLUTTER_EXPORT void
+clutter_ensure_glyph_cache_for_layout (PangoLayout *layout);
+
+/**
+ * clutter_show_layout: (skip)
+ * @framebuffer: A #CoglFramebuffer to draw too.
+ * @layout: a #PangoLayout
+ * @x: X coordinate to render the layout at
+ * @y: Y coordinate to render the layout at
+ * @color: color to use when rendering the layout
+ *
+ * Draws a solidly coloured @layout on the given @framebuffer at (@x,
+ * @y) within the `framebuffer`'s current model-view coordinate space.
+ */
+CLUTTER_EXPORT void
+clutter_show_layout (CoglFramebuffer *framebuffer,
+ PangoLayout *layout,
+ float x,
+ float y,
+ const CoglColor *color,
+ ClutterPipelineSetup pipeline_setup,
+ gpointer pipeline_setup_userdata);
+
G_END_DECLS
diff --git a/clutter/clutter/clutter-paint-nodes.c b/clutter/clutter/clutter-paint-nodes.c
index 8e3597667..92b012175 100644
--- a/clutter/clutter/clutter-paint-nodes.c
+++ b/clutter/clutter/clutter-paint-nodes.c
@@ -812,13 +812,13 @@ clutter_text_node_draw (ClutterPaintNode *node,
clipped = TRUE;
}
- cogl_pango_show_layout (fb,
- tnode->layout,
- op->op.texrect[0],
- op->op.texrect[1],
- &tnode->color,
- setup_pango_pipeline,
- &pango_pipeline_data);
+ clutter_show_layout (fb,
+ tnode->layout,
+ op->op.texrect[0],
+ op->op.texrect[1],
+ &tnode->color,
+ setup_pango_pipeline,
+ &pango_pipeline_data);
if (clipped)
cogl_framebuffer_pop_clip (fb);
diff --git a/clutter/clutter/clutter-private.h b/clutter/clutter/clutter-private.h
index 99381cf58..12f6498b8 100644
--- a/clutter/clutter/clutter-private.h
+++ b/clutter/clutter/clutter-private.h
@@ -29,8 +29,6 @@
#include
#include
-#include "cogl-pango/cogl-pango.h"
-
#include "clutter/clutter-backend.h"
#include "clutter/clutter-context.h"
#include "clutter/clutter-effect.h"
diff --git a/clutter/clutter/clutter-text.c b/clutter/clutter/clutter-text.c
index bc4079d94..2a0dd3079 100644
--- a/clutter/clutter/clutter-text.c
+++ b/clutter/clutter/clutter-text.c
@@ -56,7 +56,7 @@
#include "clutter/clutter-keysyms.h"
#include "clutter/clutter-main.h"
#include "clutter/clutter-marshal.h"
-#include "clutter/clutter-private.h" /* includes */
+#include "clutter/clutter-private.h"
#include "clutter/clutter-property-transition.h"
#include "clutter/clutter-text-buffer.h"
#include "clutter/clutter-paint-volume-private.h"
@@ -1073,7 +1073,7 @@ clutter_text_create_layout (ClutterText *text,
oldest_cache->layout =
clutter_text_create_layout_no_cache (text, width, height, ellipsize);
- cogl_pango_ensure_glyph_cache_for_layout (oldest_cache->layout);
+ clutter_ensure_glyph_cache_for_layout (oldest_cache->layout);
/* Mark the 'time' this cache was created and advance the time */
oldest_cache->age = priv->cache_age++;
@@ -2030,9 +2030,9 @@ paint_selection_rectangle (ClutterText *self,
color->blue / 255.0f,
paint_opacity / 255.0f * color->alpha / 255.0f);
- cogl_pango_show_layout (fb, layout, priv->text_x, 0, &cogl_color,
- setup_pango_pipeline,
- &pango_pipeline_data);
+ clutter_show_layout (fb, layout, priv->text_x, 0, &cogl_color,
+ setup_pango_pipeline,
+ &pango_pipeline_data);
cogl_framebuffer_pop_clip (fb);
g_object_unref (color_pipeline);
@@ -2863,9 +2863,9 @@ clutter_text_paint (ClutterActor *self,
.color_state = color_state,
.target_color_state = target_color_state,
};
- cogl_pango_show_layout (fb, layout, priv->text_x, priv->text_y, &color,
- setup_pango_pipeline,
- &pango_pipeline_data);
+ clutter_show_layout (fb, layout, priv->text_x, priv->text_y, &color,
+ setup_pango_pipeline,
+ &pango_pipeline_data);
selection_paint (text, fb, paint_context);
diff --git a/clutter/clutter/meson.build b/clutter/clutter/meson.build
index 9a5a8aa1e..7ab1fa83e 100644
--- a/clutter/clutter/meson.build
+++ b/clutter/clutter/meson.build
@@ -84,6 +84,10 @@ clutter_headers = [
]
clutter_sources = [
+ 'pango/cogl-pango-display-list.c',
+ 'pango/cogl-pango-glyph-cache.c',
+ 'pango/cogl-pango-pipeline-cache.c',
+ 'pango/cogl-pango-render.c',
'clutter-accessibility.c',
'clutter-action.c',
'clutter-actor-box.c',
@@ -177,6 +181,10 @@ clutter_sources = [
]
clutter_private_headers = [
+ 'pango/cogl-pango-display-list.h',
+ 'pango/cogl-pango-glyph-cache.h',
+ 'pango/cogl-pango-pipeline-cache.h',
+ 'pango/cogl-pango-private.h',
'clutter-accessibility-private.h',
'clutter-actor-meta-private.h',
'clutter-actor-private.h',
@@ -262,7 +270,6 @@ libmutter_clutter = shared_library(libmutter_clutter_name,
gnu_symbol_visibility: 'hidden',
link_with: [
libmutter_cogl,
- libmutter_cogl_pango,
],
install_rpath: pkglibdir,
install_dir: pkglibdir,
@@ -294,12 +301,12 @@ if have_introspection
includes: [
libmutter_mtk_gir[0],
libmutter_cogl_gir[0],
- libmutter_cogl_pango_gir[0],
'GL-1.0',
'Gio-2.0',
'GObject-2.0',
'cairo-1.0',
'Atk-1.0',
+ 'Pango-1.0',
],
dependencies: [cogl_deps],
extra_args: clutter_introspection_args + ['--c-include=clutter/clutter.h'],
diff --git a/cogl/cogl-pango/cogl-pango-display-list.c b/clutter/clutter/pango/cogl-pango-display-list.c
similarity index 98%
rename from cogl/cogl-pango/cogl-pango-display-list.c
rename to clutter/clutter/pango/cogl-pango-display-list.c
index bf1e570c9..c832e5cfa 100644
--- a/cogl/cogl-pango/cogl-pango-display-list.c
+++ b/clutter/clutter/pango/cogl-pango-display-list.c
@@ -1,7 +1,7 @@
/*
- * Cogl
+ * Clutter.
*
- * A Low Level GPU Graphics and Utilities API
+ * An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2009 Intel Corporation.
*
@@ -31,8 +31,8 @@
#include
#include
-#include "cogl-pango/cogl-pango-display-list.h"
-#include "cogl-pango/cogl-pango-pipeline-cache.h"
+#include "clutter/pango/cogl-pango-display-list.h"
+#include "clutter/pango/cogl-pango-pipeline-cache.h"
#include "cogl/cogl.h"
typedef enum
@@ -393,7 +393,7 @@ _cogl_framebuffer_draw_display_list_texture (CoglFramebuffer *fb,
void
cogl_pango_display_list_render (CoglFramebuffer *fb,
CoglPangoDisplayList *dl,
- CoglPangoPipelineSetup pipeline_setup,
+ ClutterPipelineSetup pipeline_setup,
gpointer pipeline_setup_user_data,
const CoglColor *color)
{
diff --git a/cogl/cogl-pango/cogl-pango-display-list.h b/clutter/clutter/pango/cogl-pango-display-list.h
similarity index 93%
rename from cogl/cogl-pango/cogl-pango-display-list.h
rename to clutter/clutter/pango/cogl-pango-display-list.h
index de6eec0c6..6fa2f131c 100644
--- a/cogl/cogl-pango/cogl-pango-display-list.h
+++ b/clutter/clutter/pango/cogl-pango-display-list.h
@@ -1,7 +1,7 @@
/*
- * Cogl
+ * Clutter.
*
- * A Low Level GPU Graphics and Utilities API
+ * An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2009 Intel Corporation.
*
@@ -30,9 +30,9 @@
#include
-#include "cogl-pango/cogl-pango-pipeline-cache.h"
+#include "clutter/pango/cogl-pango-pipeline-cache.h"
+#include "clutter/clutter-main.h"
-#include "cogl-pango/cogl-pango.h"
G_BEGIN_DECLS
@@ -73,7 +73,7 @@ _cogl_pango_display_list_add_trapezoid (CoglPangoDisplayList *dl,
void
cogl_pango_display_list_render (CoglFramebuffer *framebuffer,
CoglPangoDisplayList *dl,
- CoglPangoPipelineSetup pipeline_setup,
+ ClutterPipelineSetup pipeline_setup,
gpointer pipeline_setup_user_data,
const CoglColor *color);
diff --git a/cogl/cogl-pango/cogl-pango-fontmap.c b/clutter/clutter/pango/cogl-pango-fontmap.c
similarity index 97%
rename from cogl/cogl-pango/cogl-pango-fontmap.c
rename to clutter/clutter/pango/cogl-pango-fontmap.c
index 2e973c357..bc02b7e6a 100644
--- a/cogl/cogl-pango/cogl-pango-fontmap.c
+++ b/clutter/clutter/pango/cogl-pango-fontmap.c
@@ -32,8 +32,7 @@
#include
#include
-#include "cogl-pango/cogl-pango.h"
-#include "cogl-pango/cogl-pango-private.h"
+#include "clutter/pango/cogl-pango-private.h"
#include "cogl/cogl.h"
static GQuark cogl_pango_font_map_get_priv_key (void) G_GNUC_CONST;
diff --git a/cogl/cogl-pango/cogl-pango-glyph-cache.c b/clutter/clutter/pango/cogl-pango-glyph-cache.c
similarity index 98%
rename from cogl/cogl-pango/cogl-pango-glyph-cache.c
rename to clutter/clutter/pango/cogl-pango-glyph-cache.c
index 92d66ce13..e1ae80427 100644
--- a/cogl/cogl-pango/cogl-pango-glyph-cache.c
+++ b/clutter/clutter/pango/cogl-pango-glyph-cache.c
@@ -1,7 +1,7 @@
/*
- * Cogl
+ * Clutter.
*
- * A Low Level GPU Graphics and Utilities API
+ * An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2008 OpenedHand
*
@@ -30,8 +30,9 @@
#include
-#include "cogl-pango/cogl-pango-glyph-cache.h"
-#include "cogl-pango/cogl-pango-private.h"
+#include "clutter/clutter-debug.h"
+#include "clutter/pango/cogl-pango-glyph-cache.h"
+#include "clutter/pango/cogl-pango-private.h"
typedef struct _CoglPangoGlyphCacheKey CoglPangoGlyphCacheKey;
@@ -276,7 +277,7 @@ cogl_pango_glyph_cache_add_to_local_atlas (CoglPangoGlyphCache *cache,
COGL_ATLAS_CLEAR_TEXTURE |
COGL_ATLAS_DISABLE_MIGRATION,
cogl_pango_glyph_cache_update_position_cb);
- g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, "Created new atlas for glyphs: %p", atlas);
+ CLUTTER_NOTE (PANGO, "Created new atlas for glyphs: %p", atlas);
/* If we still can't reserve space then something has gone
seriously wrong so we'll just give up */
if (!cogl_atlas_reserve_space (atlas,
diff --git a/cogl/cogl-pango/cogl-pango-glyph-cache.h b/clutter/clutter/pango/cogl-pango-glyph-cache.h
similarity index 95%
rename from cogl/cogl-pango/cogl-pango-glyph-cache.h
rename to clutter/clutter/pango/cogl-pango-glyph-cache.h
index 381a1c814..0abdef7b1 100644
--- a/cogl/cogl-pango/cogl-pango-glyph-cache.h
+++ b/clutter/clutter/pango/cogl-pango-glyph-cache.h
@@ -1,7 +1,7 @@
/*
- * Cogl
+ * Clutter.
*
- * A Low Level GPU Graphics and Utilities API
+ * An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2008 OpenedHand
*
@@ -66,14 +66,14 @@ typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font,
PangoGlyph glyph,
CoglPangoGlyphCacheValue *value);
-COGL_EXPORT CoglPangoGlyphCache *
+CoglPangoGlyphCache *
cogl_pango_glyph_cache_new (CoglContext *ctx,
gboolean use_mipmapping);
-COGL_EXPORT void
+void
cogl_pango_glyph_cache_free (CoglPangoGlyphCache *cache);
-COGL_EXPORT CoglPangoGlyphCacheValue *
+CoglPangoGlyphCacheValue *
cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
CoglContext *context,
gboolean create,
diff --git a/cogl/cogl-pango/cogl-pango-pipeline-cache.c b/clutter/clutter/pango/cogl-pango-pipeline-cache.c
similarity index 98%
rename from cogl/cogl-pango/cogl-pango-pipeline-cache.c
rename to clutter/clutter/pango/cogl-pango-pipeline-cache.c
index bd427d9ff..0590cae77 100644
--- a/cogl/cogl-pango/cogl-pango-pipeline-cache.c
+++ b/clutter/clutter/pango/cogl-pango-pipeline-cache.c
@@ -1,7 +1,7 @@
/*
- * Cogl
+ * Clutter.
*
- * A Low Level GPU Graphics and Utilities API
+ * An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2011 Intel Corporation.
*
@@ -35,7 +35,7 @@
#include
-#include "cogl-pango/cogl-pango-pipeline-cache.h"
+#include "clutter/pango/cogl-pango-pipeline-cache.h"
typedef struct _CoglPangoPipelineCacheEntry CoglPangoPipelineCacheEntry;
diff --git a/cogl/cogl-pango/cogl-pango-pipeline-cache.h b/clutter/clutter/pango/cogl-pango-pipeline-cache.h
similarity index 97%
rename from cogl/cogl-pango/cogl-pango-pipeline-cache.h
rename to clutter/clutter/pango/cogl-pango-pipeline-cache.h
index 6029477c7..8fa0e17da 100644
--- a/cogl/cogl-pango/cogl-pango-pipeline-cache.h
+++ b/clutter/clutter/pango/cogl-pango-pipeline-cache.h
@@ -1,7 +1,7 @@
/*
- * Cogl
+ * Clutter.
*
- * A Low Level GPU Graphics and Utilities API
+ * An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2011 Intel Corporation.
*
diff --git a/cogl/cogl-pango/cogl-pango-private.h b/clutter/clutter/pango/cogl-pango-private.h
similarity index 91%
rename from cogl/cogl-pango/cogl-pango-private.h
rename to clutter/clutter/pango/cogl-pango-private.h
index 6fa50776c..d300696f5 100644
--- a/cogl/cogl-pango/cogl-pango-private.h
+++ b/clutter/clutter/pango/cogl-pango-private.h
@@ -1,7 +1,7 @@
/*
- * Cogl
+ * Clutter.
*
- * A Low Level GPU Graphics and Utilities API
+ * An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2008 OpenedHand
* Copyright (C) 2012 Intel Corporation.
@@ -35,13 +35,17 @@
#pragma once
-#include "cogl-pango/cogl-pango.h"
+#include
+
+#include "cogl/cogl.h"
G_BEGIN_DECLS
PangoRenderer *
_cogl_pango_renderer_new (CoglContext *context);
+PangoFontMap *
+cogl_pango_font_map_new (CoglContext *context);
/**
* cogl_pango_font_map_get_renderer:
diff --git a/cogl/cogl-pango/cogl-pango-render.c b/clutter/clutter/pango/cogl-pango-render.c
similarity index 96%
rename from cogl/cogl-pango/cogl-pango-render.c
rename to clutter/clutter/pango/cogl-pango-render.c
index ad35f107b..dc615f065 100644
--- a/cogl/cogl-pango/cogl-pango-render.c
+++ b/clutter/clutter/pango/cogl-pango-render.c
@@ -1,7 +1,7 @@
/*
- * Cogl
+ * Clutter.
*
- * A Low Level GPU Graphics and Utilities API
+ * An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2008 OpenedHand
* Copyright (C) 2012 Intel Corporation.
@@ -41,9 +41,10 @@
#include
#include
-#include "cogl-pango/cogl-pango-private.h"
-#include "cogl-pango/cogl-pango-glyph-cache.h"
-#include "cogl-pango/cogl-pango-display-list.h"
+#include "clutter/clutter-debug.h"
+#include "clutter/pango/cogl-pango-private.h"
+#include "clutter/pango/cogl-pango-glyph-cache.h"
+#include "clutter/pango/cogl-pango-display-list.h"
#include "cogl/cogl.h"
#define PANGO_UNKNOWN_GLYPH_WIDTH 10
@@ -301,13 +302,13 @@ cogl_pango_render_qdata_destroy (CoglPangoLayoutQdata *qdata)
}
void
-cogl_pango_show_layout (CoglFramebuffer *fb,
- PangoLayout *layout,
- float x,
- float y,
- const CoglColor *color,
- CoglPangoPipelineSetup pipeline_setup,
- gpointer pipeline_setup_userdata)
+clutter_show_layout (CoglFramebuffer *fb,
+ PangoLayout *layout,
+ float x,
+ float y,
+ const CoglColor *color,
+ ClutterPipelineSetup pipeline_setup,
+ gpointer pipeline_setup_userdata)
{
PangoContext *context;
CoglPangoRenderer *priv;
@@ -347,7 +348,7 @@ cogl_pango_show_layout (CoglFramebuffer *fb,
&priv->mipmap_caches :
&priv->no_mipmap_caches;
- cogl_pango_ensure_glyph_cache_for_layout (layout);
+ clutter_ensure_glyph_cache_for_layout (layout);
qdata->display_list =
_cogl_pango_display_list_new (caches->pipeline_cache);
@@ -436,7 +437,7 @@ cogl_pango_renderer_set_dirty_glyph (PangoFont *font,
cairo_format_t format_cairo;
CoglPixelFormat format_cogl;
- g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, "redrawing glyph %i", glyph);
+ CLUTTER_NOTE (PANGO, "redrawing glyph %i", glyph);
/* Glyphs that don't take up any space will end up without a
texture. These should never become dirty so they shouldn't end up
@@ -546,7 +547,7 @@ _cogl_pango_set_dirty_glyphs (CoglPangoRenderer *priv)
}
void
-cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout)
+clutter_ensure_glyph_cache_for_layout (PangoLayout *layout)
{
PangoContext *context;
CoglPangoRenderer *priv;
@@ -750,7 +751,7 @@ cogl_pango_renderer_draw_glyphs (PangoRenderer *renderer,
font,
gi->glyph);
- /* cogl_pango_ensure_glyph_cache_for_layout should always be
+ /* clutter_ensure_glyph_cache_for_layout should always be
called before rendering a layout so we should never have
a dirty glyph here */
g_assert (cache_value == NULL || !cache_value->dirty);
diff --git a/cogl/cogl-pango/cogl-pango.h b/cogl/cogl-pango/cogl-pango.h
deleted file mode 100644
index 5fcc7989e..000000000
--- a/cogl/cogl-pango/cogl-pango.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Cogl
- *
- * A Low Level GPU Graphics and Utilities API
- *
- * Copyright (C) 2008 OpenedHand
- * Copyright (C) 2012 Intel Corporation.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Authors:
- * Neil Roberts
- * Robert Bragg
- * Matthew Allum
- */
-
-#pragma once
-
-#include
-#include
-#include
-
-#include "cogl/cogl.h"
-
-G_BEGIN_DECLS
-
-typedef void (* CoglPangoPipelineSetup) (CoglPipeline *pipeline,
- gpointer user_data);
-
-/**
- * cogl_pango_font_map_new:
- *
- * Creates a new font map.
- *
- * Return value: (transfer full): the newly created #PangoFontMap
- */
-COGL_EXPORT PangoFontMap *
-cogl_pango_font_map_new (CoglContext *context);
-
-/**
- * cogl_pango_ensure_glyph_cache_for_layout:
- * @layout: A #PangoLayout
- *
- * This updates any internal glyph cache textures as necessary to be
- * able to render the given @layout.
- *
- * This api should be used to avoid mid-scene modifications of
- * glyph-cache textures which can lead to undefined rendering results.
- */
-COGL_EXPORT void
-cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout);
-
-/**
- * cogl_pango_show_layout: (skip)
- * @framebuffer: A #CoglFramebuffer to draw too.
- * @layout: a #PangoLayout
- * @x: X coordinate to render the layout at
- * @y: Y coordinate to render the layout at
- * @color: color to use when rendering the layout
- *
- * Draws a solidly coloured @layout on the given @framebuffer at (@x,
- * @y) within the `framebuffer`'s current model-view coordinate space.
- */
-COGL_EXPORT void
-cogl_pango_show_layout (CoglFramebuffer *framebuffer,
- PangoLayout *layout,
- float x,
- float y,
- const CoglColor *color,
- CoglPangoPipelineSetup pipeline_setup,
- gpointer pipeline_setup_userdata);
-
-
-G_END_DECLS
diff --git a/cogl/cogl-pango/meson.build b/cogl/cogl-pango/meson.build
deleted file mode 100644
index a233a9e54..000000000
--- a/cogl/cogl-pango/meson.build
+++ /dev/null
@@ -1,82 +0,0 @@
-cogl_pango_sources = [
- 'cogl-pango-display-list.c',
- 'cogl-pango-display-list.h',
- 'cogl-pango-fontmap.c',
- 'cogl-pango-glyph-cache.c',
- 'cogl-pango-glyph-cache.h',
- 'cogl-pango-pipeline-cache.c',
- 'cogl-pango-pipeline-cache.h',
- 'cogl-pango-private.h',
- 'cogl-pango-render.c',
-]
-
-cogl_pango_public_headers = [
- 'cogl-pango.h',
-]
-
-cogl_pango_deps = [
- cairo_dep,
- pango_dep,
- pangocairo_dep,
- libmutter_cogl_dep,
-]
-
-libmutter_cogl_pango_name = 'mutter-cogl-pango-' + libmutter_api_version
-libmutter_cogl_pango = shared_library(libmutter_cogl_pango_name,
- sources: [cogl_pango_sources, cogl_pango_public_headers],
- version: '0.0.0',
- soversion: 0,
- c_args: cogl_debug_c_args,
- include_directories: [cogl_includepath, top_includepath],
- gnu_symbol_visibility: 'hidden',
- dependencies: [cogl_pango_deps],
- install_rpath: pkglibdir,
- install_dir: pkglibdir,
- install: true,
-)
-
-libmutter_cogl_pango_dep = declare_dependency(
- link_with: libmutter_cogl_pango,
-)
-
-if have_introspection
- libmutter_cogl_pango_gir = gnome.generate_gir(libmutter_cogl_pango,
- sources: cogl_pango_public_headers,
- nsversion: libmutter_api_version,
- namespace: 'CoglPango',
- symbol_prefix: 'cogl_pango',
- header: 'cogl-pango.h',
- includes: [
- libmutter_mtk_gir[0],
- libmutter_cogl_gir[0],
- 'Pango-1.0',
- 'PangoCairo-1.0'
- ],
- dependencies: [
- cogl_deps,
- pango_dep,
- libmutter_cogl_pango_dep,
- ],
- export_packages: [libmutter_cogl_pango_name],
- extra_args: introspection_args + [
- '-DG_LOG_DOMAIN="CoglPango"',
- ],
- kwargs: introspection_common,
- )
-endif
-
-cogl_pango_includesubdir = cogl_includesubdir / 'cogl-pango'
-install_headers(cogl_pango_public_headers, subdir: cogl_pango_includesubdir)
-
-pkg.generate(libmutter_cogl_pango,
- name: 'CoglPango',
- filebase: libmutter_cogl_pango_name,
- description: 'A text rendering for Cogl in mutter',
- subdirs: pkgname / 'cogl',
- requires: [cogl_pkg_deps, libmutter_cogl_name, pango_dep, pangocairo_dep],
- version: meson.project_version(),
- variables: [
- 'apiversion=' + libmutter_api_version,
- ],
- install_dir: pcdir,
-)
diff --git a/cogl/meson.build b/cogl/meson.build
index c126558b4..180120b62 100644
--- a/cogl/meson.build
+++ b/cogl/meson.build
@@ -92,4 +92,3 @@ cogl_debug_c_args = cc.get_supported_arguments(cogl_debug_c_args)
cogl_c_args += cogl_debug_c_args
subdir('cogl')
-subdir('cogl-pango')
diff --git a/doc/debugging.md b/doc/debugging.md
index 3d3c79768..4eaa7b18c 100644
--- a/doc/debugging.md
+++ b/doc/debugging.md
@@ -35,7 +35,7 @@ When a test fails when running `meson test`, it makes sense to re-run this speci
12/243 mutter:cogl+cogl/conform / cogl-test-backface-culling-gles2 OK 1.46s
^CWARNING: CTRL-C detected, interrupting mutter:cogl+cogl/conform / cogl-test-just-vertex-shader-gl3
13/243 mutter:cogl+cogl/conform / cogl-test-just-vertex-shader-gl3 INTERRUPT 0.75s killed by signal 15 SIGTERM
->>> COGL_DRIVER=gl3 G_TEST_BUILDDIR=/var/home/swick/Projects/mutter/build/src/tests/cogl/conform MALLOC_PERTURB_=83 G_TEST_SRCDIR=/var/home/swick/Projects/mutter/src/tests/cogl/conform G_ENABLE_DIAGNOSTIC=0 LD_LIBRARY_PATH=/var/home/swick/Projects/mutter/build/cogl/cogl:/var/home/swick/Projects/mutter/build/src/tests:/var/home/swick/Projects/mutter/build/mtk/mtk:/var/home/swick/Projects/mutter/build/clutter/clutter:/var/home/swick/Projects/mutter/build/cogl/cogl-pango:/var/home/swick/Projects/mutter/build/src /var/home/swick/Projects/mutter/src/tests/meta-dbus-runner.py -- /var/home/swick/Projects/mutter/build/src/tests/cogl/conform/cogl-test-just-vertex-shader
+>>> COGL_DRIVER=gl3 G_TEST_BUILDDIR=/var/home/swick/Projects/mutter/build/src/tests/cogl/conform MALLOC_PERTURB_=83 G_TEST_SRCDIR=/var/home/swick/Projects/mutter/src/tests/cogl/conform G_ENABLE_DIAGNOSTIC=0 LD_LIBRARY_PATH=/var/home/swick/Projects/mutter/build/cogl/cogl:/var/home/swick/Projects/mutter/build/src/tests:/var/home/swick/Projects/mutter/build/mtk/mtk:/var/home/swick/Projects/mutter/build/clutter/clutter:/var/home/swick/Projects/mutter/build/src /var/home/swick/Projects/mutter/src/tests/meta-dbus-runner.py -- /var/home/swick/Projects/mutter/build/src/tests/cogl/conform/cogl-test-just-vertex-shader
```
diff --git a/doc/reference/clutter/meson.build b/doc/reference/clutter/meson.build
index d93906ab3..1a4712415 100644
--- a/doc/reference/clutter/meson.build
+++ b/doc/reference/clutter/meson.build
@@ -16,7 +16,6 @@ custom_target('clutter-doc',
gidocgen_common_args,
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../mtk/mtk'),
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../cogl/cogl'),
- '--add-include-path=@0@'.format(meson.current_build_dir() / '../../../cogl/cogl-pango'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
'--content-dir=@0@'.format(meson.current_source_dir()),
@@ -24,7 +23,6 @@ custom_target('clutter-doc',
],
depends: [
libmutter_mtk_gir[0],
- libmutter_cogl_pango_gir[0],
libmutter_cogl_gir[0],
],
build_by_default: true,
diff --git a/doc/reference/cogl-pango/cogl-pango.toml.in b/doc/reference/cogl-pango/cogl-pango.toml.in
deleted file mode 100644
index a994e71b1..000000000
--- a/doc/reference/cogl-pango/cogl-pango.toml.in
+++ /dev/null
@@ -1,46 +0,0 @@
-[library]
-version = "@version@"
-browse_url = "https://gitlab.gnome.org/GNOME/mutter/"
-repository_url = "https://gitlab.gnome.org/GNOME/mutter.git"
-website_url = "https://blogs.gnome.org/shell-dev/"
-docs_url = "https://mutter.gnome.org/"
-logo_url = "logo.svg"
-authors = "Mutter Development Team"
-license = "GPL-2.0-or-later"
-description = "A Low Level GPU Graphics and Utilities API"
-dependencies = [ "GObject-2.0", "Pango-1.0", "PangoCairo-1.0" ]
-devhelp = true
-search_index = true
-
- [dependencies."GObject-2.0"]
- name = "GObject"
- description = "The base type system library"
- docs_url = "https://docs.gtk.org/gobject/"
-
- [dependencies."Pango-1.0"]
- name = "Pango"
- description = "Text shaping and rendering"
- docs_url = "https://docs.gtk.org/Pango/"
-
- [dependencies."PangoCairo-1.0"]
- name = "PangoCairo"
- description = "Cairo support for Pango"
- docs_url = "https://docs.gtk.org/PangoCairo/"
-
-[theme]
-name = "basic"
-show_index_summary = true
-show_class_hierarchy = true
-
-[source-location]
-base_url = "https://gitlab.gnome.org/GNOME/mutter/-/blob/@vcs_tag@/"
-
-[extra]
-# The same order will be used when generating the index
-content_files = [
-]
-content_images = [
- "logo.svg",
-]
-urlmap_file = "urlmap.js"
-
diff --git a/doc/reference/cogl-pango/logo.svg b/doc/reference/cogl-pango/logo.svg
deleted file mode 120000
index ffdbeb4c7..000000000
--- a/doc/reference/cogl-pango/logo.svg
+++ /dev/null
@@ -1 +0,0 @@
-../../../logo.svg
\ No newline at end of file
diff --git a/doc/reference/cogl-pango/meson.build b/doc/reference/cogl-pango/meson.build
deleted file mode 100644
index 49f1dddf6..000000000
--- a/doc/reference/cogl-pango/meson.build
+++ /dev/null
@@ -1,30 +0,0 @@
-
-cogl_pango_toml = configure_file(
- input: 'cogl-pango.toml.in',
- output: 'cogl-pango.toml',
- configuration: toml_conf,
- install: true,
- install_dir: docs_dir / 'cogl-pango',
-)
-
-custom_target('cogl-pango-doc',
- input: [ cogl_pango_toml, libmutter_cogl_pango_gir[0] ],
- output: 'cogl-pango',
- command: [
- gidocgen,
- 'generate',
- gidocgen_common_args,
- '--add-include-path=@0@'.format(meson.current_build_dir() / '../../../mtk/mtk'),
- '--add-include-path=@0@'.format(meson.current_build_dir() / '../../../cogl/cogl'),
- '--config=@INPUT0@',
- '--output-dir=@OUTPUT@',
- '--content-dir=@0@'.format(meson.current_source_dir()),
- '@INPUT1@',
- ],
- depends: [
- libmutter_cogl_gir[0],
- ],
- build_by_default: true,
- install: true,
- install_dir: docs_dir,
-)
diff --git a/doc/reference/cogl-pango/urlmap.js b/doc/reference/cogl-pango/urlmap.js
deleted file mode 100644
index e0f4194e8..000000000
--- a/doc/reference/cogl-pango/urlmap.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// SPDX-FileCopyrightText: 2021 GNOME Foundation
-// SPDX-License-Identifier: LGPL-2.1-or-later
-
-// A map between namespaces and base URLs for their online documentation
-baseURLs = [
- [ 'GObject', 'https://docs.gtk.org/gobject/' ],
- [ 'Pango', 'https://docs.gtk.org/Pango/' ],
- [ 'PangoCairo', 'https://docs.gtk.org/PangoCairo/' ],
- [ 'Cogl', 'https://mutter.gnome.org/cogl/' ],
-]
diff --git a/doc/reference/meson.build b/doc/reference/meson.build
index 6d1d3fd02..45ccbcf26 100644
--- a/doc/reference/meson.build
+++ b/doc/reference/meson.build
@@ -22,6 +22,5 @@ docs_dir = pkgdatadir / 'doc'
subdir('clutter')
subdir('cogl')
-subdir('cogl-pango')
subdir('meta')
subdir('mtk')
diff --git a/doc/reference/meta/meson.build b/doc/reference/meta/meson.build
index 097250df6..5c191bbd5 100644
--- a/doc/reference/meta/meson.build
+++ b/doc/reference/meta/meson.build
@@ -17,7 +17,6 @@ custom_target('meta-doc',
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../mtk/mtk'),
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../clutter/clutter'),
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../cogl/cogl'),
- '--add-include-path=@0@'.format(meson.current_build_dir() / '../../../cogl/cogl-pango'),
'--config=@INPUT0@',
'--output-dir=@OUTPUT@',
'--content-dir=@0@'.format(meson.current_source_dir()),
@@ -26,7 +25,6 @@ custom_target('meta-doc',
depends: [
libmutter_mtk_gir[0],
libmutter_clutter_gir[0],
- libmutter_cogl_pango_gir[0],
libmutter_cogl_gir[0],
],
build_by_default: true,
diff --git a/doc/website/index.html b/doc/website/index.html
index 7a1ed527f..4f14096ae 100644
--- a/doc/website/index.html
+++ b/doc/website/index.html
@@ -114,11 +114,6 @@
importing and drawing textures, internally using OpenGL.
-
- CoglPango
- A Low Level GPU Graphics and Utilities API.
-
-
Mtk
The Meta Toolkit containing utilities shared by other parts of mutter.
diff --git a/src/meson.build b/src/meson.build
index bfa8306d2..12a8589d8 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1306,7 +1306,6 @@ if have_introspection
'GObject-2.0',
'GDesktopEnums-3.0',
libmutter_cogl_gir[0],
- libmutter_cogl_pango_gir[0],
libmutter_clutter_gir[0],
libmutter_mtk_gir[0],
]
diff --git a/src/tests/cogl/conform/test-alpha-textures.c b/src/tests/cogl/conform/test-alpha-textures.c
index 7b98906d2..39ac706fa 100644
--- a/src/tests/cogl/conform/test-alpha-textures.c
+++ b/src/tests/cogl/conform/test-alpha-textures.c
@@ -30,7 +30,7 @@ create_pipeline (CoglTexture **tex_out,
0, /* layer */
COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE);
- /* This is the layer combine used by cogl-pango */
+ /* This is the layer combine used by clutter text rendering */
cogl_pipeline_set_layer_combine (pipeline,
0, /* layer */
"RGBA = MODULATE (PREVIOUS, TEXTURE[A])",
diff --git a/src/tests/meson.build b/src/tests/meson.build
index 093f33506..935f990a3 100644
--- a/src/tests/meson.build
+++ b/src/tests/meson.build
@@ -95,7 +95,6 @@ if have_introspection
'xfixes-4.0',
libmutter_mtk_gir[0],
libmutter_cogl_gir[0],
- libmutter_cogl_pango_gir[0],
libmutter_clutter_gir[0],
libmutter_gir[0],
],