| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 SkPDFDevice_DEFINED | 8 #ifndef SkPDFDevice_DEFINED |
| 9 #define SkPDFDevice_DEFINED | 9 #define SkPDFDevice_DEFINED |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 * for larger PDF files too, which would use more memory | 58 * for larger PDF files too, which would use more memory |
| 59 * while rendering, and it would be slower to be processed | 59 * while rendering, and it would be slower to be processed |
| 60 * or sent online or to printer. A good choice is | 60 * or sent online or to printer. A good choice is |
| 61 * SK_ScalarDefaultRasterDPI(72.0f). | 61 * SK_ScalarDefaultRasterDPI(72.0f). |
| 62 * @param SkPDFCanon. Should be non-null, and shared by all | 62 * @param SkPDFCanon. Should be non-null, and shared by all |
| 63 * devices in a document. | 63 * devices in a document. |
| 64 */ | 64 */ |
| 65 static SkPDFDevice* Create(SkISize pageSize, | 65 static SkPDFDevice* Create(SkISize pageSize, |
| 66 SkScalar rasterDpi, | 66 SkScalar rasterDpi, |
| 67 SkPDFCanon* canon) { | 67 SkPDFCanon* canon) { |
| 68 return SkNEW_ARGS(SkPDFDevice, (pageSize, rasterDpi, canon, true)); | 68 return new SkPDFDevice(pageSize, rasterDpi, canon, true); |
| 69 } | 69 } |
| 70 | 70 |
| 71 /** Create a PDF drawing context without fipping the y-axis. */ | 71 /** Create a PDF drawing context without fipping the y-axis. */ |
| 72 static SkPDFDevice* CreateUnflipped(SkISize pageSize, | 72 static SkPDFDevice* CreateUnflipped(SkISize pageSize, |
| 73 SkScalar rasterDpi, | 73 SkScalar rasterDpi, |
| 74 SkPDFCanon* canon) { | 74 SkPDFCanon* canon) { |
| 75 return SkNEW_ARGS(SkPDFDevice, (pageSize, rasterDpi, canon, false)); | 75 return new SkPDFDevice(pageSize, rasterDpi, canon, false); |
| 76 } | 76 } |
| 77 | 77 |
| 78 virtual ~SkPDFDevice(); | 78 virtual ~SkPDFDevice(); |
| 79 | 79 |
| 80 /** These are called inside the per-device-layer loop for each draw call. | 80 /** These are called inside the per-device-layer loop for each draw call. |
| 81 When these are called, we have already applied any saveLayer operations, | 81 When these are called, we have already applied any saveLayer operations, |
| 82 and are handling any looping from the paint, and any effects from the | 82 and are handling any looping from the paint, and any effects from the |
| 83 DrawFilter. | 83 DrawFilter. |
| 84 */ | 84 */ |
| 85 void drawPaint(const SkDraw&, const SkPaint& paint) override; | 85 void drawPaint(const SkDraw&, const SkPaint& paint) override; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 | 295 |
| 296 typedef SkBaseDevice INHERITED; | 296 typedef SkBaseDevice INHERITED; |
| 297 | 297 |
| 298 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create | 298 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create |
| 299 // an SkPDFDevice | 299 // an SkPDFDevice |
| 300 //friend class SkDocument_PDF; | 300 //friend class SkDocument_PDF; |
| 301 //friend class SkPDFImageShader; | 301 //friend class SkPDFImageShader; |
| 302 }; | 302 }; |
| 303 | 303 |
| 304 #endif | 304 #endif |
| OLD | NEW |