if (glyph != NULL)
{
- Glyph_Draw(context, glyph, glyph->x + *x, glyph->y + *y);
+ glyph->Draw(context, glyph, glyph->x + *x, glyph->y + *y);
if (flAccel & SO_CHAR_INC_EQUAL_BM_BASE)
*x += glyph->cx;
BYTE* fragments;
rdpGraphics* graphics;
rdpGlyphCache* glyph_cache;
+ rdpGlyph* glyph;
graphics = context->graphics;
glyph_cache = context->cache->glyph;
+ glyph = graphics->Glyph_Prototype;
if (opX + opWidth > context->settings->DesktopWidth)
{
if (opWidth > 0 && opHeight > 0)
{
- if (!Glyph_BeginDraw(context, opX, opY, opWidth, opHeight, bgcolor, fgcolor,
- fOpRedundant))
+ if (!glyph->BeginDraw(context, opX, opY, opWidth, opHeight, bgcolor, fgcolor,
+ fOpRedundant))
return FALSE;
}
else
{
if (fOpRedundant)
{
- if (!Glyph_BeginDraw(context, bkX, bkY, bkWidth, bkHeight, bgcolor, fgcolor,
- fOpRedundant))
+ if (!glyph->BeginDraw(context, bkX, bkY, bkWidth, bkHeight, bgcolor, fgcolor,
+ fOpRedundant))
return FALSE;
}
else
{
- if (!Glyph_BeginDraw(context, 0, 0, 0, 0, bgcolor, fgcolor, fOpRedundant))
+ if (!glyph->BeginDraw(context, 0, 0, 0, 0, bgcolor, fgcolor, fOpRedundant))
return FALSE;
}
}
}
if (opWidth > 0 && opHeight > 0)
- return Glyph_EndDraw(context, opX, opY, opWidth, opHeight, bgcolor, fgcolor);
+ return glyph->EndDraw(context, opX, opY, opWidth, opHeight, bgcolor, fgcolor);
- return Glyph_EndDraw(context, bkX, bkY, bkWidth, bkHeight, bgcolor, fgcolor);
+ return glyph->EndDraw(context, bkX, bkY, bkWidth, bkHeight, bgcolor, fgcolor);
}
static BOOL update_gdi_glyph_index(rdpContext* context,
CopyMemory(glyph->aj, glyphData->aj, glyph->cb);
- if (!Glyph_New(context, glyph))
+ if (!glyph->New(context, glyph))
goto error_glyph_new;
glyph_cache_put(cache->glyph, fastGlyph->cacheId, fastGlyph->data[0], glyph);
opRight - opLeft, opBottom - opTop,
FALSE);
error_glyph_new:
- free(glyph->aj);
- glyph->aj = NULL;
error_aj:
- Glyph_Free(context, glyph);
+ IFCALL(glyph->Free, context, glyph);
return FALSE;
}
glyph->cb = glyph_data->cb;
glyph->aj = glyph_data->aj;
- if (!Glyph_New(context, glyph))
+ if (!glyph->New(context, glyph))
{
- Glyph_Free(context, glyph);
+ glyph->Free(context, glyph);
return FALSE;
}
glyph->cb = glyphData->cb;
glyph->aj = glyphData->aj;
- if (!Glyph_New(context, glyph))
+ if (!glyph->New(context, glyph))
{
- Glyph_Free(context, glyph);
+ glyph->Free(context, glyph);
return FALSE;
}
prevGlyph = glyphCache->glyphCache[id].entries[index];
if (prevGlyph)
- {
- Glyph_Free(glyphCache->context, prevGlyph);
- free(prevGlyph->aj);
- free(prevGlyph);
- }
+ glyph->Free(glyphCache->context, prevGlyph);
glyphCache->glyphCache[id].entries[index] = glyph;
return TRUE;
if (glyph)
{
- Glyph_Free(glyphCache->context, glyph);
- free(glyph->aj);
- free(glyph);
+ glyph->Free(glyphCache->context, glyph);
glyphCache->glyphCache[i].entries[j] = NULL;
}
}
return glyph;
}
-BOOL Glyph_New(rdpContext* context, rdpGlyph* glyph)
-{
- return context->graphics->Glyph_Prototype->New(context, glyph);
-}
-
-void Glyph_Free(rdpContext* context, rdpGlyph* glyph)
-{
- context->graphics->Glyph_Prototype->Free(context, glyph);
-}
-
-BOOL Glyph_Draw(rdpContext* context, rdpGlyph* glyph, int x, int y)
-{
- return context->graphics->Glyph_Prototype->Draw(context, glyph, x, y);
-}
-
-BOOL Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int height,
- UINT32 bgcolor, UINT32 fgcolor, BOOL fOpRedundant)
-{
- return context->graphics->Glyph_Prototype->BeginDraw(context, x, y, width,
- height, bgcolor, fgcolor, fOpRedundant);
-}
-
-BOOL Glyph_EndDraw(rdpContext* context, int x, int y, int width, int height,
- UINT32 bgcolor, UINT32 fgcolor)
-{
- return context->graphics->Glyph_Prototype->EndDraw(context, x, y, width, height,
- bgcolor, fgcolor);
-}
-
void graphics_register_glyph(rdpGraphics* graphics, rdpGlyph* glyph)
{
CopyMemory(graphics->Glyph_Prototype, glyph, sizeof(rdpGlyph));
}
graphics->Glyph_Prototype->size = sizeof(rdpGlyph);
- graphics->Glyph_Prototype->New = Glyph_New;
- graphics->Glyph_Prototype->Free = Glyph_Free;
}
return graphics;