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

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

Issue 19793011: (upload draf code for backup) pdfviewer: improve memory, son't allocate extra buffers, and put the … (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 | « experimental/PdfViewer/SkPdfBasics.cpp ('k') | experimental/PdfViewer/SkPdfFont.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__SkPdfConfig 1 #ifndef __DEFINED__SkPdfConfig
2 #define __DEFINED__SkPdfConfig 2 #define __DEFINED__SkPdfConfig
3 3
4 //#define PDF_TRACE 4 //#define PDF_TRACE
5 //#define PDF_TRACE_READ_TOKEN
5 //#define PDF_TRACE_DIFF_IN_PNG 6 //#define PDF_TRACE_DIFF_IN_PNG
6 //#define PDF_DEBUG_NO_CLIPING 7 //#define PDF_DEBUG_NO_CLIPING
7 //#define PDF_DEBUG_NO_PAGE_CLIPING 8 //#define PDF_DEBUG_NO_PAGE_CLIPING
8 //#define PDF_DEBUG_3X 9 //#define PDF_DEBUG_3X
9 10
10 // TODO(edisonn): move in trace util. 11 // TODO(edisonn): move in trace util.
11 #ifdef PDF_TRACE 12 #ifdef PDF_TRACE
12 void SkTraceMatrix(const SkMatrix& matrix, const char* sz); 13 void SkTraceMatrix(const SkMatrix& matrix, const char* sz);
13 void SkTraceRect(const SkRect& rect, const char* sz); 14 void SkTraceRect(const SkRect& rect, const char* sz);
14 #else 15 #else
15 #define SkTraceMatrix(a,b) 16 #define SkTraceMatrix(a,b)
16 #define SkTraceRect(a,b) 17 #define SkTraceRect(a,b)
17 #endif 18 #endif
18 19
20 struct NotOwnedString {
21 const unsigned char* fBuffer;
22 size_t fBytes;
23
24 static void init(NotOwnedString* str) {
25 str->fBuffer = NULL;
26 str->fBytes = 0;
27 }
28
29 static void init(NotOwnedString* str, const char* sz) {
30 str->fBuffer = (const unsigned char*)sz;
31 str->fBytes = strlen(sz);
32 }
33
34 bool equals(const char* sz) {
35 return strncmp((const char*)fBuffer, sz, fBytes) == 0 && fBytes == strle n(sz);
36
37 }
38 };
39
19 #endif // __DEFINED__SkPdfConfig 40 #endif // __DEFINED__SkPdfConfig
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfBasics.cpp ('k') | experimental/PdfViewer/SkPdfFont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698