[gtk+] Cosmetic changes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Cosmetic changes
- Date: Mon, 11 Sep 2017 15:23:38 +0000 (UTC)
commit 40031930b25e002294ee7f2afbd55de7e61cba93
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Sep 11 11:22:59 2017 -0400
Cosmetic changes
Make sure the cache size does not get out of sync with the
actual surface size.
gsk/gskvulkanrenderer.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gsk/gskvulkanrenderer.c b/gsk/gskvulkanrenderer.c
index 109f487..558299a 100644
--- a/gsk/gskvulkanrenderer.c
+++ b/gsk/gskvulkanrenderer.c
@@ -490,14 +490,14 @@ add_to_cache (GlyphCache *cache,
pango_font_get_glyph_extents (font, glyph, &ink_rect, NULL);
pango_extents_to_pixels (&ink_rect, NULL);
- if (cache->x + ink_rect.width >= cache->width)
+ if (cache->x + ink_rect.width + 1 >= cache->width)
{
/* start a new row */
cache->y0 = cache->y + 1;
cache->x = 1;
}
- if (cache->y0 + ink_rect.height >= cache->height)
+ if (cache->y0 + ink_rect.height + 1 >= cache->height)
{
g_critical ("Drats! Out of cache space. We should really handle this");
return;
@@ -619,9 +619,9 @@ create_glyph_cache (void)
cache = g_new0 (GlyphCache, 1);
cache->fonts = g_hash_table_new_full (font_hash, font_equal, NULL, font_entry_free);
- cache->surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1024, 1024);
cache->width = 1024;
cache->height = 1024;
+ cache->surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, cache->width, cache->height);
cache->y0 = 1;
cache->y = 1;
cache->x = 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]