OLD | NEW |
1 PDF Theory of Operation | 1 PDF Theory of Operation |
2 ======================= | 2 ======================= |
3 | 3 |
4 <!-- | 4 <!-- |
5 PRE-GIT DOCUMENT VERSION HISTORY | 5 PRE-GIT DOCUMENT VERSION HISTORY |
6 2012-06-25 Steve VanDeBogart | 6 2012-06-25 Steve VanDeBogart |
7 * Original version | 7 * Original version |
8 2015-01-14 Hal Canary. | 8 2015-01-14 Hal Canary. |
9 * Add section "Using the PDF backend" | 9 * Add section "Using the PDF backend" |
10 * Markdown formatting | 10 * Markdown formatting |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 single PDF. To ensure that there is only one copy of each object | 250 single PDF. To ensure that there is only one copy of each object |
251 instance these objects an implemented with an | 251 instance these objects an implemented with an |
252 [interning pattern](http://en.wikipedia.org/wiki/String_interning). | 252 [interning pattern](http://en.wikipedia.org/wiki/String_interning). |
253 As such, the classes representing these objects (like | 253 As such, the classes representing these objects (like |
254 SkPDFGraphicState) have private constructors and static methods to | 254 SkPDFGraphicState) have private constructors and static methods to |
255 retrieve an instance of the class. Internally, the class has a list of | 255 retrieve an instance of the class. Internally, the class has a list of |
256 unique instances that it consults before returning a new instance of | 256 unique instances that it consults before returning a new instance of |
257 the class. If the requested instance already exists, the existing one | 257 the class. If the requested instance already exists, the existing one |
258 is returned. For obvious reasons, the returned instance should not be | 258 is returned. For obvious reasons, the returned instance should not be |
259 modified. A mechanism to ensure that interned classes are immutable is | 259 modified. A mechanism to ensure that interned classes are immutable is |
260 needed. See [issue 2683](http://skbug.com/2683). | 260 needed. See [issue 2683](https://bug.skia.org/2683). |
261 | 261 |
262 <a name="Graphic_States"></a> | 262 <a name="Graphic_States"></a> |
263 Graphic States | 263 Graphic States |
264 -------------- | 264 -------------- |
265 | 265 |
266 PDF has a number of parameters that affect how things are drawn. The | 266 PDF has a number of parameters that affect how things are drawn. The |
267 ones that correspond to drawing options in Skia are: color, alpha, | 267 ones that correspond to drawing options in Skia are: color, alpha, |
268 line cap, line join type, line width, miter limit, and xfer/blend mode | 268 line cap, line join type, line width, miter limit, and xfer/blend mode |
269 (see later section for xfer modes). With the exception of color, these | 269 (see later section for xfer modes). With the exception of color, these |
270 can all be specified in a single pdf object, represented by the | 270 can all be specified in a single pdf object, represented by the |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 365 |
366 <a name="Drawing_details"></a> | 366 <a name="Drawing_details"></a> |
367 Drawing details | 367 Drawing details |
368 --------------- | 368 --------------- |
369 | 369 |
370 Certain objects have specific properties that need to be dealt | 370 Certain objects have specific properties that need to be dealt |
371 with. Images, layers (see below), and fonts assume the standard PDF | 371 with. Images, layers (see below), and fonts assume the standard PDF |
372 coordinate system, so we have to undo any flip to the Skia coordinate | 372 coordinate system, so we have to undo any flip to the Skia coordinate |
373 system before drawing these entities. We don’t currently support | 373 system before drawing these entities. We don’t currently support |
374 inverted paths, so filling an inverted path will give the wrong result | 374 inverted paths, so filling an inverted path will give the wrong result |
375 ([issue 241](http://skbug.com/241)). PDF doesn’t draw zero length | 375 ([issue 241](https://bug.skia.org/241)). PDF doesn’t draw zero length |
376 lines that have butt of square caps, so that is emulated. | 376 lines that have butt of square caps, so that is emulated. |
377 | 377 |
378 <a name="Layers"></a> | 378 <a name="Layers"></a> |
379 ### Layers ### | 379 ### Layers ### |
380 | 380 |
381 PDF has a higher level object called a form x-object (form external | 381 PDF has a higher level object called a form x-object (form external |
382 object) that is basically a PDF page, with resources and a content | 382 object) that is basically a PDF page, with resources and a content |
383 stream, but can be transformed and drawn on an existing page. This is | 383 stream, but can be transformed and drawn on an existing page. This is |
384 used to implement layers. SkDevice has a method, | 384 used to implement layers. SkDevice has a method, |
385 createFormXObjectFromDevice, which uses the SkPDFDevice::content() | 385 createFormXObjectFromDevice, which uses the SkPDFDevice::content() |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 Dst (or not). SrcIn is SrcMode with Src drawn with Dst as a | 566 Dst (or not). SrcIn is SrcMode with Src drawn with Dst as a |
567 mask. SrcOut is like SrcMode, but with Src drawn with an inverted Dst | 567 mask. SrcOut is like SrcMode, but with Src drawn with an inverted Dst |
568 as a mask. DstIn is SrcMode with Dst drawn with Src as a | 568 as a mask. DstIn is SrcMode with Dst drawn with Src as a |
569 mask. Finally, DstOut is SrcMode with Dst draw with an inverted Src as | 569 mask. Finally, DstOut is SrcMode with Dst draw with an inverted Src as |
570 a mask. | 570 a mask. |
571 | 571 |
572 <a name="Known_issues"></a> | 572 <a name="Known_issues"></a> |
573 Known issues | 573 Known issues |
574 ------------ | 574 ------------ |
575 | 575 |
576 * [issue 241](http://skbug.com/241) | 576 * [issue 241](https://bug.skia.org/241) |
577 As previously noted, a boolean geometry library | 577 As previously noted, a boolean geometry library |
578 would improve clip fidelity in some places, add supported for | 578 would improve clip fidelity in some places, add supported for |
579 inverted fill types, as well as simplify code. | 579 inverted fill types, as well as simplify code. |
580 This is fixed, but behind a flag until path ops is production ready. | 580 This is fixed, but behind a flag until path ops is production ready. |
581 * [issue 237](http://skbug.com/237) | 581 * [issue 237](https://bug.skia.org/237) |
582 SkMaskFilter is not supported. | 582 SkMaskFilter is not supported. |
583 * [issue 238](http://skbug.com/238) | 583 * [issue 238](https://bug.skia.org/238) |
584 SkColorFilter is not supported. | 584 SkColorFilter is not supported. |
585 * [issue 249](http://skbug.com/249) | 585 * [issue 249](https://bug.skia.org/249) |
586 SrcAtop Xor, and Plus xfer modes are not supported. | 586 SrcAtop Xor, and Plus xfer modes are not supported. |
587 * [issue 240](http://skbug.com/240) | 587 * [issue 240](https://bug.skia.org/240) |
588 drawVerticies is not implemented. | 588 drawVerticies is not implemented. |
589 * [issue 244](http://skbug.com/244) | 589 * [issue 244](https://bug.skia.org/244) |
590 Mostly, only TTF fonts are directly supported. (User metrics | 590 Mostly, only TTF fonts are directly supported. (User metrics |
591 show that almost all fonts are truetype. | 591 show that almost all fonts are truetype. |
592 * [issue 260](http://skbug.com/260) | 592 * [issue 260](https://bug.skia.org/260) |
593 Page rotation is accomplished by specifying a different | 593 Page rotation is accomplished by specifying a different |
594 size page instead of including the appropriate rotation | 594 size page instead of including the appropriate rotation |
595 annotation. | 595 annotation. |
596 | 596 |
597 * * * | 597 * * * |
598 | 598 |
OLD | NEW |