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

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

Issue 22239002: pdfviewer: add virtual destructor for SkPdfFont (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 | no next file » | 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 class SkPdfFont { 157 class SkPdfFont {
158 public: 158 public:
159 SkPdfFont* fBaseFont; 159 SkPdfFont* fBaseFont;
160 SkPdfEncoding* fEncoding; 160 SkPdfEncoding* fEncoding;
161 SkPdfToUnicode* fToUnicode; 161 SkPdfToUnicode* fToUnicode;
162 162
163 163
164 public: 164 public:
165 SkPdfFont() : fBaseFont(NULL), fEncoding(SkPdfDefaultEncoding::instance()), fToUnicode(NULL) {} 165 SkPdfFont() : fBaseFont(NULL), fEncoding(SkPdfDefaultEncoding::instance()), fToUnicode(NULL) {}
166 166
167 virtual ~SkPdfFont() {
168 // TODO(edisonn): NYI (will leak for now)
169 }
170
167 const SkPdfEncoding* encoding() const {return fEncoding;} 171 const SkPdfEncoding* encoding() const {return fEncoding;}
168 172
169 void drawText(const SkDecodedText& text, SkPaint* paint, PdfContext* pdfCont ext, SkCanvas* canvas) { 173 void drawText(const SkDecodedText& text, SkPaint* paint, PdfContext* pdfCont ext, SkCanvas* canvas) {
170 for (int i = 0 ; i < text.size(); i++) { 174 for (int i = 0 ; i < text.size(); i++) {
171 double width = drawOneChar(text[i], paint, pdfContext, canvas); 175 double width = drawOneChar(text[i], paint, pdfContext, canvas);
172 pdfContext->fGraphicsState.fMatrixTm.preTranslate(SkDoubleToScalar(w idth), SkDoubleToScalar(0.0)); 176 pdfContext->fGraphicsState.fMatrixTm.preTranslate(SkDoubleToScalar(w idth), SkDoubleToScalar(0.0));
173 canvas->translate(SkDoubleToScalar(width), SkDoubleToScalar(0.0)); 177 canvas->translate(SkDoubleToScalar(width), SkDoubleToScalar(0.0));
174 } 178 }
175 } 179 }
176 180
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 SkDoubleToScalar(0.0)); 415 SkDoubleToScalar(0.0));
412 return fChars[ch - fFirstChar].fWidth; 416 return fChars[ch - fFirstChar].fWidth;
413 } 417 }
414 418
415 virtual void afterWord(SkPaint* paint, SkMatrix* matrix) { 419 virtual void afterWord(SkPaint* paint, SkMatrix* matrix) {
416 420
417 } 421 }
418 }; 422 };
419 423
420 #endif // __DEFINED__SkPdfFont 424 #endif // __DEFINED__SkPdfFont
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698