| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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) |
| OLD | NEW |