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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
This commit is contained in:
Bilal Elmoussaoui 2024-09-04 14:28:13 +02:00 committed by Marge Bot
parent b6b004b437
commit fe3192169a
35 changed files with 132 additions and 348 deletions

View File

@ -801,7 +801,7 @@ reference:
script: script:
- mkdir references - mkdir references
- cp -r doc/website/* ./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: artifacts:
expire_in: 1 week expire_in: 1 week
expose_as: 'Documentation' expose_as: 'Documentation'

View File

@ -44,7 +44,6 @@ documentation and API references below first.
- Meta: <https://mutter.gnome.org/meta/> - Meta: <https://mutter.gnome.org/meta/>
- Clutter: <https://mutter.gnome.org/clutter/> - Clutter: <https://mutter.gnome.org/clutter/>
- Cogl: <https://mutter.gnome.org/cogl/> - Cogl: <https://mutter.gnome.org/cogl/>
- CoglPango: <https://mutter.gnome.org/cogl-pango/>
- Mtk: <https://mutter.gnome.org/mtk/> - Mtk: <https://mutter.gnome.org/mtk/>
## Meetings ## Meetings

View File

@ -13055,7 +13055,7 @@ update_pango_context (ClutterBackend *backend,
* stored by the #ClutterBackend change. * stored by the #ClutterBackend change.
* *
* You can use the returned #PangoContext to create a #PangoLayout * 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. * glyphs cache also used by Clutter.
* *
* Return value: (transfer none): the #PangoContext for a #ClutterActor. * Return value: (transfer none): the #PangoContext for a #ClutterActor.

View File

@ -31,6 +31,7 @@
#include "clutter/clutter-private.h" #include "clutter/clutter-private.h"
#include "clutter/clutter-paint-node-private.h" #include "clutter/clutter-paint-node-private.h"
#include "clutter/clutter-settings-private.h" #include "clutter/clutter-settings-private.h"
#include "clutter/pango/cogl-pango-private.h"
static gboolean clutter_show_fps = FALSE; static gboolean clutter_show_fps = FALSE;
static gboolean clutter_enable_accessibility = TRUE; static gboolean clutter_enable_accessibility = TRUE;

View File

@ -19,10 +19,10 @@
#pragma once #pragma once
#include <pango/pango.h>
#include "clutter-backend.h" #include "clutter-backend.h"
#include "clutter-settings.h" #include "clutter-settings.h"
#include "cogl-pango/cogl-pango.h"
typedef ClutterBackend * (* ClutterBackendConstructor) (ClutterContext *context, typedef ClutterBackend * (* ClutterBackendConstructor) (ClutterContext *context,
gpointer user_data); gpointer user_data);

View File

@ -42,7 +42,6 @@
#include "clutter/clutter-backend-private.h" #include "clutter/clutter-backend-private.h"
#include "cogl/cogl.h" #include "cogl/cogl.h"
#include "cogl-pango/cogl-pango.h"
typedef struct typedef struct

View File

@ -27,9 +27,12 @@
#error "Only <clutter/clutter.h> can be included directly." #error "Only <clutter/clutter.h> can be included directly."
#endif #endif
#include <pango/pango.h>
#include <pango/pangocairo.h>
#include "clutter/clutter-actor.h" #include "clutter/clutter-actor.h"
#include "clutter/clutter-stage.h" #include "clutter/clutter-stage.h"
#include <pango/pango.h> #include "cogl/cogl.h"
G_BEGIN_DECLS G_BEGIN_DECLS
@ -157,4 +160,50 @@ void clutter_debug_set_max_render_time_constant (int max_rend
CLUTTER_EXPORT CLUTTER_EXPORT
ClutterTextDirection clutter_get_text_direction (void); 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 G_END_DECLS

View File

@ -812,13 +812,13 @@ clutter_text_node_draw (ClutterPaintNode *node,
clipped = TRUE; clipped = TRUE;
} }
cogl_pango_show_layout (fb, clutter_show_layout (fb,
tnode->layout, tnode->layout,
op->op.texrect[0], op->op.texrect[0],
op->op.texrect[1], op->op.texrect[1],
&tnode->color, &tnode->color,
setup_pango_pipeline, setup_pango_pipeline,
&pango_pipeline_data); &pango_pipeline_data);
if (clipped) if (clipped)
cogl_framebuffer_pop_clip (fb); cogl_framebuffer_pop_clip (fb);

View File

@ -29,8 +29,6 @@
#include <glib.h> #include <glib.h>
#include <pango/pango.h> #include <pango/pango.h>
#include "cogl-pango/cogl-pango.h"
#include "clutter/clutter-backend.h" #include "clutter/clutter-backend.h"
#include "clutter/clutter-context.h" #include "clutter/clutter-context.h"
#include "clutter/clutter-effect.h" #include "clutter/clutter-effect.h"

View File

@ -56,7 +56,7 @@
#include "clutter/clutter-keysyms.h" #include "clutter/clutter-keysyms.h"
#include "clutter/clutter-main.h" #include "clutter/clutter-main.h"
#include "clutter/clutter-marshal.h" #include "clutter/clutter-marshal.h"
#include "clutter/clutter-private.h" /* includes <cogl-pango/cogl-pango.h> */ #include "clutter/clutter-private.h"
#include "clutter/clutter-property-transition.h" #include "clutter/clutter-property-transition.h"
#include "clutter/clutter-text-buffer.h" #include "clutter/clutter-text-buffer.h"
#include "clutter/clutter-paint-volume-private.h" #include "clutter/clutter-paint-volume-private.h"
@ -1073,7 +1073,7 @@ clutter_text_create_layout (ClutterText *text,
oldest_cache->layout = oldest_cache->layout =
clutter_text_create_layout_no_cache (text, width, height, ellipsize); 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 */ /* Mark the 'time' this cache was created and advance the time */
oldest_cache->age = priv->cache_age++; oldest_cache->age = priv->cache_age++;
@ -2030,9 +2030,9 @@ paint_selection_rectangle (ClutterText *self,
color->blue / 255.0f, color->blue / 255.0f,
paint_opacity / 255.0f * color->alpha / 255.0f); paint_opacity / 255.0f * color->alpha / 255.0f);
cogl_pango_show_layout (fb, layout, priv->text_x, 0, &cogl_color, clutter_show_layout (fb, layout, priv->text_x, 0, &cogl_color,
setup_pango_pipeline, setup_pango_pipeline,
&pango_pipeline_data); &pango_pipeline_data);
cogl_framebuffer_pop_clip (fb); cogl_framebuffer_pop_clip (fb);
g_object_unref (color_pipeline); g_object_unref (color_pipeline);
@ -2863,9 +2863,9 @@ clutter_text_paint (ClutterActor *self,
.color_state = color_state, .color_state = color_state,
.target_color_state = target_color_state, .target_color_state = target_color_state,
}; };
cogl_pango_show_layout (fb, layout, priv->text_x, priv->text_y, &color, clutter_show_layout (fb, layout, priv->text_x, priv->text_y, &color,
setup_pango_pipeline, setup_pango_pipeline,
&pango_pipeline_data); &pango_pipeline_data);
selection_paint (text, fb, paint_context); selection_paint (text, fb, paint_context);

View File

@ -84,6 +84,10 @@ clutter_headers = [
] ]
clutter_sources = [ 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-accessibility.c',
'clutter-action.c', 'clutter-action.c',
'clutter-actor-box.c', 'clutter-actor-box.c',
@ -177,6 +181,10 @@ clutter_sources = [
] ]
clutter_private_headers = [ 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-accessibility-private.h',
'clutter-actor-meta-private.h', 'clutter-actor-meta-private.h',
'clutter-actor-private.h', 'clutter-actor-private.h',
@ -262,7 +270,6 @@ libmutter_clutter = shared_library(libmutter_clutter_name,
gnu_symbol_visibility: 'hidden', gnu_symbol_visibility: 'hidden',
link_with: [ link_with: [
libmutter_cogl, libmutter_cogl,
libmutter_cogl_pango,
], ],
install_rpath: pkglibdir, install_rpath: pkglibdir,
install_dir: pkglibdir, install_dir: pkglibdir,
@ -294,12 +301,12 @@ if have_introspection
includes: [ includes: [
libmutter_mtk_gir[0], libmutter_mtk_gir[0],
libmutter_cogl_gir[0], libmutter_cogl_gir[0],
libmutter_cogl_pango_gir[0],
'GL-1.0', 'GL-1.0',
'Gio-2.0', 'Gio-2.0',
'GObject-2.0', 'GObject-2.0',
'cairo-1.0', 'cairo-1.0',
'Atk-1.0', 'Atk-1.0',
'Pango-1.0',
], ],
dependencies: [cogl_deps], dependencies: [cogl_deps],
extra_args: clutter_introspection_args + ['--c-include=clutter/clutter.h'], extra_args: clutter_introspection_args + ['--c-include=clutter/clutter.h'],

View File

@ -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. * Copyright (C) 2009 Intel Corporation.
* *
@ -31,8 +31,8 @@
#include <glib.h> #include <glib.h>
#include <string.h> #include <string.h>
#include "cogl-pango/cogl-pango-display-list.h" #include "clutter/pango/cogl-pango-display-list.h"
#include "cogl-pango/cogl-pango-pipeline-cache.h" #include "clutter/pango/cogl-pango-pipeline-cache.h"
#include "cogl/cogl.h" #include "cogl/cogl.h"
typedef enum typedef enum
@ -393,7 +393,7 @@ _cogl_framebuffer_draw_display_list_texture (CoglFramebuffer *fb,
void void
cogl_pango_display_list_render (CoglFramebuffer *fb, cogl_pango_display_list_render (CoglFramebuffer *fb,
CoglPangoDisplayList *dl, CoglPangoDisplayList *dl,
CoglPangoPipelineSetup pipeline_setup, ClutterPipelineSetup pipeline_setup,
gpointer pipeline_setup_user_data, gpointer pipeline_setup_user_data,
const CoglColor *color) const CoglColor *color)
{ {

View File

@ -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. * Copyright (C) 2009 Intel Corporation.
* *
@ -30,9 +30,9 @@
#include <glib.h> #include <glib.h>
#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 G_BEGIN_DECLS
@ -73,7 +73,7 @@ _cogl_pango_display_list_add_trapezoid (CoglPangoDisplayList *dl,
void void
cogl_pango_display_list_render (CoglFramebuffer *framebuffer, cogl_pango_display_list_render (CoglFramebuffer *framebuffer,
CoglPangoDisplayList *dl, CoglPangoDisplayList *dl,
CoglPangoPipelineSetup pipeline_setup, ClutterPipelineSetup pipeline_setup,
gpointer pipeline_setup_user_data, gpointer pipeline_setup_user_data,
const CoglColor *color); const CoglColor *color);

View File

@ -32,8 +32,7 @@
#include <pango/pangocairo.h> #include <pango/pangocairo.h>
#include <pango/pango-renderer.h> #include <pango/pango-renderer.h>
#include "cogl-pango/cogl-pango.h" #include "clutter/pango/cogl-pango-private.h"
#include "cogl-pango/cogl-pango-private.h"
#include "cogl/cogl.h" #include "cogl/cogl.h"
static GQuark cogl_pango_font_map_get_priv_key (void) G_GNUC_CONST; static GQuark cogl_pango_font_map_get_priv_key (void) G_GNUC_CONST;

View File

@ -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) 2008 OpenedHand
* *
@ -30,8 +30,9 @@
#include <glib.h> #include <glib.h>
#include "cogl-pango/cogl-pango-glyph-cache.h" #include "clutter/clutter-debug.h"
#include "cogl-pango/cogl-pango-private.h" #include "clutter/pango/cogl-pango-glyph-cache.h"
#include "clutter/pango/cogl-pango-private.h"
typedef struct _CoglPangoGlyphCacheKey CoglPangoGlyphCacheKey; typedef struct _CoglPangoGlyphCacheKey CoglPangoGlyphCacheKey;
@ -276,7 +277,7 @@ cogl_pango_glyph_cache_add_to_local_atlas (CoglPangoGlyphCache *cache,
COGL_ATLAS_CLEAR_TEXTURE | COGL_ATLAS_CLEAR_TEXTURE |
COGL_ATLAS_DISABLE_MIGRATION, COGL_ATLAS_DISABLE_MIGRATION,
cogl_pango_glyph_cache_update_position_cb); 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 /* If we still can't reserve space then something has gone
seriously wrong so we'll just give up */ seriously wrong so we'll just give up */
if (!cogl_atlas_reserve_space (atlas, if (!cogl_atlas_reserve_space (atlas,

View File

@ -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) 2008 OpenedHand
* *
@ -66,14 +66,14 @@ typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font,
PangoGlyph glyph, PangoGlyph glyph,
CoglPangoGlyphCacheValue *value); CoglPangoGlyphCacheValue *value);
COGL_EXPORT CoglPangoGlyphCache * CoglPangoGlyphCache *
cogl_pango_glyph_cache_new (CoglContext *ctx, cogl_pango_glyph_cache_new (CoglContext *ctx,
gboolean use_mipmapping); gboolean use_mipmapping);
COGL_EXPORT void void
cogl_pango_glyph_cache_free (CoglPangoGlyphCache *cache); cogl_pango_glyph_cache_free (CoglPangoGlyphCache *cache);
COGL_EXPORT CoglPangoGlyphCacheValue * CoglPangoGlyphCacheValue *
cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache, cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
CoglContext *context, CoglContext *context,
gboolean create, gboolean create,

View File

@ -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. * Copyright (C) 2011 Intel Corporation.
* *
@ -35,7 +35,7 @@
#include <glib.h> #include <glib.h>
#include "cogl-pango/cogl-pango-pipeline-cache.h" #include "clutter/pango/cogl-pango-pipeline-cache.h"
typedef struct _CoglPangoPipelineCacheEntry CoglPangoPipelineCacheEntry; typedef struct _CoglPangoPipelineCacheEntry CoglPangoPipelineCacheEntry;

View File

@ -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. * Copyright (C) 2011 Intel Corporation.
* *

View File

@ -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) 2008 OpenedHand
* Copyright (C) 2012 Intel Corporation. * Copyright (C) 2012 Intel Corporation.
@ -35,13 +35,17 @@
#pragma once #pragma once
#include "cogl-pango/cogl-pango.h" #include <pango/pango.h>
#include "cogl/cogl.h"
G_BEGIN_DECLS G_BEGIN_DECLS
PangoRenderer * PangoRenderer *
_cogl_pango_renderer_new (CoglContext *context); _cogl_pango_renderer_new (CoglContext *context);
PangoFontMap *
cogl_pango_font_map_new (CoglContext *context);
/** /**
* cogl_pango_font_map_get_renderer: * cogl_pango_font_map_get_renderer:

View File

@ -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) 2008 OpenedHand
* Copyright (C) 2012 Intel Corporation. * Copyright (C) 2012 Intel Corporation.
@ -41,9 +41,10 @@
#include <cairo.h> #include <cairo.h>
#include <cairo-ft.h> #include <cairo-ft.h>
#include "cogl-pango/cogl-pango-private.h" #include "clutter/clutter-debug.h"
#include "cogl-pango/cogl-pango-glyph-cache.h" #include "clutter/pango/cogl-pango-private.h"
#include "cogl-pango/cogl-pango-display-list.h" #include "clutter/pango/cogl-pango-glyph-cache.h"
#include "clutter/pango/cogl-pango-display-list.h"
#include "cogl/cogl.h" #include "cogl/cogl.h"
#define PANGO_UNKNOWN_GLYPH_WIDTH 10 #define PANGO_UNKNOWN_GLYPH_WIDTH 10
@ -301,13 +302,13 @@ cogl_pango_render_qdata_destroy (CoglPangoLayoutQdata *qdata)
} }
void void
cogl_pango_show_layout (CoglFramebuffer *fb, clutter_show_layout (CoglFramebuffer *fb,
PangoLayout *layout, PangoLayout *layout,
float x, float x,
float y, float y,
const CoglColor *color, const CoglColor *color,
CoglPangoPipelineSetup pipeline_setup, ClutterPipelineSetup pipeline_setup,
gpointer pipeline_setup_userdata) gpointer pipeline_setup_userdata)
{ {
PangoContext *context; PangoContext *context;
CoglPangoRenderer *priv; CoglPangoRenderer *priv;
@ -347,7 +348,7 @@ cogl_pango_show_layout (CoglFramebuffer *fb,
&priv->mipmap_caches : &priv->mipmap_caches :
&priv->no_mipmap_caches; &priv->no_mipmap_caches;
cogl_pango_ensure_glyph_cache_for_layout (layout); clutter_ensure_glyph_cache_for_layout (layout);
qdata->display_list = qdata->display_list =
_cogl_pango_display_list_new (caches->pipeline_cache); _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; cairo_format_t format_cairo;
CoglPixelFormat format_cogl; 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 /* 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 texture. These should never become dirty so they shouldn't end up
@ -546,7 +547,7 @@ _cogl_pango_set_dirty_glyphs (CoglPangoRenderer *priv)
} }
void void
cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout) clutter_ensure_glyph_cache_for_layout (PangoLayout *layout)
{ {
PangoContext *context; PangoContext *context;
CoglPangoRenderer *priv; CoglPangoRenderer *priv;
@ -750,7 +751,7 @@ cogl_pango_renderer_draw_glyphs (PangoRenderer *renderer,
font, font,
gi->glyph); 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 called before rendering a layout so we should never have
a dirty glyph here */ a dirty glyph here */
g_assert (cache_value == NULL || !cache_value->dirty); g_assert (cache_value == NULL || !cache_value->dirty);

View File

@ -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 <neil@linux.intel.com>
* Robert Bragg <robert@linux.intel.com>
* Matthew Allum <mallum@openedhand.com>
*/
#pragma once
#include <glib-object.h>
#include <pango/pango.h>
#include <pango/pangocairo.h>
#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

View File

@ -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,
)

View File

@ -92,4 +92,3 @@ cogl_debug_c_args = cc.get_supported_arguments(cogl_debug_c_args)
cogl_c_args += cogl_debug_c_args cogl_c_args += cogl_debug_c_args
subdir('cogl') subdir('cogl')
subdir('cogl-pango')

View File

@ -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 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 ^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 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
``` ```

View File

@ -16,7 +16,6 @@ custom_target('clutter-doc',
gidocgen_common_args, gidocgen_common_args,
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../mtk/mtk'), '--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'),
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../cogl/cogl-pango'),
'--config=@INPUT0@', '--config=@INPUT0@',
'--output-dir=@OUTPUT@', '--output-dir=@OUTPUT@',
'--content-dir=@0@'.format(meson.current_source_dir()), '--content-dir=@0@'.format(meson.current_source_dir()),
@ -24,7 +23,6 @@ custom_target('clutter-doc',
], ],
depends: [ depends: [
libmutter_mtk_gir[0], libmutter_mtk_gir[0],
libmutter_cogl_pango_gir[0],
libmutter_cogl_gir[0], libmutter_cogl_gir[0],
], ],
build_by_default: true, build_by_default: true,

View File

@ -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"

View File

@ -1 +0,0 @@
../../../logo.svg

View File

@ -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,
)

View File

@ -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/' ],
]

View File

@ -22,6 +22,5 @@ docs_dir = pkgdatadir / 'doc'
subdir('clutter') subdir('clutter')
subdir('cogl') subdir('cogl')
subdir('cogl-pango')
subdir('meta') subdir('meta')
subdir('mtk') subdir('mtk')

View File

@ -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() / '../../../mtk/mtk'),
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../clutter/clutter'), '--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'),
'--add-include-path=@0@'.format(meson.current_build_dir() / '../../../cogl/cogl-pango'),
'--config=@INPUT0@', '--config=@INPUT0@',
'--output-dir=@OUTPUT@', '--output-dir=@OUTPUT@',
'--content-dir=@0@'.format(meson.current_source_dir()), '--content-dir=@0@'.format(meson.current_source_dir()),
@ -26,7 +25,6 @@ custom_target('meta-doc',
depends: [ depends: [
libmutter_mtk_gir[0], libmutter_mtk_gir[0],
libmutter_clutter_gir[0], libmutter_clutter_gir[0],
libmutter_cogl_pango_gir[0],
libmutter_cogl_gir[0], libmutter_cogl_gir[0],
], ],
build_by_default: true, build_by_default: true,

View File

@ -114,11 +114,6 @@
importing and drawing textures, internally using OpenGL.</p> importing and drawing textures, internally using OpenGL.</p>
</a></li> </a></li>
<li><a href="https://mutter.gnome.org/cogl-pango/">
<h3>CoglPango</h3>
<p>A Low Level GPU Graphics and Utilities API.</p>
</a></li>
<li><a href="https://mutter.gnome.org/mtk/"> <li><a href="https://mutter.gnome.org/mtk/">
<h3>Mtk</h3> <h3>Mtk</h3>
<p>The Meta Toolkit containing utilities shared by other parts of mutter.</p> <p>The Meta Toolkit containing utilities shared by other parts of mutter.</p>

View File

@ -1306,7 +1306,6 @@ if have_introspection
'GObject-2.0', 'GObject-2.0',
'GDesktopEnums-3.0', 'GDesktopEnums-3.0',
libmutter_cogl_gir[0], libmutter_cogl_gir[0],
libmutter_cogl_pango_gir[0],
libmutter_clutter_gir[0], libmutter_clutter_gir[0],
libmutter_mtk_gir[0], libmutter_mtk_gir[0],
] ]

View File

@ -30,7 +30,7 @@ create_pipeline (CoglTexture **tex_out,
0, /* layer */ 0, /* layer */
COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE); 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, cogl_pipeline_set_layer_combine (pipeline,
0, /* layer */ 0, /* layer */
"RGBA = MODULATE (PREVIOUS, TEXTURE[A])", "RGBA = MODULATE (PREVIOUS, TEXTURE[A])",

View File

@ -95,7 +95,6 @@ if have_introspection
'xfixes-4.0', 'xfixes-4.0',
libmutter_mtk_gir[0], libmutter_mtk_gir[0],
libmutter_cogl_gir[0], libmutter_cogl_gir[0],
libmutter_cogl_pango_gir[0],
libmutter_clutter_gir[0], libmutter_clutter_gir[0],
libmutter_gir[0], libmutter_gir[0],
], ],