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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/PdfViewer/SkPdfBasics.cpp ('k') | experimental/PdfViewer/SkPdfFont.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/PdfViewer/SkPdfConfig.h
===================================================================
--- experimental/PdfViewer/SkPdfConfig.h (revision 10235)
+++ experimental/PdfViewer/SkPdfConfig.h (working copy)
@@ -2,6 +2,7 @@
#define __DEFINED__SkPdfConfig
//#define PDF_TRACE
+//#define PDF_TRACE_READ_TOKEN
//#define PDF_TRACE_DIFF_IN_PNG
//#define PDF_DEBUG_NO_CLIPING
//#define PDF_DEBUG_NO_PAGE_CLIPING
@@ -16,4 +17,24 @@
#define SkTraceRect(a,b)
#endif
+struct NotOwnedString {
+ const unsigned char* fBuffer;
+ size_t fBytes;
+
+ static void init(NotOwnedString* str) {
+ str->fBuffer = NULL;
+ str->fBytes = 0;
+ }
+
+ static void init(NotOwnedString* str, const char* sz) {
+ str->fBuffer = (const unsigned char*)sz;
+ str->fBytes = strlen(sz);
+ }
+
+ bool equals(const char* sz) {
+ return strncmp((const char*)fBuffer, sz, fBytes) == 0 && fBytes == strlen(sz);
+
+ }
+};
+
#endif // __DEFINED__SkPdfConfig
« 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