summaryrefslogtreecommitdiff
path: root/glamor/glamor_priv.h
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2014-09-10 16:20:48 +0900
committerKeith Packard <keithp@keithp.com>2014-09-11 18:31:11 -0700
commit1d32004ed5a3a20b2d5879867e213122dced69d0 (patch)
tree940063272c2abbbda6ed205f3b041d5483459333 /glamor/glamor_priv.h
parent710d314ad16cf1eaca3b97b1736ff0ca43e598c4 (diff)
glamor: Make glyph mask cache per-screen
It references a pixmap, which is a per-screen resource. Fixes broken text rendering in xfwm4-tweak-settings in Zaphod mode. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'glamor/glamor_priv.h')
-rw-r--r--glamor/glamor_priv.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index 6ebb7b392..aa59e3bcd 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -167,6 +167,30 @@ typedef struct {
uint16_t evict;
} glamor_glyph_cache_t;
+#define CACHE_PICTURE_SIZE 1024
+#define GLYPH_MIN_SIZE 8
+#define GLYPH_MAX_SIZE 64
+#define GLYPH_CACHE_SIZE ((CACHE_PICTURE_SIZE) * CACHE_PICTURE_SIZE / (GLYPH_MIN_SIZE * GLYPH_MIN_SIZE))
+
+#define MASK_CACHE_MAX_SIZE 32
+#define MASK_CACHE_WIDTH (CACHE_PICTURE_SIZE / MASK_CACHE_MAX_SIZE)
+#define MASK_CACHE_MASK ((1LL << (MASK_CACHE_WIDTH)) - 1)
+
+struct glamor_glyph_mask_cache_entry {
+ int idx;
+ int width;
+ int height;
+ int x;
+ int y;
+};
+
+typedef struct {
+ PixmapPtr pixmap;
+ struct glamor_glyph_mask_cache_entry mcache[MASK_CACHE_WIDTH];
+ unsigned int free_bitmap;
+ unsigned int cleared_bitmap;
+} glamor_glyph_mask_cache_t;
+
struct glamor_saved_procs {
CloseScreenProcPtr close_screen;
CreateScreenResourcesProcPtr create_screen_resources;
@@ -268,6 +292,7 @@ typedef struct glamor_screen_private {
[SHADER_MASK_COUNT]
[SHADER_IN_COUNT];
glamor_glyph_cache_t glyphCaches[GLAMOR_NUM_GLYPH_CACHE_FORMATS];
+ glamor_glyph_mask_cache_t *mask_cache[GLAMOR_NUM_GLYPH_CACHE_FORMATS];
Bool glyph_caches_realized;
/* shaders to restore a texture to another texture. */