- Deactivate unneeded debug prints, change DbgPrint to DPRINTx, remove unused performance checks, formatting - no functional changes

svn path=/trunk/; revision=40487
This commit is contained in:
Gregor Schneider 2009-04-13 17:51:50 +00:00
parent 864371fe84
commit 1ceab2328e
2 changed files with 12 additions and 41 deletions

View file

@ -971,7 +971,7 @@ GetGlyphOutlineA(
LPWSTR p = NULL; LPWSTR p = NULL;
DWORD ret; DWORD ret;
UINT c; UINT c;
DPRINT1("GetGlyphOutlineA uChar %x\n", uChar); DPRINT("GetGlyphOutlineA uChar %x\n", uChar);
if(!(uFormat & GGO_GLYPH_INDEX)) { if(!(uFormat & GGO_GLYPH_INDEX)) {
int len; int len;
char mbchs[2]; char mbchs[2];
@ -984,7 +984,7 @@ GetGlyphOutlineA(
mbchs[0] = (uChar & 0xff); mbchs[0] = (uChar & 0xff);
} }
p = FONT_mbtowc(hdc, mbchs, len, NULL, NULL); p = FONT_mbtowc(hdc, mbchs, len, NULL, NULL);
c = p[0]; c = p[0];
} else } else
c = uChar; c = uChar;
ret = NtGdiGetGlyphOutline(hdc, c, uFormat, lpgm, cbBuffer, lpvBuffer, (CONST LPMAT2)lpmat2, TRUE); ret = NtGdiGetGlyphOutline(hdc, c, uFormat, lpgm, cbBuffer, lpvBuffer, (CONST LPMAT2)lpmat2, TRUE);
@ -1008,7 +1008,7 @@ GetGlyphOutlineW(
CONST MAT2 *lpmat2 CONST MAT2 *lpmat2
) )
{ {
DPRINT("GetGlyphOutlineW uChar %x\n", uChar); DPRINT("GetGlyphOutlineW uChar %x\n", uChar);
if (!lpgm & !lpmat2) return GDI_ERROR; if (!lpgm & !lpmat2) return GDI_ERROR;
if (!lpvBuffer) cbBuffer = 0; if (!lpvBuffer) cbBuffer = 0;
return NtGdiGetGlyphOutline ( hdc, uChar, uFormat, lpgm, cbBuffer, lpvBuffer, (CONST LPMAT2)lpmat2, TRUE); return NtGdiGetGlyphOutline ( hdc, uChar, uFormat, lpgm, cbBuffer, lpvBuffer, (CONST LPMAT2)lpmat2, TRUE);

View file

@ -75,8 +75,6 @@ static FAST_MUTEX FontListLock;
static BOOL RenderingEnabled = TRUE; static BOOL RenderingEnabled = TRUE;
#define MAX_FONT_CACHE 256 #define MAX_FONT_CACHE 256
UINT Hits;
UINT Misses;
typedef struct _FONT_CACHE_ENTRY typedef struct _FONT_CACHE_ENTRY
{ {
@ -1322,8 +1320,6 @@ ftGdiGlyphCacheGet(
PLIST_ENTRY CurrentEntry; PLIST_ENTRY CurrentEntry;
PFONT_CACHE_ENTRY FontEntry; PFONT_CACHE_ENTRY FontEntry;
// DbgPrint("CacheGet\n");
CurrentEntry = FontCacheListHead.Flink; CurrentEntry = FontCacheListHead.Flink;
while (CurrentEntry != &FontCacheListHead) while (CurrentEntry != &FontCacheListHead)
{ {
@ -1337,29 +1333,11 @@ ftGdiGlyphCacheGet(
if (CurrentEntry == &FontCacheListHead) if (CurrentEntry == &FontCacheListHead)
{ {
// DbgPrint("Miss! %x\n", FontEntry->Glyph);
/*
Misses++;
if (Misses>100) {
DbgPrint ("Hits: %d Misses: %d\n", Hits, Misses);
Hits = Misses = 0;
}
*/
return NULL; return NULL;
} }
RemoveEntryList(CurrentEntry); RemoveEntryList(CurrentEntry);
InsertHeadList(&FontCacheListHead, CurrentEntry); InsertHeadList(&FontCacheListHead, CurrentEntry);
// DbgPrint("Hit! %x\n", FontEntry->Glyph);
/*
Hits++;
if (Hits>100) {
DbgPrint ("Hits: %d Misses: %d\n", Hits, Misses);
Hits = Misses = 0;
}
*/
return FontEntry->Glyph; return FontEntry->Glyph;
} }
@ -1375,25 +1353,23 @@ ftGdiGlyphCacheSet(
INT error; INT error;
PFONT_CACHE_ENTRY NewEntry; PFONT_CACHE_ENTRY NewEntry;
// DbgPrint("CacheSet.\n");
error = FT_Get_Glyph(GlyphSlot, &GlyphCopy); error = FT_Get_Glyph(GlyphSlot, &GlyphCopy);
if (error) if (error)
{ {
DbgPrint("Failure caching glyph.\n"); DPRINT1("Failure caching glyph.\n");
return NULL; return NULL;
}; };
error = FT_Glyph_To_Bitmap(&GlyphCopy, RenderMode, 0, 1); error = FT_Glyph_To_Bitmap(&GlyphCopy, RenderMode, 0, 1);
if (error) if (error)
{ {
DbgPrint("Failure rendering glyph.\n"); DPRINT1("Failure rendering glyph.\n");
return NULL; return NULL;
}; };
NewEntry = ExAllocatePoolWithTag(PagedPool, sizeof(FONT_CACHE_ENTRY), TAG_FONT); NewEntry = ExAllocatePoolWithTag(PagedPool, sizeof(FONT_CACHE_ENTRY), TAG_FONT);
if (!NewEntry) if (!NewEntry)
{ {
DbgPrint("Alloc failure caching glyph.\n"); DPRINT1("Alloc failure caching glyph.\n");
FT_Done_Glyph(GlyphCopy); FT_Done_Glyph(GlyphCopy);
return NULL; return NULL;
} }
@ -1413,8 +1389,6 @@ ftGdiGlyphCacheSet(
FontCacheNumEntries--; FontCacheNumEntries--;
} }
// DbgPrint("Returning the glyphcopy: %x\n", GlyphCopy);
return GlyphCopy; return GlyphCopy;
} }
@ -3457,8 +3431,6 @@ GreExtTextOutW(
goto fail; goto fail;
} }
} }
// DbgPrint("realglyph: %x\n", realglyph);
// DbgPrint("TextLeft: %d\n", TextLeft);
/* retrieve kerning distance and move pen position */ /* retrieve kerning distance and move pen position */
if (use_kerning && previous && glyph_index && NULL == Dx) if (use_kerning && previous && glyph_index && NULL == Dx)
@ -3467,12 +3439,12 @@ GreExtTextOutW(
FT_Get_Kerning(face, previous, glyph_index, 0, &delta); FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
TextLeft += delta.x; TextLeft += delta.x;
} }
// DPRINT1("TextLeft: %d\n", TextLeft); DPRINT("TextLeft: %d\n", TextLeft);
// DPRINT1("TextTop: %d\n", TextTop); DPRINT("TextTop: %d\n", TextTop);
if (realglyph->format == ft_glyph_format_outline) if (realglyph->format == ft_glyph_format_outline)
{ {
DbgPrint("Should already be done\n"); DPRINT1("Should already be done\n");
// error = FT_Render_Glyph(glyph, RenderMode); // error = FT_Render_Glyph(glyph, RenderMode);
error = FT_Glyph_To_Bitmap(&realglyph, RenderMode, 0, 0); error = FT_Glyph_To_Bitmap(&realglyph, RenderMode, 0, 0);
if (error) if (error)
@ -3483,8 +3455,7 @@ GreExtTextOutW(
} }
realglyph2 = (FT_BitmapGlyph)realglyph; realglyph2 = (FT_BitmapGlyph)realglyph;
// DPRINT1("Pitch: %d\n", pitch); DPRINT("Advance: %d\n", realglyph->advance.x);
// DPRINT1("Advance: %d\n", realglyph->advance.x);
if (fuOptions & ETO_OPAQUE) if (fuOptions & ETO_OPAQUE)
{ {
@ -3586,12 +3557,12 @@ GreExtTextOutW(
if (NULL == Dx) if (NULL == Dx)
{ {
TextLeft += realglyph->advance.x >> 10; TextLeft += realglyph->advance.x >> 10;
// DbgPrint("new TextLeft: %d\n", TextLeft); DPRINT("new TextLeft: %d\n", TextLeft);
} }
else else
{ {
TextLeft += Dx[i<<DxShift] << 6; TextLeft += Dx[i<<DxShift] << 6;
// DbgPrint("new TextLeft2: %d\n", TextLeft); DPRINT("new TextLeft2: %d\n", TextLeft);
} }
if (DxShift) if (DxShift)