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

Side by Side Diff: experimental/PdfViewer/SkPdfFont.cpp

Issue 128573002: Small tweaks to be able to build everything target: (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "SkPdfFont.h" 8 #include "SkPdfFont.h"
9 9
10 #include "SkPdfNativeTokenizer.h" 10 #include "SkPdfNativeTokenizer.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 ret = (ret << 8) + ((unsigned char*)str->c_str())[i]; 322 ret = (ret << 8) + ((unsigned char*)str->c_str())[i];
323 } 323 }
324 // TODO(edisonn): character larger than 0x0000ffff not supported right now. 324 // TODO(edisonn): character larger than 0x0000ffff not supported right now.
325 return ret & 0x0000ffff; 325 return ret & 0x0000ffff;
326 } 326 }
327 327
328 #define tokenIsKeyword(token,keyword) (token.fType == kKeyword_TokenType && \ 328 #define tokenIsKeyword(token,keyword) (token.fType == kKeyword_TokenType && \
329 token.fKeywordLength==sizeof(keyword)-1 && \ 329 token.fKeywordLength==sizeof(keyword)-1 && \
330 strncmp(token.fKeyword, keyword, sizeof(ke yword)-1) == 0) 330 strncmp(token.fKeyword, keyword, sizeof(ke yword)-1) == 0)
331 331
332 SkPdfToUnicode::SkPdfToUnicode(SkPdfNativeDoc* parsed, SkPdfStream* stream) : fP arsed(parsed) { 332 SkPdfToUnicode::SkPdfToUnicode(SkPdfNativeDoc* parsed, SkPdfStream* stream) {
333 fCMapEncoding = NULL; 333 fCMapEncoding = NULL;
334 fCMapEncodingFlag = NULL; 334 fCMapEncodingFlag = NULL;
335 335
336 if (stream) { 336 if (stream) {
337 // Since font will be cached, the font has to sit in the per doc allocat or, not to be 337 // Since font will be cached, the font has to sit in the per doc allocat or, not to be
338 // freed after the page is done drawing. 338 // freed after the page is done drawing.
339 SkPdfNativeTokenizer tokenizer(stream, parsed->allocator(), parsed); 339 SkPdfNativeTokenizer tokenizer(stream, parsed->allocator(), parsed);
340 PdfToken token; 340 PdfToken token;
341 341
342 fCMapEncoding = new unsigned short[256 * 256]; 342 fCMapEncoding = new unsigned short[256 * 256];
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 encoding = NULL; 459 encoding = NULL;
460 } 460 }
461 461
462 #ifdef PDF_TRACE 462 #ifdef PDF_TRACE
463 if (encoding == NULL) { 463 if (encoding == NULL) {
464 printf("Encoding not found: %s\n", name); 464 printf("Encoding not found: %s\n", name);
465 } 465 }
466 #endif 466 #endif
467 return encoding; 467 return encoding;
468 } 468 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698