Index: experimental/PdfViewer/SkPdfConfig.h |
=================================================================== |
--- experimental/PdfViewer/SkPdfConfig.h (revision 11100) |
+++ experimental/PdfViewer/SkPdfConfig.h (working copy) |
@@ -8,7 +8,7 @@ |
#ifndef SkPdfConfig_DEFINED |
#define SkPdfConfig_DEFINED |
-#define PDF_TRACK_OBJECT_USAGE |
+//#define PDF_TRACK_OBJECT_USAGE |
//#define PDF_TRACK_STREAM_OFFSETS |
//#define PDF_TRACE |
//#define PDF_TRACE_READ_TOKEN |
@@ -33,4 +33,45 @@ |
#define SkPdfMarkObjectUnused() |
#endif // PDF_TRACK_OBJECT_USAGE |
+#ifdef PDF_TRACK_STREAM_OFFSETS |
+ |
+// TODO(edisonn): track source files |
+#define SkPdfTrackSrourceFile(foo) -2 |
+ |
+#define GET_TRACK_STREAM , int streamId, const unsigned char* streamStart |
+#define PUT_TRACK_STREAM_ARGS , streamId, streamStart |
+#define PUT_TRACK_STREAM(start,end) , streamId, start-streamStart, end-streamStart |
+#define PUT_TRACK_STREAM_ARGS_EXPL(a,b,c) , a, b, c |
+#define PUT_TRACK_STREAM_ARGS_EXPL2(a,b) , a, b |
+ |
+ |
+#define PUT_TRACK_PARAMETERS , streamId, offsetStart, offsetEnd |
+#define PUT_TRACK_PARAMETERS_OBJ(obj) , (obj)->streamId(), (obj)->offsetStart(), (obj)->offsetEnd() |
+#define PUT_TRACK_PARAMETERS_OBJ2(obj,objEnd) , (obj)->streamId(), (obj)->offsetStart(), (objEnd)->offsetEnd() |
+#define PUT_TRACK_PARAMETERS_SRC , SkPdfTrackSrourceFile(__FILE__), __LINE__, __LINE__ |
+#define PUT_TRACK_PARAMETERS_SRC0 SkPdfTrackSrourceFile(__FILE__), __LINE__, __LINE__ |
+#define GET_TRACK_PARAMETERS , int streamId, int offsetStart, int offsetEnd |
+#define GET_TRACK_PARAMETERS0 int streamId, int offsetStart, int offsetEnd |
+#define STORE_TRACK_PARAMETERS(obj) (obj)->fStreamId = streamId; (obj)->fOffsetStart = offsetStart; (obj)->fOffsetEnd = offsetEnd; |
+#define STORE_TRACK_PARAMETER_OFFSET_END(obj,offsetEnd) (obj)->fOffsetEnd = (offsetEnd)-streamStart; |
+#else |
+#define GET_TRACK_STREAM |
+#define PUT_TRACK_STREAM_ARGS |
+#define PUT_TRACK_STREAM(start,end) |
+#define PUT_TRACK_STREAM_ARGS_EXPL(a,b,c) |
+#define PUT_TRACK_STREAM_ARGS_EXPL2(a,b) |
+ |
+ |
+#define PUT_TRACK_PARAMETERS |
+#define PUT_TRACK_PARAMETERS_OBJ(obj) |
+#define PUT_TRACK_PARAMETERS_OBJ2(obj,objEnd) |
+#define PUT_TRACK_PARAMETERS_SRC |
+#define PUT_TRACK_PARAMETERS_SRC0 |
+#define GET_TRACK_PARAMETERS |
+#define GET_TRACK_PARAMETERS0 |
+#define STORE_TRACK_PARAMETERS(obj) |
+#define STORE_TRACK_PARAMETER_OFFSET_END(obj,offsetEnd) |
+#endif //PDF_TRACK_STREAM_OFFSETS |
+ |
+ |
#endif // SkPdfConfig_DEFINED |