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

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

Issue 26700002: remove tracking code, as it polutes the code readability. Should be added back, in a less eficient … (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 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 | « no previous file | experimental/PdfViewer/pdf_viewer_main.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 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkPdfConfig_DEFINED 8 #ifndef SkPdfConfig_DEFINED
9 #define SkPdfConfig_DEFINED 9 #define SkPdfConfig_DEFINED
10 10
11 #include "stddef.h" 11 #include "stddef.h"
12 class SkPdfNativeObject; 12 class SkPdfNativeObject;
13 13
14 // shows what objects have not been used in rendering. can be used to track what features we might
15 // have not implemented, or where we implemented only the default behaivour
14 //#define PDF_TRACK_OBJECT_USAGE 16 //#define PDF_TRACK_OBJECT_USAGE
17
18 // tracks the position in the stream, it can be used to show where exactly the e rrors happened
15 //#define PDF_TRACK_STREAM_OFFSETS 19 //#define PDF_TRACK_STREAM_OFFSETS
20
21 // reports issues, warning, NYI, errors, ...
22 // enable PDF_TRACK_STREAM_OFFSETS to also have the offset in the stream where t he error happened
16 //#define PDF_REPORT 23 //#define PDF_REPORT
24
25 // At various points in code we show the value of important variables with this flag
17 //#define PDF_TRACE 26 //#define PDF_TRACE
27
28 // displays the result of each read token, individual result
18 //#define PDF_TRACE_READ_TOKEN 29 //#define PDF_TRACE_READ_TOKEN
30
31 // Every drawtext draws before a rectangle, in this way we see the one that migh t have failed
19 //#define PDF_TRACE_DRAWTEXT 32 //#define PDF_TRACE_DRAWTEXT
33
34 // For each render operations, it will dump the canvas in a png
20 //#define PDF_TRACE_DIFF_IN_PNG 35 //#define PDF_TRACE_DIFF_IN_PNG
36
37 // Does not clip at all, can be used in debugging issues
21 //#define PDF_DEBUG_NO_CLIPING 38 //#define PDF_DEBUG_NO_CLIPING
39
40 // Does not click the page, use is with 3x
22 //#define PDF_DEBUG_NO_PAGE_CLIPING 41 //#define PDF_DEBUG_NO_PAGE_CLIPING
42
43 // render the page 3X bigger (with content in center) - used to make sure we don 't mess up
44 // positioning
45 // like a tick tac toe board, only the center one has content, all the rest of t hem have to be clean
23 //#define PDF_DEBUG_3X 46 //#define PDF_DEBUG_3X
24 47
25 48
26 // TODO(edisonn): pass a flag to say how it was used? e.g. asked the type? Obtai ned value? 49 // TODO(edisonn): pass a flag to say how it was used? e.g. asked the type? Obtai ned value?
27 // Implement it when it will be needed the first time to fix some bug. 50 // Implement it when it will be needed the first time to fix some bug.
28 #ifdef PDF_TRACK_OBJECT_USAGE 51 #ifdef PDF_TRACK_OBJECT_USAGE
29 #define SkPdfMarkObjectUsed() fUsed = true 52 #define SkPdfMarkObjectUsed() fUsed = true
30 #else 53 #else
31 #define SkPdfMarkObjectUsed() 54 #define SkPdfMarkObjectUsed()
32 #endif // PDF_TRACK_OBJECT_USAGE 55 #endif // PDF_TRACK_OBJECT_USAGE
33 56
34 #ifdef PDF_TRACK_OBJECT_USAGE 57 #ifdef PDF_TRACK_OBJECT_USAGE
35 #define SkPdfMarkObjectUnused() fUsed = false 58 #define SkPdfMarkObjectUnused() fUsed = false
36 #else 59 #else
37 #define SkPdfMarkObjectUnused() 60 #define SkPdfMarkObjectUnused()
38 #endif // PDF_TRACK_OBJECT_USAGE 61 #endif // PDF_TRACK_OBJECT_USAGE
39 62
40 #ifdef PDF_TRACK_STREAM_OFFSETS 63 #ifdef PDF_TRACK_STREAM_OFFSETS
41
42 // TODO(edisonn): track source files
43 #define SkPdfTrackSrourceFile(foo) -2
44
45 #define GET_TRACK_STREAM , int streamId, const unsigned char* streamStart
46 #define PUT_TRACK_STREAM_ARGS , streamId, streamStart
47 #define PUT_TRACK_STREAM(start,end) , streamId, start-streamStart, end-streamSta rt
48 #define PUT_TRACK_STREAM_ARGS_EXPL(a,b,c) , a, b, c
49 #define PUT_TRACK_STREAM_ARGS_EXPL2(a,b) , a, b
50
51
52 #define PUT_TRACK_PARAMETERS , streamId, offsetStart, offsetEnd
53 #define PUT_TRACK_PARAMETERS_OBJ(obj) , (obj)->streamId(), (obj)->offsetStart(), (obj)->offsetEnd()
54 #define PUT_TRACK_PARAMETERS_OBJ2(obj,objEnd) , (obj)->streamId(), (obj)->offset Start(), (objEnd)->offsetEnd()
55 #define PUT_TRACK_PARAMETERS_SRC , SkPdfTrackSrourceFile(__FILE__), __LINE__, __ LINE__
56 #define PUT_TRACK_PARAMETERS_SRC0 SkPdfTrackSrourceFile(__FILE__), __LINE__, __ LINE__
57 #define GET_TRACK_PARAMETERS , int streamId, int offsetStart, int offsetEnd
58 #define GET_TRACK_PARAMETERS0 int streamId, int offsetStart, int offsetEnd
59 #define STORE_TRACK_PARAMETERS(obj) (obj)->fStreamId = streamId; (obj)->fOffsetS tart = offsetStart; (obj)->fOffsetEnd = offsetEnd; 64 #define STORE_TRACK_PARAMETERS(obj) (obj)->fStreamId = streamId; (obj)->fOffsetS tart = offsetStart; (obj)->fOffsetEnd = offsetEnd;
60 #define STORE_TRACK_PARAMETER_OFFSET_END(obj,offsetEnd) (obj)->fOffsetEnd = (off setEnd)-streamStart; 65 #define STORE_TRACK_PARAMETER_OFFSET_END(obj,offsetEnd) (obj)->fOffsetEnd = (off setEnd)-streamStart;
61 #else 66 #else
62 #define GET_TRACK_STREAM
63 #define PUT_TRACK_STREAM_ARGS
64 #define PUT_TRACK_STREAM(start,end)
65 #define PUT_TRACK_STREAM_ARGS_EXPL(a,b,c)
66 #define PUT_TRACK_STREAM_ARGS_EXPL2(a,b)
67
68
69 #define PUT_TRACK_PARAMETERS
70 #define PUT_TRACK_PARAMETERS_OBJ(obj)
71 #define PUT_TRACK_PARAMETERS_OBJ2(obj,objEnd)
72 #define PUT_TRACK_PARAMETERS_SRC
73 #define PUT_TRACK_PARAMETERS_SRC0
74 #define GET_TRACK_PARAMETERS
75 #define GET_TRACK_PARAMETERS0
76 #define STORE_TRACK_PARAMETERS(obj) 67 #define STORE_TRACK_PARAMETERS(obj)
77 #define STORE_TRACK_PARAMETER_OFFSET_END(obj,offsetEnd) 68 #define STORE_TRACK_PARAMETER_OFFSET_END(obj,offsetEnd)
78 #endif //PDF_TRACK_STREAM_OFFSETS 69 #endif //PDF_TRACK_STREAM_OFFSETS
79 70
80 // TODO(edisonn): move it somewhere else? 71 // TODO(edisonn): move it somewhere else?
81 struct SkPdfInputStream { 72 struct SkPdfInputStream {
82 #ifdef PDF_TRACK_STREAM_OFFSETS 73 #ifdef PDF_TRACK_STREAM_OFFSETS
83 // no parent object -> original file to be rendered 74 // no parent object -> original file to be rendered
84 // no parent file -> stream object 75 // no parent file -> stream object
85 // both -> external stream object 76 // both -> external stream object
(...skipping 15 matching lines...) Expand all
101 #ifdef PDF_TRACK_STREAM_OFFSETS 92 #ifdef PDF_TRACK_STREAM_OFFSETS
102 struct SkPdfInputStreamRange { 93 struct SkPdfInputStreamRange {
103 SkPdfInputStream fInputStream; 94 SkPdfInputStream fInputStream;
104 const unsigned char* fRangeStart; 95 const unsigned char* fRangeStart;
105 const unsigned char* fRangeEnd; 96 const unsigned char* fRangeEnd;
106 }; 97 };
107 #endif // PDF_TRACK_STREAM_OFFSETS 98 #endif // PDF_TRACK_STREAM_OFFSETS
108 99
109 100
110 #endif // SkPdfConfig_DEFINED 101 #endif // SkPdfConfig_DEFINED
OLDNEW
« no previous file with comments | « no previous file | experimental/PdfViewer/pdf_viewer_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698