diff options
author | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-02-25 15:55:13 +0000 |
---|---|---|
committer | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-02-25 15:55:13 +0000 |
commit | 9447103029273a9f8dd7f5997e8af7a1e3ee7488 (patch) | |
tree | 4caba4caacfc5ebbd77314f23b3cd2805ce1ffdf /src/core/SkDrawProcs.h | |
parent | 570ed6466c9b62031ebf8a36d2b242ee666f7d24 (diff) |
Always round text position correctly.
https://codereview.appspot.com/7383049/
Will require rebaseline of fontscaler GM.
Must add SK_IGNORE_SUBPIXEL_AXIS_ALIGN_FIX to Chromium
until ~150 layout tests can be rebaselined.
git-svn-id: http://skia.googlecode.com/svn/trunk@7842 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkDrawProcs.h')
-rw-r--r-- | src/core/SkDrawProcs.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/core/SkDrawProcs.h b/src/core/SkDrawProcs.h index ec086dd7da..68cc9ff08c 100644 --- a/src/core/SkDrawProcs.h +++ b/src/core/SkDrawProcs.h @@ -21,10 +21,18 @@ struct SkDraw1Glyph { SkBlitter* fBlitter; SkGlyphCache* fCache; SkIRect fClipBounds; - - // The fixed x,y are pre-rounded, so impls just trunc them down to ints. - // i.e. half the sampling frequency has been added. - // e.g. 1/2 or 1/(2^(SkGlyph::kSubBits+1)) has already been added. + /** Half the sampling frequency of the rasterized glyph in x. */ + SkFixed fHalfSampleX; + /** Half the sampling frequency of the rasterized glyph in y. */ + SkFixed fHalfSampleY; + + /** Draws one glyph. + * + * The x and y are pre-biased, so implementations may just truncate them. + * i.e. half the sampling frequency has been added. + * e.g. 1/2 or 1/(2^(SkGlyph::kSubBits+1)) has already been added. + * This added bias can be found in fHalfSampleX,Y. + */ typedef void (*Proc)(const SkDraw1Glyph&, SkFixed x, SkFixed y, const SkGlyph&); Proc init(const SkDraw* draw, SkBlitter* blitter, SkGlyphCache* cache); |