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

Unified Diff: src/device/xps/SkXPSDevice.cpp

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/SkPaint.cpp ('k') | src/gpu/GrBitmapTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/device/xps/SkXPSDevice.cpp
diff --git a/src/device/xps/SkXPSDevice.cpp b/src/device/xps/SkXPSDevice.cpp
index 3bb87b32a3335af86bd00009de9e670373c99e53..2ca799ac370a633d011da3df51c838b9fb60740a 100644
--- a/src/device/xps/SkXPSDevice.cpp
+++ b/src/device/xps/SkXPSDevice.cpp
@@ -2057,15 +2057,15 @@ public:
};
static void xps_draw_1_glyph(const SkDraw1Glyph& state,
- SkFixed x, SkFixed y,
+ Sk48Dot16 fx, Sk48Dot16 fy,
const SkGlyph& skGlyph) {
SkASSERT(skGlyph.fWidth > 0 && skGlyph.fHeight > 0);
SkXPSDrawProcs* procs = static_cast<SkXPSDrawProcs*>(state.fDraw->fProcs);
//Draw pre-adds half the sampling frequency for floor rounding.
- x -= state.fHalfSampleX;
- y -= state.fHalfSampleY;
+ SkScalar x = Sk48Dot16ToScalar(fx) - state.fHalfSampleX;
+ SkScalar y = Sk48Dot16ToScalar(fy) - state.fHalfSampleY;
XPS_GLYPH_INDEX* xpsGlyph = procs->xpsGlyphs.append();
uint16_t glyphID = skGlyph.getGlyphID();
@@ -2073,14 +2073,14 @@ static void xps_draw_1_glyph(const SkDraw1Glyph& state,
xpsGlyph->index = glyphID;
if (1 == procs->xpsGlyphs.count()) {
xpsGlyph->advanceWidth = 0.0f;
- xpsGlyph->horizontalOffset = SkFixedToFloat(x) * procs->centemPerUnit;
- xpsGlyph->verticalOffset = SkFixedToFloat(y) * -procs->centemPerUnit;
+ xpsGlyph->horizontalOffset = SkScalarToFloat(x) * procs->centemPerUnit;
+ xpsGlyph->verticalOffset = SkScalarToFloat(y) * -procs->centemPerUnit;
} else {
const XPS_GLYPH_INDEX& first = procs->xpsGlyphs[0];
xpsGlyph->advanceWidth = 0.0f;
- xpsGlyph->horizontalOffset = (SkFixedToFloat(x) * procs->centemPerUnit)
+ xpsGlyph->horizontalOffset = (SkScalarToFloat(x) * procs->centemPerUnit)
- first.horizontalOffset;
- xpsGlyph->verticalOffset = (SkFixedToFloat(y) * -procs->centemPerUnit)
+ xpsGlyph->verticalOffset = (SkScalarToFloat(y) * -procs->centemPerUnit)
- first.verticalOffset;
}
}
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/gpu/GrBitmapTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698