Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Unified Diff: src/core/SkDrawProcs.h

Issue 977623002: Glyph positions maintain 32 bit integer part. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Warnings as errors on Windows. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDrawProcs.h
diff --git a/src/core/SkDrawProcs.h b/src/core/SkDrawProcs.h
index d059c674701fe146ef9076c6068e42be1816c86e..0a188235d2dbc165f10737f7d2498f11ded3cd48 100644
--- a/src/core/SkDrawProcs.h
+++ b/src/core/SkDrawProcs.h
@@ -24,9 +24,9 @@ struct SkDraw1Glyph {
const SkPaint* fPaint;
SkIRect fClipBounds;
/** Half the sampling frequency of the rasterized glyph in x. */
- SkFixed fHalfSampleX;
+ SkScalar fHalfSampleX;
/** Half the sampling frequency of the rasterized glyph in y. */
- SkFixed fHalfSampleY;
+ SkScalar fHalfSampleY;
/** Draws one glyph.
*
@@ -35,7 +35,7 @@ struct SkDraw1Glyph {
* 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&);
+ typedef void (*Proc)(const SkDraw1Glyph&, Sk48Dot16 x, Sk48Dot16 y, const SkGlyph&);
Proc init(const SkDraw* draw, SkBlitter* blitter, SkGlyphCache* cache,
const SkPaint&);
@@ -93,31 +93,6 @@ public:
: fAlign(align) {
}
- // Returns the position of the glyph in fixed point, which may be rounded or not
- // by the caller e.g. subpixel doesn't round.
- // @param point interpreted as SkFixed [x, y].
- void operator()(const SkPoint& loc, const SkGlyph& glyph, SkIPoint* dst) {
- if (SkPaint::kLeft_Align == fAlign) {
- dst->set(SkScalarToFixed(loc.fX), SkScalarToFixed(loc.fY));
- } else if (SkPaint::kCenter_Align == fAlign) {
- dst->set(SkScalarToFixed(loc.fX) - (glyph.fAdvanceX >> 1),
- SkScalarToFixed(loc.fY) - (glyph.fAdvanceY >> 1));
- } else {
- SkASSERT(SkPaint::kRight_Align == fAlign);
- dst->set(SkScalarToFixed(loc.fX) - glyph.fAdvanceX,
- SkScalarToFixed(loc.fY) - glyph.fAdvanceY);
- }
- }
-private:
- const SkPaint::Align fAlign;
-};
-
-class SkTextAlignProcScalar {
-public:
- SkTextAlignProcScalar(SkPaint::Align align)
- : fAlign(align) {
- }
-
// Returns the glyph position, which may be rounded or not by the caller
// e.g. subpixel doesn't round.
void operator()(const SkPoint& loc, const SkGlyph& glyph, SkPoint* dst) {
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698