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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/PdfViewer/SkPdfRenderer.cpp ('k') | experimental/PdfViewer/generate_code.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/PdfViewer/SkPdfUtils.h
===================================================================
--- experimental/PdfViewer/SkPdfUtils.h (revision 10712)
+++ experimental/PdfViewer/SkPdfUtils.h (working copy)
@@ -1,12 +1,60 @@
#ifndef __DEFINED__SkPdfUtils
#define __DEFINED__SkPdfUtils
-#include "SkPdfBasics.h"
+#include "SkMatrix.h"
+#include "SkRect.h"
class SkPdfArray;
+class SkPdfContext;
+class SkCanvas;
+class SkPdfNativeObject;
+// TODO(edisonn): temporary code, to report how much of the PDF we actually think we rendered.
+enum SkPdfResult {
+ kOK_SkPdfResult,
+ kPartial_SkPdfResult,
+ kNYI_SkPdfResult,
+ kIgnoreError_SkPdfResult,
+ kError_SkPdfResult,
+ kUnsupported_SkPdfResult,
+
+ kCount_SkPdfResult
+};
+
+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);
+
+ }
+};
+
SkMatrix SkMatrixFromPdfArray(SkPdfArray* pdfArray);
-PdfResult doType3Char(PdfContext* pdfContext, SkCanvas* canvas, const SkPdfObject* skobj, SkRect bBox, SkMatrix matrix, double textSize);
+SkPdfResult doType3Char(SkPdfContext* pdfContext, SkCanvas* canvas, const SkPdfNativeObject* skobj, SkRect bBox, SkMatrix matrix, double textSize);
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// TRACE functions
+//
+#ifdef PDF_TRACE
+void SkTraceMatrix(const SkMatrix& matrix, const char* sz);
+void SkTraceRect(const SkRect& rect, const char* sz);
+#else
+#define SkTraceMatrix(a,b)
+#define SkTraceRect(a,b)
+#endif
+
#endif // __DEFINED__SkPdfUtils
« 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