High-level API for creating a document-based canvas.
More...
#include <SkDocument.h>
High-level API for creating a document-based canvas.
To use..
- Create a document, specifying a stream to store the output.
- For each "page" of content: a. canvas = doc->beginPage(...) b. draw_my_content(canvas); c. doc->endPage();
- Close the document with doc->close().
◆ State
Enumerator |
---|
kBetweenPages_State | |
kInPage_State | |
kClosed_State | |
◆ SkDocument()
◆ ~SkDocument()
SkDocument::~SkDocument |
( |
| ) |
|
|
overrideprotected |
◆ abort()
void SkDocument::abort |
( |
| ) |
|
Call abort() to stop producing the document immediately.
The stream output must be ignored, and should not be trusted.
◆ beginPage()
Begin a new page for the document, returning the canvas that will draw into the page.
The document owns this canvas, and it will go out of scope when endPage() or close() is called, or the document is deleted.
◆ close()
void SkDocument::close |
( |
| ) |
|
Call close() when all pages have been drawn.
This will close the file or stream holding the document's contents. After close() the document can no longer add new pages. Deleting the document will automatically call close() if need be.
◆ endPage()
void SkDocument::endPage |
( |
| ) |
|
Call endPage() when the content for the current page has been drawn (into the canvas returned by beginPage()).
After this call the canvas returned by beginPage() will be out-of-scope.
◆ getState()
State SkDocument::getState |
( |
| ) |
const |
|
inlineprotected |
◆ getStream()
◆ onAbort()
virtual void SkDocument::onAbort |
( |
| ) |
|
|
protectedpure virtual |
◆ onBeginPage()
◆ onClose()
virtual void SkDocument::onClose |
( |
SkWStream * |
| ) |
|
|
protectedpure virtual |
◆ onEndPage()
virtual void SkDocument::onEndPage |
( |
| ) |
|
|
protectedpure virtual |
◆ ref()
void SkRefCntBase::ref |
( |
| ) |
const |
|
inlineinherited |
Increment the reference count.
Must be balanced by a call to unref().
◆ unique()
bool SkRefCntBase::unique |
( |
| ) |
const |
|
inlineinherited |
May return true if the caller is the only owner.
Ensures that all previous owner's actions are complete.
◆ unref()
void SkRefCntBase::unref |
( |
| ) |
const |
|
inlineinherited |
Decrement the reference count.
If the reference count is 1 before the decrement, then delete the object. Note that if this is the case, then the object needs to have been allocated via new, and not on the stack.
The documentation for this class was generated from the following file: