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

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

Issue 1069103003: SkPDF: Refactor SkPDFObject heiararchy. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-04-25 (Saturday) 09:40:48 EDT Created 5 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/pdf/SkPDFResourceDict.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 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 &content); 1383 &content);
1384 const SkPath* path = cache->findPath(glyph); 1384 const SkPath* path = cache->findPath(glyph);
1385 if (path) { 1385 if (path) {
1386 SkPDFUtils::EmitPath(*path, paint.getStyle(), &content); 1386 SkPDFUtils::EmitPath(*path, paint.getStyle(), &content);
1387 SkPDFUtils::PaintPath(paint.getStyle(), path->getFillType(), 1387 SkPDFUtils::PaintPath(paint.getStyle(), path->getFillType(),
1388 &content); 1388 &content);
1389 } 1389 }
1390 SkAutoTDelete<SkMemoryStream> glyphStream(new SkMemoryStream()); 1390 SkAutoTDelete<SkMemoryStream> glyphStream(new SkMemoryStream());
1391 glyphStream->setData(content.copyToData())->unref(); 1391 glyphStream->setData(content.copyToData())->unref();
1392 1392
1393 SkAutoTUnref<SkPDFStream> glyphDescription( 1393 charProcs->insertObjRef(characterName,
1394 new SkPDFStream(glyphStream.get())); 1394 new SkPDFStream(glyphStream.get()));
1395 charProcs->insert(characterName.c_str(),
1396 new SkPDFObjRef(glyphDescription.get()))->unref();
1397 } 1395 }
1398 1396
1399 insert("FontBBox", makeFontBBox(bbox, 1000))->unref(); 1397 insert("FontBBox", makeFontBBox(bbox, 1000))->unref();
1400 insertInt("FirstChar", 1); 1398 insertInt("FirstChar", 1);
1401 insertInt("LastChar", lastGlyphID() - firstGlyphID() + 1); 1399 insertInt("LastChar", lastGlyphID() - firstGlyphID() + 1);
1402 insert("Widths", widthArray.get()); 1400 insert("Widths", widthArray.get());
1403 insertName("CIDToGIDMap", "Identity"); 1401 insertName("CIDToGIDMap", "Identity");
1404 1402
1405 populateToUnicodeTable(NULL); 1403 populateToUnicodeTable(NULL);
1406 return true; 1404 return true;
(...skipping 12 matching lines...) Expand all
1419 } 1417 }
1420 if (existingFont != NULL) { 1418 if (existingFont != NULL) {
1421 return (existingFont->fFirstGlyphID <= searchGlyphID && 1419 return (existingFont->fFirstGlyphID <= searchGlyphID &&
1422 searchGlyphID <= existingFont->fLastGlyphID) 1420 searchGlyphID <= existingFont->fLastGlyphID)
1423 ? SkPDFFont::kExact_Match 1421 ? SkPDFFont::kExact_Match
1424 : SkPDFFont::kRelated_Match; 1422 : SkPDFFont::kRelated_Match;
1425 } 1423 }
1426 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match 1424 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match
1427 : SkPDFFont::kRelated_Match; 1425 : SkPDFFont::kRelated_Match;
1428 } 1426 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/pdf/SkPDFResourceDict.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698