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

Side by Side Diff: src/pdf/SkPDFFont.cpp

Issue 1124193003: SkPDF: Move utility fns to SkPDFUtils (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-05-06 (Wednesday) 13:16:21 EDT Created 5 years, 7 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/pdf/SkPDFTypes.h » ('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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 if (emSize == 1000) { 279 if (emSize == 1000) {
280 return scaled; 280 return scaled;
281 } else { 281 } else {
282 return SkScalarMulDiv(scaled, 1000, emSize); 282 return SkScalarMulDiv(scaled, 1000, emSize);
283 } 283 }
284 } 284 }
285 285
286 void setGlyphWidthAndBoundingBox(SkScalar width, SkIRect box, 286 void setGlyphWidthAndBoundingBox(SkScalar width, SkIRect box,
287 SkWStream* content) { 287 SkWStream* content) {
288 // Specify width and bounding box for the glyph. 288 // Specify width and bounding box for the glyph.
289 SkPDFScalar::Append(width, content); 289 SkPDFUtils::AppendScalar(width, content);
290 content->writeText(" 0 "); 290 content->writeText(" 0 ");
291 content->writeDecAsText(box.fLeft); 291 content->writeDecAsText(box.fLeft);
292 content->writeText(" "); 292 content->writeText(" ");
293 content->writeDecAsText(box.fTop); 293 content->writeDecAsText(box.fTop);
294 content->writeText(" "); 294 content->writeText(" ");
295 content->writeDecAsText(box.fRight); 295 content->writeDecAsText(box.fRight);
296 content->writeText(" "); 296 content->writeText(" ");
297 content->writeDecAsText(box.fBottom); 297 content->writeDecAsText(box.fBottom);
298 content->writeText(" d1\n"); 298 content->writeText(" d1\n");
299 } 299 }
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1418 } 1418 }
1419 if (existingFont != NULL) { 1419 if (existingFont != NULL) {
1420 return (existingFont->fFirstGlyphID <= searchGlyphID && 1420 return (existingFont->fFirstGlyphID <= searchGlyphID &&
1421 searchGlyphID <= existingFont->fLastGlyphID) 1421 searchGlyphID <= existingFont->fLastGlyphID)
1422 ? SkPDFFont::kExact_Match 1422 ? SkPDFFont::kExact_Match
1423 : SkPDFFont::kRelated_Match; 1423 : SkPDFFont::kRelated_Match;
1424 } 1424 }
1425 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match 1425 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match
1426 : SkPDFFont::kRelated_Match; 1426 : SkPDFFont::kRelated_Match;
1427 } 1427 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/pdf/SkPDFTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698