Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Enumerations | Functions
SkPDFResourceDict.h File Reference
#include <memory>
#include <vector>

Go to the source code of this file.

Enumerations

enum class  SkPDFResourceType { kExtGState = 0 , kPattern = 1 , kXObject = 2 , kFont = 3 }
 

Functions

std::unique_ptr< SkPDFDictSkPDFMakeResourceDict (const std::vector< SkPDFIndirectReference > &graphicStateResources, const std::vector< SkPDFIndirectReference > &shaderResources, const std::vector< SkPDFIndirectReference > &xObjectResources, const std::vector< SkPDFIndirectReference > &fontResources)
 
void SkPDFWriteResourceName (SkWStream *, SkPDFResourceType type, int key)
 

Enumeration Type Documentation

◆ SkPDFResourceType

enum class SkPDFResourceType
strong
Enumerator
kExtGState 
kPattern 
kXObject 
kFont 

Definition at line 18 of file SkPDFResourceDict.h.

18 {
19 kExtGState = 0,
20 kPattern = 1,
21 kXObject = 2,
22 kFont = 3,
23 // These additional types are defined by the spec, but not
24 // currently used by Skia: ColorSpace, Shading, Properties
25};

Function Documentation

◆ SkPDFMakeResourceDict()

std::unique_ptr< SkPDFDict > SkPDFMakeResourceDict ( const std::vector< SkPDFIndirectReference > &  graphicStateResources,
const std::vector< SkPDFIndirectReference > &  shaderResources,
const std::vector< SkPDFIndirectReference > &  xObjectResources,
const std::vector< SkPDFIndirectReference > &  fontResources 
)

Create a PDF resource dictionary. The full set of ProcSet entries is automatically created for backwards compatibility, as recommended by the PDF spec.

Any arguments can be nullptr.

Definition at line 90 of file SkPDFResourceDict.cpp.

94 {
95 auto dict = SkPDFMakeDict();
96 dict->insertObject("ProcSet", make_proc_set());
97 add_subdict(graphicStateResources, SkPDFResourceType::kExtGState, dict.get());
98 add_subdict(shaderResources, SkPDFResourceType::kPattern, dict.get());
99 add_subdict(xObjectResources, SkPDFResourceType::kXObject, dict.get());
100 add_subdict(fontResources, SkPDFResourceType::kFont, dict.get());
101 return dict;
102}
static void add_subdict(const std::vector< SkPDFIndirectReference > &resourceList, SkPDFResourceType type, SkPDFDict *dst)
static std::unique_ptr< SkPDFArray > make_proc_set()
static std::unique_ptr< SkPDFDict > SkPDFMakeDict(const char *type=nullptr)
Definition: SkPDFTypes.h:185

◆ SkPDFWriteResourceName()

void SkPDFWriteResourceName ( SkWStream dst,
SkPDFResourceType  type,
int  key 
)

Writes the name for the resource that will be generated by the resource dict.

Parameters
typeThe type of resource being entered
keyThe resource key, should be unique within its type.

Definition at line 43 of file SkPDFResourceDict.cpp.

43 {
44 // One extra character for the leading '/'.
46 buffer[0] = '/';
47 char* end = get_resource_name(buffer + 1, type, key);
48 dst->write(buffer, (size_t)(end - buffer));
49}
constexpr size_t kMaxResourceNameLength
static char * get_resource_name(char dst[kMaxResourceNameLength], SkPDFResourceType type, int key)
GLenum type
glong glong end
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
dst
Definition: cp.py:12