Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
DM::PDFSink Class Reference

#include <DMSrcSink.h>

Inheritance diagram for DM::PDFSink:
DM::Sink

Public Member Functions

 PDFSink (bool pdfa, SkScalar rasterDpi)
 
Result draw (const Src &, SkBitmap *, SkWStream *, SkString *) const override
 
const char * fileExtension () const override
 
SinkFlags flags () const override
 
- Public Member Functions inherited from DM::Sink
virtual ~Sink ()
 
virtual Result draw (const Src &, SkBitmap *, SkWStream *, SkString *log) const =0
 
virtual void setColorSpace (sk_sp< SkColorSpace >)
 
virtual bool serial () const
 
virtual const char * fileExtension () const =0
 
virtual SinkFlags flags () const =0
 
virtual SkColorInfo colorInfo () const
 

Public Attributes

bool fPDFA
 
SkScalar fRasterDpi
 

Detailed Description

Definition at line 495 of file DMSrcSink.h.

Constructor & Destructor Documentation

◆ PDFSink()

DM::PDFSink::PDFSink ( bool  pdfa,
SkScalar  rasterDpi 
)
inline

Definition at line 497 of file DMSrcSink.h.

497: fPDFA(pdfa), fRasterDpi(rasterDpi) {}
SkScalar fRasterDpi
Definition: DMSrcSink.h:503
bool fPDFA
Definition: DMSrcSink.h:502

Member Function Documentation

◆ draw()

Result DM::PDFSink::draw ( const Src src,
SkBitmap ,
SkWStream dst,
SkString  
) const
overridevirtual

Implements DM::Sink.

Definition at line 1996 of file DMSrcSink.cpp.

1996 {
1997 SkPDF::Metadata metadata;
1998 metadata.fTitle = src.name();
1999 metadata.fSubject = "rendering correctness test";
2000 metadata.fCreator = "Skia/DM";
2001 metadata.fProducer = "Skia/PDF HEAD"; // Set producer to avoid SK_MILESTONE churn.
2002 metadata.fRasterDPI = fRasterDpi;
2003 metadata.fPDFA = fPDFA;
2004#if SK_PDF_TEST_EXECUTOR
2005 std::unique_ptr<SkExecutor> executor = SkExecutor::MakeFIFOThreadPool();
2006 metadata.fExecutor = executor.get();
2007#endif
2008 auto doc = SkPDF::MakeDocument(dst, metadata);
2009 if (!doc) {
2010 return Result::Fatal("SkPDF::MakeDocument() returned nullptr");
2011 }
2012 return draw_skdocument(src, doc.get(), dst);
2013}
static Result Fatal(const char *fmt,...) SK_PRINTF_LIKE(1
static std::unique_ptr< SkExecutor > MakeFIFOThreadPool(int threads=0, bool allowBorrowing=true)
Definition: SkExecutor.cpp:146
static Result draw_skdocument(const Src &src, SkDocument *doc, SkWStream *dst)
Definition: DMSrcSink.cpp:1972
SK_API sk_sp< SkDocument > MakeDocument(SkWStream *stream, const Metadata &metadata)
dst
Definition: cp.py:12
SkExecutor * fExecutor
SkString fSubject
Definition: SkPDFDocument.h:96
SkScalar fRasterDPI
SkString fProducer

◆ fileExtension()

const char * DM::PDFSink::fileExtension ( ) const
inlineoverridevirtual

Implements DM::Sink.

Definition at line 499 of file DMSrcSink.h.

499{ return "pdf"; }

◆ flags()

SinkFlags DM::PDFSink::flags ( ) const
inlineoverridevirtual

Implements DM::Sink.

Definition at line 500 of file DMSrcSink.h.

500{ return SinkFlags{ SinkFlags::kVector, SinkFlags::kDirect }; }

Member Data Documentation

◆ fPDFA

bool DM::PDFSink::fPDFA

Definition at line 502 of file DMSrcSink.h.

◆ fRasterDpi

SkScalar DM::PDFSink::fRasterDpi

Definition at line 503 of file DMSrcSink.h.


The documentation for this class was generated from the following files: