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

Side by Side Diff: src/pdf/SkPDFFont.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, 8 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/pdf/SkPDFDevice.cpp ('k') | src/ports/SkFontHost_FreeType.cpp » ('j') | 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 <ctype.h> 8 #include <ctype.h>
9 9
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 1336
1337 auto widthArray = sk_make_sp<SkPDFArray>(); 1337 auto widthArray = sk_make_sp<SkPDFArray>();
1338 1338
1339 SkIRect bbox = SkIRect::MakeEmpty(); 1339 SkIRect bbox = SkIRect::MakeEmpty();
1340 for (int gID = firstGlyphID(); gID <= lastGlyphID(); gID++) { 1340 for (int gID = firstGlyphID(); gID <= lastGlyphID(); gID++) {
1341 SkString characterName; 1341 SkString characterName;
1342 characterName.printf("gid%d", gID); 1342 characterName.printf("gid%d", gID);
1343 encDiffs->appendName(characterName.c_str()); 1343 encDiffs->appendName(characterName.c_str());
1344 1344
1345 const SkGlyph& glyph = cache->getGlyphIDMetrics(gID); 1345 const SkGlyph& glyph = cache->getGlyphIDMetrics(gID);
1346 widthArray->appendScalar(SkFixedToScalar(glyph.fAdvanceX)); 1346 widthArray->appendScalar(SkFloatToScalar(glyph.fAdvanceX));
1347 SkIRect glyphBBox = SkIRect::MakeXYWH(glyph.fLeft, glyph.fTop, 1347 SkIRect glyphBBox = SkIRect::MakeXYWH(glyph.fLeft, glyph.fTop,
1348 glyph.fWidth, glyph.fHeight); 1348 glyph.fWidth, glyph.fHeight);
1349 bbox.join(glyphBBox); 1349 bbox.join(glyphBBox);
1350 1350
1351 SkDynamicMemoryWStream content; 1351 SkDynamicMemoryWStream content;
1352 setGlyphWidthAndBoundingBox(SkFixedToScalar(glyph.fAdvanceX), glyphBBox, 1352 setGlyphWidthAndBoundingBox(SkFloatToScalar(glyph.fAdvanceX), glyphBBox,
1353 &content); 1353 &content);
1354 const SkPath* path = cache->findPath(glyph); 1354 const SkPath* path = cache->findPath(glyph);
1355 if (path) { 1355 if (path) {
1356 SkPDFUtils::EmitPath(*path, paint.getStyle(), &content); 1356 SkPDFUtils::EmitPath(*path, paint.getStyle(), &content);
1357 SkPDFUtils::PaintPath(paint.getStyle(), path->getFillType(), 1357 SkPDFUtils::PaintPath(paint.getStyle(), path->getFillType(),
1358 &content); 1358 &content);
1359 } 1359 }
1360 SkAutoTDelete<SkMemoryStream> glyphStream(new SkMemoryStream()); 1360 SkAutoTDelete<SkMemoryStream> glyphStream(new SkMemoryStream());
1361 glyphStream->setData(content.copyToData())->unref(); 1361 glyphStream->setData(content.copyToData())->unref();
1362 1362
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1418 } 1418 }
1419 return *canon->fCanEmbedTypeface.set(id, canEmbed); 1419 return *canon->fCanEmbedTypeface.set(id, canEmbed);
1420 } 1420 }
1421 1421
1422 void SkPDFFont::drop() { 1422 void SkPDFFont::drop() {
1423 fTypeface = nullptr; 1423 fTypeface = nullptr;
1424 fFontInfo = nullptr; 1424 fFontInfo = nullptr;
1425 fDescriptor = nullptr; 1425 fDescriptor = nullptr;
1426 this->SkPDFDict::drop(); 1426 this->SkPDFDict::drop();
1427 } 1427 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698