summaryrefslogtreecommitdiff
path: root/src/cairo-scaled-font-private.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-07-30 17:28:21 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-09-12 08:29:48 +0100
commitaf9fbd176b145f042408ef5391eef2a51d7531f8 (patch)
tree5f75d1087d4325a013af6f0a4204a666fb4ca4f0 /src/cairo-scaled-font-private.h
parent0540bf384aed344899417d3b0313bd6704679c1c (diff)
downloadcairo-af9fbd176b145f042408ef5391eef2a51d7531f8.tar.gz
Introduce a new compositor architecture
Having spent the last dev cycle looking at how we could specialize the compositors for various backends, we once again look for the commonalities in order to reduce the duplication. In part this is motivated by the idea that spans is a good interface for both the existent GL backend and pixman, and so they deserve a dedicated compositor. xcb/xlib target an identical rendering system and so they should be using the same compositor, and it should be possible to run that same compositor locally against pixman to generate reference tests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> P.S. This brings massive upheaval (read breakage) I've tried delaying in order to fix as many things as possible but now this one patch does far, far, far too much. Apologies in advance for breaking your favourite backend, but trust me in that the end result will be much better. :)
Diffstat (limited to 'src/cairo-scaled-font-private.h')
-rw-r--r--src/cairo-scaled-font-private.h68
1 files changed, 60 insertions, 8 deletions
diff --git a/src/cairo-scaled-font-private.h b/src/cairo-scaled-font-private.h
index 029377b17..da7b34698 100644
--- a/src/cairo-scaled-font-private.h
+++ b/src/cairo-scaled-font-private.h
@@ -45,6 +45,8 @@
#include "cairo-mutex-type-private.h"
#include "cairo-reference-count-private.h"
+CAIRO_BEGIN_DECLS
+
typedef struct _cairo_scaled_glyph_page cairo_scaled_glyph_page_t;
struct _cairo_scaled_font {
@@ -112,20 +114,70 @@ struct _cairo_scaled_font {
cairo_bool_t cache_frozen;
cairo_bool_t global_cache_frozen;
- /*
- * One surface backend may store data in each glyph.
- * Whichever surface manages to store its pointer here
- * first gets to store data in each glyph
- */
- const cairo_surface_backend_t *surface_backend;
- void *surface_private;
+ cairo_list_t dev_privates;
/* font backend managing this scaled font */
const cairo_scaled_font_backend_t *backend;
cairo_list_t link;
};
+struct _cairo_scaled_font_private {
+ cairo_list_t link;
+ const void *key;
+ void (*destroy) (cairo_scaled_font_private_t *,
+ cairo_scaled_font_t *);
+};
+
+struct _cairo_scaled_glyph {
+ cairo_hash_entry_t hash_entry;
+
+ cairo_text_extents_t metrics; /* user-space metrics */
+ cairo_text_extents_t fs_metrics; /* font-space metrics */
+ cairo_box_t bbox; /* device-space bounds */
+ int16_t x_advance; /* device-space rounded X advance */
+ int16_t y_advance; /* device-space rounded Y advance */
+
+ unsigned int has_info;
+ cairo_image_surface_t *surface; /* device-space image */
+ cairo_path_fixed_t *path; /* device-space outline */
+ cairo_surface_t *recording_surface; /* device-space recording-surface */
+
+ const void *dev_private_key;
+ void *dev_private;
+ cairo_list_t dev_privates;
+};
+
+struct _cairo_scaled_glyph_private {
+ cairo_list_t link;
+ const void *key;
+ void (*destroy) (cairo_scaled_glyph_private_t *,
+ cairo_scaled_glyph_t *,
+ cairo_scaled_font_t *);
+};
+
+cairo_private cairo_scaled_font_private_t *
+_cairo_scaled_font_find_private (cairo_scaled_font_t *scaled_font,
+ const void *key);
+
+cairo_private void
+_cairo_scaled_font_attach_private (cairo_scaled_font_t *scaled_font,
+ cairo_scaled_font_private_t *priv,
+ const void *key,
+ void (*destroy) (cairo_scaled_font_private_t *,
+ cairo_scaled_font_t *));
+
+cairo_private cairo_scaled_glyph_private_t *
+_cairo_scaled_glyph_find_private (cairo_scaled_glyph_t *scaled_glyph,
+ const void *key);
+
cairo_private void
-_cairo_scaled_font_revoke_ownership (cairo_scaled_font_t *scaled_font);
+_cairo_scaled_glyph_attach_private (cairo_scaled_glyph_t *scaled_glyph,
+ cairo_scaled_glyph_private_t *priv,
+ const void *key,
+ void (*destroy) (cairo_scaled_glyph_private_t *,
+ cairo_scaled_glyph_t *,
+ cairo_scaled_font_t *));
+
+CAIRO_END_DECLS
#endif /* CAIRO_SCALED_FONT_PRIVATE_H */