зеркало из https://github.com/mozilla/moz-skia.git
move variable declarations above goto lines, to fix warning/error about
skipping over them. git-svn-id: http://skia.googlecode.com/svn/trunk@2750 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
86ab6c694c
Коммит
05b6f3a5a9
|
@ -22,7 +22,7 @@
|
|||
#ifdef WIN32
|
||||
#include "windows.h"
|
||||
#include "tchar.h"
|
||||
#include "Usp10.h"
|
||||
#include "usp10.h"
|
||||
|
||||
// always packed xxRRGGBB
|
||||
typedef uint32_t SkGdiRGB;
|
||||
|
@ -1045,6 +1045,10 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
|
|||
HFONT savefont = (HFONT)SelectObject(hdc, font);
|
||||
HFONT designFont = NULL;
|
||||
|
||||
const char stem_chars[] = {'i', 'I', '!', '1'};
|
||||
int16_t min_width;
|
||||
unsigned glyphCount;
|
||||
|
||||
// To request design units, create a logical font whose height is specified
|
||||
// as unitsPerEm.
|
||||
OUTLINETEXTMETRIC otm;
|
||||
|
@ -1062,7 +1066,7 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
|
|||
if (!GetOutlineTextMetrics(hdc, sizeof(otm), &otm)) {
|
||||
goto Error;
|
||||
}
|
||||
const unsigned glyphCount = calculateGlyphCount(hdc);
|
||||
glyphCount = calculateGlyphCount(hdc);
|
||||
|
||||
info = new SkAdvancedTypefaceMetrics;
|
||||
info->fEmSize = otm.otmEMSquare;
|
||||
|
@ -1131,9 +1135,8 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
|
|||
|
||||
// Figure out a good guess for StemV - Min width of i, I, !, 1.
|
||||
// This probably isn't very good with an italic font.
|
||||
int16_t min_width = SHRT_MAX;
|
||||
min_width = SHRT_MAX;
|
||||
info->fStemV = 0;
|
||||
char stem_chars[] = {'i', 'I', '!', '1'};
|
||||
for (size_t i = 0; i < SK_ARRAY_COUNT(stem_chars); i++) {
|
||||
ABC abcWidths;
|
||||
if (GetCharABCWidths(hdc, stem_chars[i], stem_chars[i], &abcWidths)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче