#define NUM_FONT_COLORS 4
#define NUM_FONT_CHARS (FONT_LINES_PER_FONT * FONT_CHARS_PER_LINE)
+#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
static GC tile_clip_gc = None;
static Pixmap tile_clipmask[NUM_FONTS][NUM_FONT_COLORS][NUM_FONT_CHARS];
static void InitFontClipmasks()
{
-#if defined(TARGET_X11_NATIVE)
static boolean clipmasks_initialized = FALSE;
boolean fonts_initialized = TRUE;
XGCValues clip_gc_values;
XFreeGC(display, copy_clipmask_gc);
clipmasks_initialized = TRUE;
-
-#endif /* TARGET_X11_NATIVE */
}
+#endif /* TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND */
void InitFontInfo(Bitmap *bitmap_initial,
Bitmap *bitmap_big, Bitmap *bitmap_medium,
font.bitmap_small = bitmap_small;
font.bitmap_tile = bitmap_tile;
+#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
InitFontClipmasks();
+#endif
}
int getFontWidth(int font_size, int font_type)
else if (mask_mode == FONT_MASKED)
{
/* clear font character background */
- BlitBitmap(gfx.background_bitmap, bitmap,
- dest_x - gfx.real_sx, dest_y - gfx.real_sy,
- font_width, font_height, dest_x, dest_y);
+ ClearRectangleOnBackground(bitmap, dest_x, dest_y,
+ font_width, font_height);
+#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
/* use special font tile clipmasks, if available */
if (font_size == FS_BIG || font_size == FS_MEDIUM)
{
SetClipOrigin(font_bitmap, font_bitmap->stored_clip_gc,
dest_x - src_x, dest_y - src_y);
}
+#else
+ SetClipOrigin(font_bitmap, font_bitmap->stored_clip_gc,
+ dest_x - src_x, dest_y - src_y);
+#endif
BlitBitmapMasked(font_bitmap, bitmap, src_x, src_y,
font_width, font_height, dest_x, dest_y);