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

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

Issue 18293014: pdfviewer: fix warnings on mac (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | experimental/PdfViewer/SkPdfParser.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 #ifndef __DEFINED__SkPdfFont 1 #ifndef __DEFINED__SkPdfFont
2 #define __DEFINED__SkPdfFont 2 #define __DEFINED__SkPdfFont
3 3
4 #include "SkPdfHeaders_autogen.h" 4 #include "SkPdfHeaders_autogen.h"
5 #include "SkPdfMapper_autogen.h" 5 #include "SkPdfMapper_autogen.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "SkTypeface.h" 10 #include "SkTypeface.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 344 }
345 345
346 // null? 346 // null?
347 fCharProcs = dict->CharProcs(parsed); 347 fCharProcs = dict->CharProcs(parsed);
348 348
349 fToUnicode = NULL; 349 fToUnicode = NULL;
350 if (dict->has_ToUnicode()) { 350 if (dict->has_ToUnicode()) {
351 fToUnicode = new SkPdfToUnicode(parsed, dict->ToUnicode(parsed)); 351 fToUnicode = new SkPdfToUnicode(parsed, dict->ToUnicode(parsed));
352 } 352 }
353 353
354 fFirstChar = dict->FirstChar(parsed); 354 fFirstChar = (unsigned int)dict->FirstChar(parsed);
355 fLastChar = dict->LastChar(parsed); 355 fLastChar = (unsigned int)dict->LastChar(parsed);
356 fFonMatrix = dict->has_FontMatrix() ? dict->FontMatrix(parsed) : SkMatri x::I(); 356 fFonMatrix = dict->has_FontMatrix() ? dict->FontMatrix(parsed) : SkMatri x::I();
357 357
358 if (dict->has_FontBBox()) { 358 if (dict->has_FontBBox()) {
359 fFontBBox = dict->FontBBox(parsed); 359 fFontBBox = dict->FontBBox(parsed);
360 } 360 }
361 361
362 fChars = new Type3FontChar[fLastChar - fFirstChar + 1]; 362 fChars = new Type3FontChar[fLastChar - fFirstChar + 1];
363 363
364 memset(fChars, 0, sizeof(fChars[0]) * (fLastChar - fFirstChar + 1)); 364 memset(fChars, 0, sizeof(fChars[0]) * (fLastChar - fFirstChar + 1));
365 365
366 366
367 const SkPdfArray* widths = dict->Widths(parsed); 367 const SkPdfArray* widths = dict->Widths(parsed);
368 for (unsigned int i = 0 ; i < widths->size(); i++) { 368 for (unsigned int i = 0 ; i < widths->size(); i++) {
369 if ((fFirstChar + i) < fFirstChar || (fFirstChar + i) > fLastChar) { 369 if ((fFirstChar + i) < fFirstChar || (fFirstChar + i) > fLastChar) {
370 printf("break; error 1\n"); 370 printf("break; error 1\n");
371 } 371 }
372 fChars[i].fWidth = (*widths)[i]->numberValue(); 372 fChars[i].fWidth = (*widths)[i]->numberValue();
373 } 373 }
374 374
375 const SkPdfArray* diffs = fEncodingDict->Differences(parsed); 375 const SkPdfArray* diffs = fEncodingDict->Differences(parsed);
376 unsigned int j = fFirstChar; 376 unsigned int j = fFirstChar;
377 for (unsigned int i = 0 ; i < diffs->size(); i++) { 377 for (unsigned int i = 0 ; i < diffs->size(); i++) {
378 if ((*diffs)[i]->isInteger()) { 378 if ((*diffs)[i]->isInteger()) {
379 j = (*diffs)[i]->intValue(); 379 j = (unsigned int)(*diffs)[i]->intValue();
380 } else if ((*diffs)[i]->isName()) { 380 } else if ((*diffs)[i]->isName()) {
381 if (j < fFirstChar || j > fLastChar) { 381 if (j < fFirstChar || j > fLastChar) {
382 printf("break; error 2\n"); 382 printf("break; error 2\n");
383 } 383 }
384 fChars[j - fFirstChar].fObj = fCharProcs->get((*diffs)[i]->nameV alue()); 384 fChars[j - fFirstChar].fObj = fCharProcs->get((*diffs)[i]->nameV alue());
385 j++; 385 j++;
386 } else { 386 } else {
387 // err 387 // err
388 } 388 }
389 } 389 }
(...skipping 20 matching lines...) Expand all
410 SkDoubleToScalar(0.0)); 410 SkDoubleToScalar(0.0));
411 return fChars[ch - fFirstChar].fWidth; 411 return fChars[ch - fFirstChar].fWidth;
412 } 412 }
413 413
414 virtual void afterWord(SkPaint* paint, SkMatrix* matrix) { 414 virtual void afterWord(SkPaint* paint, SkMatrix* matrix) {
415 415
416 } 416 }
417 }; 417 };
418 418
419 #endif // __DEFINED__SkPdfFont 419 #endif // __DEFINED__SkPdfFont
OLDNEW
« no previous file with comments | « no previous file | experimental/PdfViewer/SkPdfParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698