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

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

Issue 23020003: pdfviewer: debug code for drawText (show magenta background for text, to show text even when we fai… (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/generate_code.py » ('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 "SkPdfBasics.h" 4 #include "SkMatrix.h"
5 #include "SkRect.h"
5 6
6 class SkPdfArray; 7 class SkPdfArray;
8 class SkPdfContext;
9 class SkCanvas;
10 class SkPdfNativeObject;
11
12 // TODO(edisonn): temporary code, to report how much of the PDF we actually thin k we rendered.
13 enum SkPdfResult {
14 kOK_SkPdfResult,
15 kPartial_SkPdfResult,
16 kNYI_SkPdfResult,
17 kIgnoreError_SkPdfResult,
18 kError_SkPdfResult,
19 kUnsupported_SkPdfResult,
20
21 kCount_SkPdfResult
22 };
23
24 struct NotOwnedString {
25 const unsigned char* fBuffer;
26 size_t fBytes;
27
28 static void init(NotOwnedString* str) {
29 str->fBuffer = NULL;
30 str->fBytes = 0;
31 }
32
33 static void init(NotOwnedString* str, const char* sz) {
34 str->fBuffer = (const unsigned char*)sz;
35 str->fBytes = strlen(sz);
36 }
37
38 bool equals(const char* sz) {
39 return strncmp((const char*)fBuffer, sz, fBytes) == 0 && fBytes == strle n(sz);
40
41 }
42 };
7 43
8 SkMatrix SkMatrixFromPdfArray(SkPdfArray* pdfArray); 44 SkMatrix SkMatrixFromPdfArray(SkPdfArray* pdfArray);
9 45
10 PdfResult doType3Char(PdfContext* pdfContext, SkCanvas* canvas, const SkPdfObjec t* skobj, SkRect bBox, SkMatrix matrix, double textSize); 46 SkPdfResult doType3Char(SkPdfContext* pdfContext, SkCanvas* canvas, const SkPdfN ativeObject* skobj, SkRect bBox, SkMatrix matrix, double textSize);
47
48 //////////////////////////////////////////////////////////////////////////////// ////////////////////
49 //
50 // TRACE functions
51 //
52 #ifdef PDF_TRACE
53 void SkTraceMatrix(const SkMatrix& matrix, const char* sz);
54 void SkTraceRect(const SkRect& rect, const char* sz);
55 #else
56 #define SkTraceMatrix(a,b)
57 #define SkTraceRect(a,b)
58 #endif
11 59
12 #endif // __DEFINED__SkPdfUtils 60 #endif // __DEFINED__SkPdfUtils
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfRenderer.cpp ('k') | experimental/PdfViewer/generate_code.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698