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

Unified Diff: src/core/SkAutoKern.h

Issue 1737693006: Change type of SkGlyph::fAdvance[XY] to float. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Should be float, not SkScalar. Created 4 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 | « no previous file | src/core/SkDrawProcs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkAutoKern.h
diff --git a/src/core/SkAutoKern.h b/src/core/SkAutoKern.h
index 0b22e56413eba57acf0f26b964fedda1ff358526..27df6da22bb3a08f5cc1d9dabce1de5d4f72e7ab 100644
--- a/src/core/SkAutoKern.h
+++ b/src/core/SkAutoKern.h
@@ -12,11 +12,10 @@
#include "SkGlyph.h"
-#define SkAutoKern_AdjustF(prev, next) (((next) - (prev) + 32) >> 6 << 16)
-#define SkAutoKern_AdjustS(prev, next) SkIntToScalar(((next) - (prev) + 32) >> 6)
+#define SkAutoKern_Adjust(prev, next) SkIntToScalar(((next) - (prev) + 32) >> 6)
/* this is a helper class to perform auto-kerning
- * the adjust() method returns a SkFixed corresponding
+ * the adjust() method returns a SkScalar corresponding
* to a +1/0/-1 pixel adjustment
*/
@@ -24,7 +23,7 @@ class SkAutoKern {
public:
SkAutoKern() : fPrevRsbDelta(0) {}
- SkFixed adjust(const SkGlyph& glyph)
+ SkScalar adjust(const SkGlyph& glyph)
{
// if (SkAbs32(glyph.fLsbDelta) > 47 || SkAbs32(glyph.fRsbDelta) > 47)
// printf("------- %d> L %d R %d\n", glyph.f_GlyphID, glyph.fLsbDelta, glyph.fRsbDelta);
@@ -35,13 +34,13 @@ public:
fPrevRsbDelta = glyph.fRsbDelta;
if (distort >= 32)
- return -SK_Fixed1;
+ return -SK_Scalar1;
else if (distort < -32)
- return +SK_Fixed1;
+ return +SK_Scalar1;
else
return 0;
#else
- SkFixed adjust = SkAutoKern_AdjustF(fPrevRsbDelta, glyph.fLsbDelta);
+ SkScalar adjust = SkAutoKern_Adjust(fPrevRsbDelta, glyph.fLsbDelta);
fPrevRsbDelta = glyph.fRsbDelta;
return adjust;
#endif
« no previous file with comments | « no previous file | src/core/SkDrawProcs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698