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

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

Issue 23258004: pdfviewer: code cleanup - remove STL usage (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 | « experimental/PdfViewer/SkPdfRenderer.cpp ('k') | experimental/PdfViewer/SkPdfUtils.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 #ifndef __DEFINED__SkPdfUtils 1 #ifndef __DEFINED__SkPdfUtils
2 #define __DEFINED__SkPdfUtils 2 #define __DEFINED__SkPdfUtils
3 3
4 #include "SkMatrix.h" 4 #include "SkMatrix.h"
5 #include "SkRect.h" 5 #include "SkRect.h"
6 #include "SkPdfConfig.h" 6 #include "SkPdfConfig.h"
7 #include "SkString.h"
7 8
8 class SkPdfArray; 9 class SkPdfArray;
9 class SkPdfContext; 10 class SkPdfContext;
10 class SkCanvas; 11 class SkCanvas;
11 class SkPdfNativeObject; 12 class SkPdfNativeObject;
12 13
13 // TODO(edisonn): temporary code, to report how much of the PDF we actually thin k we rendered. 14 // TODO(edisonn): temporary code, to report how much of the PDF we actually thin k we rendered.
14 enum SkPdfResult { 15 enum SkPdfResult {
15 kOK_SkPdfResult, 16 kOK_SkPdfResult,
16 kPartial_SkPdfResult, 17 kPartial_SkPdfResult,
(...skipping 18 matching lines...) Expand all
35 str->fBuffer = (const unsigned char*)sz; 36 str->fBuffer = (const unsigned char*)sz;
36 str->fBytes = strlen(sz); 37 str->fBytes = strlen(sz);
37 } 38 }
38 39
39 bool equals(const char* sz) { 40 bool equals(const char* sz) {
40 return strncmp((const char*)fBuffer, sz, fBytes) == 0 && fBytes == strle n(sz); 41 return strncmp((const char*)fBuffer, sz, fBytes) == 0 && fBytes == strle n(sz);
41 42
42 } 43 }
43 }; 44 };
44 45
46 // TODO(edisonn): hack to make code generation simpler. Alternatively we can upd ate the
47 // generate_code.py not to rely on != operator
48 bool operator !=(const SkString& first, const char* second);
49
45 SkMatrix SkMatrixFromPdfArray(SkPdfArray* pdfArray); 50 SkMatrix SkMatrixFromPdfArray(SkPdfArray* pdfArray);
46 51
47 SkPdfResult doType3Char(SkPdfContext* pdfContext, SkCanvas* canvas, const SkPdfN ativeObject* skobj, SkRect bBox, SkMatrix matrix, double textSize); 52 SkPdfResult doType3Char(SkPdfContext* pdfContext, SkCanvas* canvas, const SkPdfN ativeObject* skobj, SkRect bBox, SkMatrix matrix, double textSize);
48 53
49 //////////////////////////////////////////////////////////////////////////////// //////////////////// 54 //////////////////////////////////////////////////////////////////////////////// ////////////////////
50 // 55 //
51 // TRACE functions 56 // TRACE functions
52 // 57 //
53 #ifdef PDF_TRACE 58 #ifdef PDF_TRACE
54 void SkTraceMatrix(const SkMatrix& matrix, const char* sz); 59 void SkTraceMatrix(const SkMatrix& matrix, const char* sz);
55 void SkTraceRect(const SkRect& rect, const char* sz); 60 void SkTraceRect(const SkRect& rect, const char* sz);
56 #else 61 #else
57 #define SkTraceMatrix(a,b) 62 #define SkTraceMatrix(a,b)
58 #define SkTraceRect(a,b) 63 #define SkTraceRect(a,b)
59 #endif 64 #endif
60 65
61 #endif // __DEFINED__SkPdfUtils 66 #endif // __DEFINED__SkPdfUtils
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfRenderer.cpp ('k') | experimental/PdfViewer/SkPdfUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698