summaryrefslogtreecommitdiff
path: root/src/lib/evas/cserve2/evas_cs2_client.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-01-13 05:13:00 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-01-13 05:15:32 +0900
commit86a97efeea946a760ed1fd0fb3ca4cc57bc81d3d (patch)
tree5b31f95b12083b653c7c8fa90c58c1b5c8d76f15 /src/lib/evas/cserve2/evas_cs2_client.c
parentf21b0ee6c383b9de2723d68a5a51f071624cd29d (diff)
evas - fonts - move to using 4bit and rel 4 bit compressed font glyphs
this changes the internal encoding of font glyphs in evas to use 4bit uncompressed if small, or 4bit rle (run length encoded) if larger. this caves at least 50% of memory on fonts - and more if bigger. with large fonts (40-80pixel size) we can save in the region of 80% of memory used for glyphs. this also happesn to allow speedups in rendering too.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/cserve2/evas_cs2_client.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/lib/evas/cserve2/evas_cs2_client.c b/src/lib/evas/cserve2/evas_cs2_client.c
index ed25b0f580..15328f5c40 100644
--- a/src/lib/evas/cserve2/evas_cs2_client.c
+++ b/src/lib/evas/cserve2/evas_cs2_client.c
@@ -1952,10 +1952,11 @@ _font_entry_glyph_map_rebuild_check(Font_Entry *fe, Font_Hint_Flags hints)
1952 gl->base.bitmap.rows = gd->rows; 1952 gl->base.bitmap.rows = gd->rows;
1953 gl->base.bitmap.width = gd->width; 1953 gl->base.bitmap.width = gd->width;
1954 gl->base.bitmap.pitch = gd->pitch; 1954 gl->base.bitmap.pitch = gd->pitch;
1955 gl->base.bitmap.buffer = (unsigned char *) 1955 gl->base.bitmap.buffer = NULL;
1956 fe->map->mempool.data + gl->offset; 1956 gl->base.rle = (unsigned char *)
1957 gl->base.bitmap.num_grays = gd->num_grays; 1957 fe->map->mempool.data + gl->offset;
1958 gl->base.bitmap.pixel_mode = gd->pixel_mode; 1958 gl->base.rle_size = gl->size;
1959 gl->base.bitmap.rle_alloc = EINA_FALSE;
1959 gl->idx = gd->index; 1960 gl->idx = gd->index;
1960 gl->rid = 0; 1961 gl->rid = 0;
1961 1962
@@ -2062,7 +2063,7 @@ _glyph_request_cb(void *data, const void *msg, int size)
2062 { 2063 {
2063 string_t shm_id; 2064 string_t shm_id;
2064 unsigned int idx, offset, glsize, hints; 2065 unsigned int idx, offset, glsize, hints;
2065 int rows, width, pitch, num_grays, pixel_mode; 2066 int rows, width, pitch;
2066 CS_Glyph_Out *gl; 2067 CS_Glyph_Out *gl;
2067 2068
2068 pos = buf - (const char*) resp; 2069 pos = buf - (const char*) resp;
@@ -2083,10 +2084,6 @@ _glyph_request_cb(void *data, const void *msg, int size)
2083 buf += sizeof(int); 2084 buf += sizeof(int);
2084 memcpy(&pitch, buf, sizeof(int)); 2085 memcpy(&pitch, buf, sizeof(int));
2085 buf += sizeof(int); 2086 buf += sizeof(int);
2086 memcpy(&num_grays, buf, sizeof(int));
2087 buf += sizeof(int);
2088 memcpy(&pixel_mode, buf, sizeof(int));
2089 buf += sizeof(int);
2090 memcpy(&hints, buf, sizeof(int)); 2087 memcpy(&hints, buf, sizeof(int));
2091 buf += sizeof(int); 2088 buf += sizeof(int);
2092 if (hints != grd->hints) 2089 if (hints != grd->hints)
@@ -2112,10 +2109,12 @@ _glyph_request_cb(void *data, const void *msg, int size)
2112 gl->base.bitmap.rows = rows; 2109 gl->base.bitmap.rows = rows;
2113 gl->base.bitmap.width = width; 2110 gl->base.bitmap.width = width;
2114 gl->base.bitmap.pitch = pitch; 2111 gl->base.bitmap.pitch = pitch;
2115 gl->base.bitmap.buffer = 2112 gl->base.bitmap.buffer = NULL;
2113 gl->base.bitmap.rle_alloc = 0;
2114 gl->base.bitmap.no_free_glout = 1;
2115 gl->base.rle =
2116 (unsigned char *) gl->map->mempool.data + gl->offset; 2116 (unsigned char *) gl->map->mempool.data + gl->offset;
2117 gl->base.bitmap.num_grays = num_grays; 2117 gl->base.rle_size = gl->size;
2118 gl->base.bitmap.pixel_mode = pixel_mode;
2119 gl->rid = 0; 2118 gl->rid = 0;
2120 2119
2121 if (!eina_clist_element_is_linked(&gl->map_entry)) 2120 if (!eina_clist_element_is_linked(&gl->map_entry))