Flutter Engine
The Flutter Engine
Classes | Enumerations | Functions
SkPDFTypes.h File Reference
#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"
#include "src/pdf/SkPDFUnion.h"
#include <cstddef>
#include <cstdint>
#include <memory>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  SkPDFIndirectReference
 
class  SkPDFObject
 
class  SkPDFArray
 
class  SkPDFDict
 

Enumerations

enum class  SkPDFSteamCompressionEnabled : bool { No = false , Yes = true , Default }
 

Functions

static void SkPDFArray_Append (SkPDFArray *a, int v)
 
static void SkPDFArray_Append (SkPDFArray *a, SkScalar v)
 
template<typename T , typename... Args>
static void SkPDFArray_Append (SkPDFArray *a, T v, Args... args)
 
static void SkPDFArray_Append (SkPDFArray *a)
 
template<typename... Args>
static std::unique_ptr< SkPDFArraySkPDFMakeArray (Args... args)
 
static std::unique_ptr< SkPDFDictSkPDFMakeDict (const char *type=nullptr)
 
void SkPDFWriteTextString (SkWStream *wStream, const char *cin, size_t len)
 
void SkPDFWriteByteString (SkWStream *wStream, const char *cin, size_t len)
 
SkPDFIndirectReference SkPDFStreamOut (std::unique_ptr< SkPDFDict > dict, std::unique_ptr< SkStreamAsset > stream, SkPDFDocument *doc, SkPDFSteamCompressionEnabled compress=SkPDFSteamCompressionEnabled::Default)
 

Enumeration Type Documentation

◆ SkPDFSteamCompressionEnabled

enum class SkPDFSteamCompressionEnabled : bool
strong
Enumerator
No 
Yes 
Default 

Definition at line 189 of file SkPDFTypes.h.

189 : bool {
190 No = false,
191 Yes = true,
192 Default =
193#ifdef SK_PDF_LESS_COMPRESSION
194 No,
195#else
196 Yes,
197#endif
198};

Function Documentation

◆ SkPDFArray_Append() [1/4]

static void SkPDFArray_Append ( SkPDFArray a)
inlinestatic

Definition at line 122 of file SkPDFTypes.h.

122{}

◆ SkPDFArray_Append() [2/4]

static void SkPDFArray_Append ( SkPDFArray a,
int  v 
)
inlinestatic

Definition at line 112 of file SkPDFTypes.h.

112{ a->appendInt(v); }
struct MyStruct a[10]

◆ SkPDFArray_Append() [3/4]

static void SkPDFArray_Append ( SkPDFArray a,
SkScalar  v 
)
inlinestatic

Definition at line 114 of file SkPDFTypes.h.

114{ a->appendScalar(v); }

◆ SkPDFArray_Append() [4/4]

template<typename T , typename... Args>
static void SkPDFArray_Append ( SkPDFArray a,
T  v,
Args...  args 
)
inlinestatic

Definition at line 117 of file SkPDFTypes.h.

117 {
120}
static void SkPDFArray_Append(SkPDFArray *a, int v)
Definition: SkPDFTypes.h:112
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args

◆ SkPDFMakeArray()

template<typename... Args>
static std::unique_ptr< SkPDFArray > SkPDFMakeArray ( Args...  args)
inlinestatic

Definition at line 125 of file SkPDFTypes.h.

125 {
126 std::unique_ptr<SkPDFArray> ret(new SkPDFArray());
127 ret->reserve(sizeof...(Args));
128 SkPDFArray_Append(ret.get(), args...);
129 return ret;
130}

◆ SkPDFMakeDict()

static std::unique_ptr< SkPDFDict > SkPDFMakeDict ( const char *  type = nullptr)
inlinestatic

Definition at line 185 of file SkPDFTypes.h.

185 {
186 return std::make_unique<SkPDFDict>(type);
187}
GLenum type

◆ SkPDFStreamOut()

SkPDFIndirectReference SkPDFStreamOut ( std::unique_ptr< SkPDFDict dict,
std::unique_ptr< SkStreamAsset stream,
SkPDFDocument doc,
SkPDFSteamCompressionEnabled  compress = SkPDFSteamCompressionEnabled::Default 
)

Definition at line 591 of file SkPDFTypes.cpp.

594 {
596 if (SkExecutor* executor = doc->executor()) {
597 SkPDFDict* dictPtr = dict.release();
598 SkStreamAsset* contentPtr = content.release();
599 // Pass ownership of both pointers into a std::function, which should
600 // only be executed once.
601 doc->incrementJobCount();
602 executor->add([dictPtr, contentPtr, compress, doc, ref]() {
603 serialize_stream(dictPtr, contentPtr, compress, doc, ref);
604 delete dictPtr;
605 delete contentPtr;
606 doc->signalJobComplete();
607 });
608 return ref;
609 }
610 serialize_stream(dict.get(), content.get(), compress, doc, ref);
611 return ref;
612}
static void serialize_stream(SkPDFDict *origDict, SkStreamAsset *stream, SkPDFSteamCompressionEnabled compress, SkPDFDocument *doc, SkPDFIndirectReference ref)
Definition: SkPDFTypes.cpp:544
SkExecutor * executor() const
void signalJobComplete()
void incrementJobCount()
SkPDFIndirectReference reserveRef()
union flutter::testing::@2836::KeyboardChange::@76 content

◆ SkPDFWriteByteString()

void SkPDFWriteByteString ( SkWStream wStream,
const char *  cin,
size_t  len 
)

Definition at line 248 of file SkPDFTypes.cpp.

248 {
249 write_byte_string(wStream, cin, len);
250}
static void write_byte_string(SkWStream *wStream, const char *cin, size_t len)
Definition: SkPDFTypes.cpp:176

◆ SkPDFWriteTextString()

void SkPDFWriteTextString ( SkWStream wStream,
const char *  cin,
size_t  len 
)

Definition at line 245 of file SkPDFTypes.cpp.

245 {
246 write_text_string(wStream, cin, len);
247}
static void write_text_string(SkWStream *wStream, const char *cin, size_t len)
Definition: SkPDFTypes.cpp:194