summaryrefslogtreecommitdiff
path: root/src/cairo-directfb-surface.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-10-20 18:59:03 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-20 23:20:23 +0100
commitebe3048f9b74ff949795a807a7076ec756150ede (patch)
treeab176bfa2dac9c1bcdef32c0310419098cae4d1f /src/cairo-directfb-surface.c
parent6f35c2d13e4cb736634bf446d3b8ee38cc6a6b9b (diff)
[directfb] Cap the maximum surface size to use for the font cache.
Fallback if we need to create a cache larger than the maximum usable surface.
Diffstat (limited to 'src/cairo-directfb-surface.c')
-rw-r--r--src/cairo-directfb-surface.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cairo-directfb-surface.c b/src/cairo-directfb-surface.c
index 44e1a03a..cd2ce142 100644
--- a/src/cairo-directfb-surface.c
+++ b/src/cairo-directfb-surface.c
@@ -1382,7 +1382,7 @@ _directfb_acquire_font_cache (cairo_directfb_surface_t *surface,
cairo_directfb_font_cache_t **ret_cache,
DFBRectangle *rects,
DFBPoint *points,
- int *ret_num )
+ int *ret_num)
{
cairo_status_t status;
cairo_scaled_glyph_t *chars[num_glyphs];
@@ -1442,8 +1442,6 @@ _directfb_acquire_font_cache (cairo_directfb_surface_t *surface,
points[n].x+img->width <= 0 ||
points[n].y+img->height <= 0)
{
- D_DEBUG_AT (CairoDFB_Font,
- " -> Unsupported font format %d!\n", img->format);
continue;
}
@@ -1496,6 +1494,12 @@ _directfb_acquire_font_cache (cairo_directfb_surface_t *surface,
w = MAX (w, 8);
h = MAX (h, 8);
+ /* XXX query maximum surface size */
+ if (w > 2048 || h > 2048) {
+ _cairo_cache_thaw (scaled_font->glyphs);
+ return CAIRO_INT_STATUS_UNSUPPORTED;
+ }
+
if (cache) {
if (cache->width < w || cache->height < h) {
cairo_directfb_font_cache_t *new_cache;