commit-bot@chromium.org | 4740135 | 2013-07-23 21:49:29 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkPDFResourceDict_DEFINED |
| 9 | #define SkPDFResourceDict_DEFINED |
| 10 | |
Hal Canary | 9e41c21 | 2018-09-03 12:00:23 -0400 | [diff] [blame] | 11 | #include "SkPDFFont.h" |
martina.kollarova | b8d6af1 | 2016-06-29 05:12:31 -0700 | [diff] [blame] | 12 | |
Hal Canary | 9e41c21 | 2018-09-03 12:00:23 -0400 | [diff] [blame] | 13 | #include <vector> |
| 14 | |
martina.kollarova | b8d6af1 | 2016-06-29 05:12:31 -0700 | [diff] [blame] | 15 | class SkPDFDict; |
| 16 | class SkPDFObject; |
Hal Canary | e650b85 | 2018-09-12 09:12:36 -0400 | [diff] [blame] | 17 | class SkWStream; |
commit-bot@chromium.org | 4740135 | 2013-07-23 21:49:29 +0000 | [diff] [blame] | 18 | |
Hal Canary | e650b85 | 2018-09-12 09:12:36 -0400 | [diff] [blame] | 19 | enum class SkPDFResourceType { |
| 20 | kExtGState = 0, |
| 21 | kPattern = 1, |
| 22 | kXObject = 2, |
| 23 | kFont = 3, |
Hal Canary | 9e41c21 | 2018-09-03 12:00:23 -0400 | [diff] [blame] | 24 | // These additional types are defined by the spec, but not |
| 25 | // currently used by Skia: ColorSpace, Shading, Properties |
commit-bot@chromium.org | 4740135 | 2013-07-23 21:49:29 +0000 | [diff] [blame] | 26 | }; |
| 27 | |
Hal Canary | 9e41c21 | 2018-09-03 12:00:23 -0400 | [diff] [blame] | 28 | |
| 29 | /** Create a PDF resource dictionary. |
| 30 | * The full set of ProcSet entries is automatically created for backwards |
| 31 | * compatibility, as recommended by the PDF spec. |
| 32 | * |
| 33 | * Any arguments can be nullptr. |
| 34 | */ |
Hal Canary | 7480158 | 2018-12-18 16:30:41 -0500 | [diff] [blame] | 35 | std::unique_ptr<SkPDFDict> SkPDFMakeResourceDict( |
| 36 | const std::vector<SkPDFIndirectReference>& graphicStateResources, |
| 37 | const std::vector<SkPDFIndirectReference>& shaderResources, |
| 38 | const std::vector<SkPDFIndirectReference>& xObjectResources, |
| 39 | const std::vector<SkPDFIndirectReference>& fontResources); |
Hal Canary | 9e41c21 | 2018-09-03 12:00:23 -0400 | [diff] [blame] | 40 | |
| 41 | /** |
Hal Canary | e650b85 | 2018-09-12 09:12:36 -0400 | [diff] [blame] | 42 | * Writes the name for the resource that will be generated by the resource |
Hal Canary | 9e41c21 | 2018-09-03 12:00:23 -0400 | [diff] [blame] | 43 | * dict. |
| 44 | * |
Hal Canary | e650b85 | 2018-09-12 09:12:36 -0400 | [diff] [blame] | 45 | * @param type The type of resource being entered |
Hal Canary | 9e41c21 | 2018-09-03 12:00:23 -0400 | [diff] [blame] | 46 | * @param key The resource key, should be unique within its type. |
| 47 | */ |
Hal Canary | e650b85 | 2018-09-12 09:12:36 -0400 | [diff] [blame] | 48 | void SkPDFWriteResourceName(SkWStream*, SkPDFResourceType type, int key); |
Hal Canary | 9e41c21 | 2018-09-03 12:00:23 -0400 | [diff] [blame] | 49 | |
commit-bot@chromium.org | 4740135 | 2013-07-23 21:49:29 +0000 | [diff] [blame] | 50 | #endif |