edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 1 | #ifndef __DEFINED__SkPdfBasics |
| 2 | #define __DEFINED__SkPdfBasics |
| 3 | |
edisonn@google.com | 131d4ee | 2013-06-26 17:48:12 +0000 | [diff] [blame] | 4 | #include "SkCanvas.h" |
| 5 | #include "SkPaint.h" |
edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 6 | #include "SkPdfConfig.h" |
edisonn@google.com | 131d4ee | 2013-06-26 17:48:12 +0000 | [diff] [blame] | 7 | |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 8 | #include <iostream> |
| 9 | #include <cstdio> |
edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 10 | #include <map> |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 11 | #include <stack> |
| 12 | |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 13 | class SkPdfFont; |
| 14 | class SkPdfDoc; |
edisonn@google.com | 131d4ee | 2013-06-26 17:48:12 +0000 | [diff] [blame] | 15 | class SkPdfObject; |
| 16 | class SkPdfResourceDictionary; |
edisonn@google.com | 4ef4bed | 2013-07-29 22:14:45 +0000 | [diff] [blame] | 17 | class SkPdfSoftMaskDictionary; |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 18 | |
edisonn@google.com | 571c70b | 2013-07-10 17:09:50 +0000 | [diff] [blame] | 19 | class SkNativeParsedPDF; |
edisonn@google.com | 2ccc3af | 2013-07-23 17:43:18 +0000 | [diff] [blame] | 20 | class SkPdfAllocator; |
edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 21 | |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 22 | // TODO(edisonn): better class design. |
edisonn@google.com | e2e01ff | 2013-08-02 20:24:48 +0000 | [diff] [blame] | 23 | class SkPdfColorOperator { |
edisonn@google.com | a0cefa1 | 2013-07-28 18:34:14 +0000 | [diff] [blame] | 24 | |
| 25 | /* |
| 26 | color space name or array The current color space in which color values are to be interpreted |
| 27 | (see Section 4.5, “Color Spaces”). There are two separate color space |
| 28 | parameters: one for stroking and one for all other painting opera- |
| 29 | tions. Initial value: DeviceGray. |
| 30 | */ |
| 31 | |
| 32 | // TODO(edisonn): implement the array part too |
edisonn@google.com | 571c70b | 2013-07-10 17:09:50 +0000 | [diff] [blame] | 33 | // does not own the char* |
edisonn@google.com | e2e01ff | 2013-08-02 20:24:48 +0000 | [diff] [blame] | 34 | // TODO(edisonn): remove this public, let fields be private |
| 35 | // TODO(edisonn): make color space an enum! |
| 36 | public: |
edisonn@google.com | 2ccc3af | 2013-07-23 17:43:18 +0000 | [diff] [blame] | 37 | NotOwnedString fColorSpace; |
edisonn@google.com | e2e01ff | 2013-08-02 20:24:48 +0000 | [diff] [blame] | 38 | SkPdfObject* fPattern; |
edisonn@google.com | a0cefa1 | 2013-07-28 18:34:14 +0000 | [diff] [blame] | 39 | |
| 40 | /* |
| 41 | color (various) The current color to be used during painting operations (see Section |
| 42 | 4.5, “Color Spaces”). The type and interpretation of this parameter |
| 43 | depend on the current color space; for most color spaces, a color |
| 44 | value consists of one to four numbers. There are two separate color |
| 45 | parameters: one for stroking and one for all other painting opera- |
| 46 | tions. Initial value: black. |
| 47 | */ |
| 48 | |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 49 | SkColor fColor; |
| 50 | double fOpacity; // ca or CA |
edisonn@google.com | e2e01ff | 2013-08-02 20:24:48 +0000 | [diff] [blame] | 51 | |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 52 | // TODO(edisonn): add here other color space options. |
| 53 | |
edisonn@google.com | e2e01ff | 2013-08-02 20:24:48 +0000 | [diff] [blame] | 54 | public: |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 55 | void setRGBColor(SkColor color) { |
| 56 | // TODO(edisonn): ASSERT DeviceRGB is the color space. |
edisonn@google.com | e2e01ff | 2013-08-02 20:24:48 +0000 | [diff] [blame] | 57 | fPattern = NULL; |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 58 | fColor = color; |
| 59 | } |
| 60 | // TODO(edisonn): double check the default values for all fields. |
edisonn@google.com | e2e01ff | 2013-08-02 20:24:48 +0000 | [diff] [blame] | 61 | SkPdfColorOperator() : fPattern(NULL), fColor(SK_ColorBLACK), fOpacity(1) { |
| 62 | NotOwnedString::init(&fColorSpace, "DeviceRGB"); |
| 63 | } |
| 64 | |
| 65 | void setColorSpace(NotOwnedString* colorSpace) { |
| 66 | fColorSpace = *colorSpace; |
| 67 | fPattern = NULL; |
| 68 | } |
| 69 | |
| 70 | void setPatternColorSpace(SkPdfObject* pattern) { |
| 71 | fColorSpace.fBuffer = (const unsigned char*)"Pattern"; |
| 72 | fColorSpace.fBytes = 7; // strlen("Pattern") |
| 73 | fPattern = pattern; |
edisonn@google.com | 2ccc3af | 2013-07-23 17:43:18 +0000 | [diff] [blame] | 74 | } |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 75 | |
| 76 | void applyGraphicsState(SkPaint* paint) { |
edisonn@google.com | 96ba3aa | 2013-07-28 20:04:35 +0000 | [diff] [blame] | 77 | paint->setColor(SkColorSetA(fColor, (U8CPU)(fOpacity * 255))); |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 78 | } |
| 79 | }; |
| 80 | |
| 81 | // TODO(edisonn): better class design. |
edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 82 | struct SkPdfGraphicsState { |
edisonn@google.com | a0cefa1 | 2013-07-28 18:34:14 +0000 | [diff] [blame] | 83 | // TODO(edisonn): deprecate and remove these! |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 84 | double fCurPosX; |
| 85 | double fCurPosY; |
| 86 | |
| 87 | double fCurFontSize; |
| 88 | bool fTextBlock; |
| 89 | SkPdfFont* fSkFont; |
| 90 | SkPath fPath; |
| 91 | bool fPathClosed; |
| 92 | |
edisonn@google.com | a0cefa1 | 2013-07-28 18:34:14 +0000 | [diff] [blame] | 93 | |
| 94 | |
| 95 | double fTextLeading; |
| 96 | double fWordSpace; |
| 97 | double fCharSpace; |
| 98 | |
| 99 | SkPdfResourceDictionary* fResources; |
| 100 | |
| 101 | |
| 102 | // TODO(edisonn): move most of these in canvas/paint? |
| 103 | // we could have some in canvas (matrixes?), |
| 104 | // some in 2 paints (stroking paint and non stroking paint) |
| 105 | |
| 106 | // TABLE 4.2 Device-independent graphics state parameters |
| 107 | /* |
| 108 | * CTM array The current transformation matrix, which maps positions from user |
| 109 | coordinates to device coordinates (see Section 4.2, “Coordinate Sys- |
| 110 | tems”). This matrix is modified by each application of the coordi- |
| 111 | nate transformation operator, cm. Initial value: a matrix that |
| 112 | transforms default user coordinates to device coordinates. |
| 113 | */ |
| 114 | SkMatrix fCTM; |
| 115 | |
| 116 | /* |
| 117 | clipping path (internal) The current clipping path, which defines the boundary against |
| 118 | which all output is to be cropped (see Section 4.4.3, “Clipping Path |
| 119 | Operators”). Initial value: the boundary of the entire imageable |
| 120 | portion of the output page. |
| 121 | */ |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 122 | // Clip that is applied after the drawing is done!!! |
| 123 | bool fHasClipPathToApply; |
| 124 | SkPath fClipPath; |
| 125 | |
edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 126 | SkPdfColorOperator fStroking; |
| 127 | SkPdfColorOperator fNonStroking; |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 128 | |
edisonn@google.com | a0cefa1 | 2013-07-28 18:34:14 +0000 | [diff] [blame] | 129 | /* |
| 130 | text state (various) A set of nine graphics state parameters that pertain only to the |
| 131 | painting of text. These include parameters that select the font, scale |
| 132 | the glyphs to an appropriate size, and accomplish other effects. The |
| 133 | text state parameters are described in Section 5.2, “Text State |
| 134 | Parameters and Operators.” |
| 135 | */ |
| 136 | |
| 137 | // TODO(edisonn): add SkPdfTextState class. remove these two existing fields |
| 138 | SkMatrix fMatrixTm; |
| 139 | SkMatrix fMatrixTlm; |
| 140 | |
| 141 | |
| 142 | /* |
| 143 | line width number The thickness, in user space units, of paths to be stroked (see “Line |
| 144 | Width” on page 152). Initial value: 1.0. |
| 145 | */ |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 146 | double fLineWidth; |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 147 | |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 148 | |
edisonn@google.com | a0cefa1 | 2013-07-28 18:34:14 +0000 | [diff] [blame] | 149 | /* |
| 150 | line cap integer A code specifying the shape of the endpoints for any open path that |
| 151 | is stroked (see “Line Cap Style” on page 153). Initial value: 0, for |
| 152 | square butt caps. |
| 153 | */ |
| 154 | // TODO (edisonn): implement defaults - page 153 |
| 155 | int fLineCap; |
| 156 | |
| 157 | /* |
| 158 | line join integer A code specifying the shape of joints between connected segments |
| 159 | of a stroked path (see “Line Join Style” on page 153). Initial value: 0, |
| 160 | for mitered joins. |
| 161 | */ |
| 162 | // TODO (edisonn): implement defaults - page 153 |
| 163 | int fLineJoin; |
| 164 | |
| 165 | /* |
| 166 | miter limit number The maximum length of mitered line joins for stroked paths (see |
| 167 | “Miter Limit” on page 153). This parameter limits the length of |
| 168 | “spikes” produced when line segments join at sharp angles. Initial |
| 169 | value: 10.0, for a miter cutoff below approximately 11.5 degrees. |
| 170 | */ |
| 171 | // TODO (edisonn): implement defaults - page 153 |
| 172 | double fMiterLimit; |
| 173 | |
| 174 | /* |
| 175 | dash pattern array and A description of the dash pattern to be used when paths are |
| 176 | number stroked (see “Line Dash Pattern” on page 155). Initial value: a solid |
| 177 | line. |
| 178 | */ |
| 179 | SkScalar fDashArray[256]; // TODO(edisonn): allocate array? |
| 180 | int fDashArrayLength; |
| 181 | SkScalar fDashPhase; |
| 182 | |
| 183 | |
| 184 | /* |
| 185 | rendering intent name The rendering intent to be used when converting CIE-based colors |
| 186 | to device colors (see “Rendering Intents” on page 197). Default |
| 187 | value: RelativeColorimetric. |
| 188 | */ |
| 189 | // TODO(edisonn): seems paper only. Verify. |
| 190 | |
| 191 | /* |
| 192 | stroke adjustment boolean (PDF 1.2) A flag specifying whether to compensate for possible ras- |
| 193 | terization effects when stroking a path with a line width that is |
| 194 | small relative to the pixel resolution of the output device (see Sec- |
| 195 | tion 6.5.4, “Automatic Stroke Adjustment”). Note that this is con- |
| 196 | sidered a device-independent parameter, even though the details of |
| 197 | its effects are device-dependent. Initial value: false. |
| 198 | */ |
| 199 | // TODO(edisonn): stroke adjustment low priority. |
| 200 | |
| 201 | |
| 202 | /* |
| 203 | blend mode name or array (PDF 1.4) The current blend mode to be used in the transparent |
| 204 | imaging model (see Sections 7.2.4, “Blend Mode,” and 7.5.2, “Spec- |
| 205 | ifying Blending Color Space and Blend Mode”). This parameter is |
| 206 | implicitly reset to its initial value at the beginning of execution of a |
| 207 | transparency group XObject (see Section 7.5.5, “Transparency |
| 208 | Group XObjects”). Initial value: Normal. |
| 209 | */ |
edisonn@google.com | e878e72 | 2013-07-29 19:10:58 +0000 | [diff] [blame] | 210 | SkXfermode::Mode fBlendModes[256]; |
| 211 | int fBlendModesLength; |
edisonn@google.com | a0cefa1 | 2013-07-28 18:34:14 +0000 | [diff] [blame] | 212 | |
| 213 | /* |
| 214 | soft mask dictionary (PDF 1.4) A soft-mask dictionary (see “Soft-Mask Dictionaries” on |
| 215 | or name page 445) specifying the mask shape or mask opacity values to be |
| 216 | used in the transparent imaging model (see “Source Shape and |
| 217 | Opacity” on page 421 and “Mask Shape and Opacity” on page 443), |
| 218 | or the name None if no such mask is specified. This parameter is |
| 219 | implicitly reset to its initial value at the beginning of execution of a |
| 220 | transparency group XObject (see Section 7.5.5, “Transparency |
| 221 | Group XObjects”). Initial value: None. |
| 222 | */ |
edisonn@google.com | 4ef4bed | 2013-07-29 22:14:45 +0000 | [diff] [blame] | 223 | SkPdfSoftMaskDictionary* fSoftMaskDictionary; |
edisonn@google.com | b0145ce | 2013-08-05 16:23:23 +0000 | [diff] [blame] | 224 | // TODO(edisonn): make sMask private, add setter and getter, ref/unref/..., at the moment we most likely leask |
| 225 | SkBitmap* fSMask; |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 226 | |
edisonn@google.com | a0cefa1 | 2013-07-28 18:34:14 +0000 | [diff] [blame] | 227 | |
| 228 | /* |
| 229 | alpha constant number (PDF 1.4) The constant shape or constant opacity value to be used |
| 230 | in the transparent imaging model (see “Source Shape and Opacity” |
| 231 | on page 421 and “Constant Shape and Opacity” on page 444). |
| 232 | There are two separate alpha constant parameters: one for stroking |
| 233 | and one for all other painting operations. This parameter is implic- |
| 234 | itly reset to its initial value at the beginning of execution of a trans- |
| 235 | parency group XObject (see Section 7.5.5, “Transparency Group |
| 236 | XObjects”). Initial value: 1.0. |
| 237 | */ |
| 238 | double fAphaConstant; |
| 239 | |
| 240 | /* |
| 241 | alpha source boolean (PDF 1.4) A flag specifying whether the current soft mask and alpha |
| 242 | constant parameters are to be interpreted as shape values (true) or |
| 243 | opacity values (false). This flag also governs the interpretation of |
| 244 | the SMask entry, if any, in an image dictionary (see Section 4.8.4, |
| 245 | “Image Dictionaries”). Initial value: false. |
| 246 | */ |
| 247 | bool fAlphaSource; |
| 248 | |
| 249 | |
| 250 | // TODO(edisonn): Device-dependent seem to be required only on the actual physical printer? |
| 251 | // TABLE 4.3 Device-dependent graphics state parameters |
| 252 | /* |
| 253 | overprint boolean (PDF 1.2) A flag specifying (on output devices that support the |
| 254 | overprint control feature) whether painting in one set of colorants |
| 255 | should cause the corresponding areas of other colorants to be |
| 256 | erased (false) or left unchanged (true); see Section 4.5.6, “Over- |
| 257 | print Control.” In PDF 1.3, there are two separate overprint param- |
| 258 | eters: one for stroking and one for all other painting operations. |
| 259 | Initial value: false. |
| 260 | */ |
| 261 | |
| 262 | |
| 263 | /* |
| 264 | overprint mode number (PDF 1.3) A code specifying whether a color component value of 0 |
| 265 | in a DeviceCMYK color space should erase that component (0) or |
| 266 | leave it unchanged (1) when overprinting (see Section 4.5.6, “Over- |
| 267 | print Control”). Initial value: 0. |
| 268 | */ |
| 269 | |
| 270 | |
| 271 | /* |
| 272 | black generation function (PDF 1.2) A function that calculates the level of the black color |
| 273 | or name component to use when converting RGB colors to CMYK (see Sec- |
| 274 | tion 6.2.3, “Conversion from DeviceRGB to DeviceCMYK”). Initial |
| 275 | value: installation-dependent. |
| 276 | */ |
| 277 | |
| 278 | |
| 279 | /* |
| 280 | undercolor removal function (PDF 1.2) A function that calculates the reduction in the levels of |
| 281 | or name the cyan, magenta, and yellow color components to compensate for |
| 282 | the amount of black added by black generation (see Section 6.2.3, |
| 283 | “Conversion from DeviceRGB to DeviceCMYK”). Initial value: in- |
| 284 | stallation-dependent. |
| 285 | */ |
| 286 | |
| 287 | |
| 288 | /* |
| 289 | transfer function, (PDF 1.2) A function that adjusts device gray or color component |
| 290 | array, or name levels to compensate for nonlinear response in a particular out- |
| 291 | put device (see Section 6.3, “Transfer Functions”). Initial value: |
| 292 | installation-dependent. |
| 293 | */ |
| 294 | |
| 295 | |
| 296 | /* |
| 297 | halftone dictionary, (PDF 1.2) A halftone screen for gray and color rendering, specified |
| 298 | stream, or name as a halftone dictionary or stream (see Section 6.4, “Halftones”). |
| 299 | Initial value: installation-dependent. |
| 300 | */ |
| 301 | |
| 302 | |
| 303 | /* |
| 304 | flatness number The precision with which curves are to be rendered on the output |
| 305 | device (see Section 6.5.1, “Flatness Tolerance”). The value of this |
| 306 | parameter gives the maximum error tolerance, measured in output |
| 307 | device pixels; smaller numbers give smoother curves at the expense |
| 308 | of more computation and memory use. Initial value: 1.0. |
| 309 | */ |
| 310 | |
| 311 | |
| 312 | /* |
| 313 | smoothness number (PDF 1.3) The precision with which color gradients are to be ren- |
| 314 | dered on the output device (see Section 6.5.2, “Smoothness Toler- |
| 315 | ance”). The value of this parameter gives the maximum error |
| 316 | tolerance, expressed as a fraction of the range of each color compo- |
| 317 | nent; smaller numbers give smoother color transitions at the |
| 318 | expense of more computation and memory use. Initial value: |
| 319 | installation-dependent. |
| 320 | */ |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 328 | SkPdfGraphicsState() { |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 329 | fCurPosX = 0.0; |
| 330 | fCurPosY = 0.0; |
| 331 | fCurFontSize = 0.0; |
| 332 | fTextBlock = false; |
edisonn@google.com | a0cefa1 | 2013-07-28 18:34:14 +0000 | [diff] [blame] | 333 | fCTM = SkMatrix::I(); |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 334 | fMatrixTm = SkMatrix::I(); |
| 335 | fMatrixTlm = SkMatrix::I(); |
| 336 | fPathClosed = true; |
| 337 | fLineWidth = 0; |
| 338 | fTextLeading = 0; |
| 339 | fWordSpace = 0; |
| 340 | fCharSpace = 0; |
| 341 | fHasClipPathToApply = false; |
| 342 | fResources = NULL; |
| 343 | fSkFont = NULL; |
edisonn@google.com | a0cefa1 | 2013-07-28 18:34:14 +0000 | [diff] [blame] | 344 | fLineCap = 0; |
| 345 | fLineJoin = 0; |
| 346 | fMiterLimit = 10.0; |
| 347 | fAphaConstant = 1.0; |
| 348 | fAlphaSource = false; |
| 349 | fDashArrayLength = 0; |
| 350 | fDashPhase = 0; |
edisonn@google.com | e878e72 | 2013-07-29 19:10:58 +0000 | [diff] [blame] | 351 | fBlendModesLength = 1; |
| 352 | fBlendModes[0] = SkXfermode::kSrc_Mode; // PDF: Normal Blend mode |
edisonn@google.com | 91ce698 | 2013-08-05 20:45:40 +0000 | [diff] [blame^] | 353 | fSMask = NULL; |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 354 | } |
| 355 | |
edisonn@google.com | a0cefa1 | 2013-07-28 18:34:14 +0000 | [diff] [blame] | 356 | // TODO(edisonn): make two functons instead, stroking and non stoking, avoid branching |
| 357 | void applyGraphicsState(SkPaint* paint, bool stroking); |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 358 | }; |
| 359 | |
| 360 | // TODO(edisonn): better class design. |
edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 361 | // TODO(edisonn): could we remove it? |
| 362 | // TODO(edisonn): rename to SkPdfInlineImage |
| 363 | struct SkPdfInlineImage { |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 364 | std::map<std::string, std::string> fKeyValuePairs; |
| 365 | std::string fImageData; |
| 366 | }; |
| 367 | |
| 368 | // TODO(edisonn): better class design. |
edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 369 | // TODO(edisonn): rename to SkPdfContext |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 370 | struct PdfContext { |
| 371 | std::stack<SkPdfObject*> fObjectStack; |
edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 372 | std::stack<SkPdfGraphicsState> fStateStack; |
| 373 | SkPdfGraphicsState fGraphicsState; |
edisonn@google.com | 571c70b | 2013-07-10 17:09:50 +0000 | [diff] [blame] | 374 | SkNativeParsedPDF* fPdfDoc; |
edisonn@google.com | 2ccc3af | 2013-07-23 17:43:18 +0000 | [diff] [blame] | 375 | // TODO(edisonn): the allocator, could be freed after the page is done drawing. |
| 376 | SkPdfAllocator* fTmpPageAllocator; |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 377 | SkMatrix fOriginalMatrix; |
| 378 | |
edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 379 | SkPdfInlineImage fInlineImage; |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 380 | |
edisonn@google.com | 2ccc3af | 2013-07-23 17:43:18 +0000 | [diff] [blame] | 381 | PdfContext(SkNativeParsedPDF* doc); |
| 382 | ~PdfContext(); |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 383 | }; |
| 384 | |
edisonn@google.com | 3aac1f9 | 2013-07-02 22:42:53 +0000 | [diff] [blame] | 385 | // TODO(edisonn): temporary code, to report how much of the PDF we actually think we rendered. |
| 386 | // TODO(edisonn): rename to SkPdfResult |
edisonn@google.com | b857a0c | 2013-06-25 20:45:40 +0000 | [diff] [blame] | 387 | enum PdfResult { |
| 388 | kOK_PdfResult, |
| 389 | kPartial_PdfResult, |
| 390 | kNYI_PdfResult, |
| 391 | kIgnoreError_PdfResult, |
| 392 | kError_PdfResult, |
| 393 | kUnsupported_PdfResult, |
| 394 | |
| 395 | kCount_PdfResult |
| 396 | }; |
| 397 | |
| 398 | #endif // __DEFINED__SkPdfBasics |