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

Side by Side Diff: src/ports/SkScalerContext_win_dw.cpp

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 unified diff | Download patch
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkTypes.h" 8 #include "SkTypes.h"
9 #if defined(SK_BUILD_FOR_WIN32) 9 #if defined(SK_BUILD_FOR_WIN32)
10 10
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 DWRITE_MEASURING_MODE_GDI_NATURAL == fMeasuringMode) 381 DWRITE_MEASURING_MODE_GDI_NATURAL == fMeasuringMode)
382 { 382 {
383 // DirectWrite produced 'compatible' metrics, but while close, 383 // DirectWrite produced 'compatible' metrics, but while close,
384 // the end result is not always an integer as it would be with GDI. 384 // the end result is not always an integer as it would be with GDI.
385 vecs[0].fX = SkScalarRoundToScalar(advanceX); 385 vecs[0].fX = SkScalarRoundToScalar(advanceX);
386 fG_inv.mapVectors(vecs, SK_ARRAY_COUNT(vecs)); 386 fG_inv.mapVectors(vecs, SK_ARRAY_COUNT(vecs));
387 } else { 387 } else {
388 fSkXform.mapVectors(vecs, SK_ARRAY_COUNT(vecs)); 388 fSkXform.mapVectors(vecs, SK_ARRAY_COUNT(vecs));
389 } 389 }
390 390
391 glyph->fAdvanceX = SkScalarToFixed(vecs[0].fX); 391 glyph->fAdvanceX = SkScalarToFloat(vecs[0].fX);
392 glyph->fAdvanceY = SkScalarToFixed(vecs[0].fY); 392 glyph->fAdvanceY = SkScalarToFloat(vecs[0].fY);
393 } 393 }
394 394
395 HRESULT SkScalerContext_DW::getBoundingBox(SkGlyph* glyph, 395 HRESULT SkScalerContext_DW::getBoundingBox(SkGlyph* glyph,
396 DWRITE_RENDERING_MODE renderingMode, 396 DWRITE_RENDERING_MODE renderingMode,
397 DWRITE_TEXTURE_TYPE textureType, 397 DWRITE_TEXTURE_TYPE textureType,
398 RECT* bbox) 398 RECT* bbox)
399 { 399 {
400 //Measure raster size. 400 //Measure raster size.
401 fXform.dx = SkFixedToFloat(glyph->getSubXFixed()); 401 fXform.dx = SkFixedToFloat(glyph->getSubXFixed());
402 fXform.dy = SkFixedToFloat(glyph->getSubYFixed()); 402 fXform.dy = SkFixedToFloat(glyph->getSubYFixed());
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 FALSE, //sideways 773 FALSE, //sideways
774 FALSE, //rtl 774 FALSE, //rtl
775 geometryToPath.get()), 775 geometryToPath.get()),
776 "Could not create glyph outline."); 776 "Could not create glyph outline.");
777 } 777 }
778 778
779 path->transform(fSkXform); 779 path->transform(fSkXform);
780 } 780 }
781 781
782 #endif//defined(SK_BUILD_FOR_WIN32) 782 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698