Inkscape
Vector Graphics Editor
|
#include <cairo-render-context.h>
Classes | |
struct | CairoRenderContextMetadata |
Public Types | |
enum | CairoPaintOrder { STROKE_OVER_FILL , FILL_OVER_STROKE , FILL_ONLY , STROKE_ONLY } |
enum | CairoRenderMode { RENDER_MODE_NORMAL , RENDER_MODE_CLIP } |
enum | CairoClipMode { CLIP_MODE_PATH , CLIP_MODE_MASK } |
Public Member Functions | |
~CairoRenderContext () | |
CairoRenderContext (CairoRenderContext const &other)=delete | |
CairoRenderContext (CairoRenderContext &&other) | |
CairoRenderContext & | operator= (CairoRenderContext const &other)=delete |
CairoRenderContext & | operator= (CairoRenderContext &&other) |
CairoRenderContext | createSimilar (double width, double height) const |
Creates a new render context which will be compatible with the given context's Cairo surface. | |
bool | finish (bool finish_surface=true) |
bool | finishPage () |
Each page that's made should call finishPage to complete it. | |
bool | nextPage (double width, double height, char const *label) |
When writing multiple pages, resize the next page. | |
CairoRenderer * | getRenderer () const |
bool | setImageTarget (cairo_format_t format) |
bool | setPdfTarget (gchar const *utf8_fn) |
bool | setPsTarget (gchar const *utf8_fn) |
bool | setSurfaceTarget (cairo_surface_t *surface, bool is_vector, cairo_matrix_t *ctm=nullptr) |
Set the cairo_surface_t from an external source. | |
void | setMetadata (SPDocument const &document) |
Extract metadata from the document and store it in the context. | |
void | setPSLevel (unsigned int level) |
void | setEPS (bool eps) |
void | setPDFLevel (unsigned int level) |
void | setTextToPath (bool texttopath) |
void | setOmitText (bool omittext) |
void | setFilterToBitmap (bool filtertobitmap) |
bool | getFilterToBitmap () |
void | setBitmapResolution (unsigned resolution) |
unsigned | getBitmapResolution () |
bool | setupSurface (double width, double height) |
Creates the cairo_surface_t for the context with the given width, height and with the currently set target surface type. | |
cairo_surface_t * | getSurface () |
bool | saveAsPng (const char *file_name) |
Saves the contents of the context to a PNG file. | |
void | newPage () |
On targets supporting multiple pages, sends subsequent rendering to a new page. | |
void | setRenderMode (CairoRenderMode mode) |
CairoRenderMode | getRenderMode () const |
void | setClipMode (CairoClipMode mode) |
CairoClipMode | getClipMode () const |
void | addPathVector (Geom::PathVector const &pv) |
void | setPathVector (Geom::PathVector const &pv) |
void | pushLayer () |
void | popLayer (cairo_operator_t composite=CAIRO_OPERATOR_CLEAR) |
void | tagBegin (const char *link) |
void | tagEnd () |
void | destBegin (const char *link) |
void | destEnd () |
void | pushState () |
void | popState () |
const CairoRenderState * | getCurrentState () const |
const CairoRenderState * | getParentState () const |
void | setStateForStyle (SPStyle const *style) |
void | setStateForItem (SPItem const *item) |
void | setStateNeedsLayer (bool state_needs_layer) |
void | setStateMergeOpacity (bool state_merge_opacity) |
void | transform (Geom::Affine const &transform) |
void | setTransform (Geom::Affine const &transform) |
void | setItemTransform (Geom::Affine const &transform) |
Geom::Affine | getTransform () const |
Geom::Affine | getItemTransform () const |
Geom::Affine | getParentTransform () const |
void | addClipPath (Geom::PathVector const &pv, SPIEnum< SPWindRule > const *fill_rule) |
void | addClippingRect (double x, double y, double width, double height) |
bool | renderPathVector (Geom::PathVector const &pathv, SPStyle const *style, Geom::OptRect const &pbox, CairoPaintOrder order=STROKE_OVER_FILL) |
bool | renderImage (Inkscape::Pixbuf const *pb, Geom::Affine const &image_transform, SPStyle const *style) |
bool | renderGlyphtext (PangoFont *font, Geom::Affine const &font_matrix, std::vector< CairoGlyphInfo > const &glyphtext, SPStyle const *style, bool second_pass=false) |
Called by Layout-TNG-Output, this function decides how to apply styles and write out the final shapes of a set of glyphs to the target. | |
Private Types | |
enum class | OmitTextPageState { EMPTY , GRAPHIC_ON_TOP , NEW_PAGE_ON_GRAPHIC } |
Private Member Functions | |
CairoRenderContext (CairoRenderer *renderer) | |
cairo_pattern_t * | _createPatternForPaintServer (SPPaintServer const *const paintserver, Geom::OptRect const &pbox, float alpha) |
cairo_pattern_t * | _createPatternPainter (SPPaintServer const *const paintserver, Geom::OptRect const &pbox) |
cairo_pattern_t * | _createHatchPainter (SPPaintServer const *const paintserver, Geom::OptRect const &pbox) |
unsigned int | _showGlyphs (cairo_t *cr, PangoFont *font, std::vector< CairoGlyphInfo > const &glyphtext, bool is_stroke) |
bool | _finishSurfaceSetup (cairo_surface_t *surface, cairo_matrix_t *ctm=nullptr) |
void | _setSurfaceMetadata (cairo_surface_t *surface) |
void | _setFillStyle (SPStyle const *style, Geom::OptRect const &pbox) |
void | _setStrokeStyle (SPStyle const *style, Geom::OptRect const &pbox) |
float | _mergedOpacity (float source_opacity) const |
void | _concatTransform (cairo_t *cr, double xx, double yx, double xy, double yy, double x0, double y0) |
void | _concatTransform (cairo_t *cr, Geom::Affine const &transform) |
void | _prepareRenderGraphic () |
void | _prepareRenderText () |
void | _freeResources () |
template<cairo_surface_type_t type> | |
bool | _setVectorTarget (gchar const *utf8_fn) |
CairoRenderState * | _addState () |
Static Private Member Functions | |
static void | font_data_free (gpointer data) |
Friends | |
class | CairoRenderer |
Definition at line 66 of file cairo-render-context.h.
Enumerator | |
---|---|
CLIP_MODE_PATH | |
CLIP_MODE_MASK |
Definition at line 91 of file cairo-render-context.h.
Enumerator | |
---|---|
STROKE_OVER_FILL | |
FILL_OVER_STROKE | |
FILL_ONLY | |
STROKE_ONLY |
Definition at line 79 of file cairo-render-context.h.
Enumerator | |
---|---|
RENDER_MODE_NORMAL | |
RENDER_MODE_CLIP |
Definition at line 86 of file cairo-render-context.h.
|
strongprivate |
Enumerator | |
---|---|
EMPTY | |
GRAPHIC_ON_TOP | |
NEW_PAGE_ON_GRAPHIC |
Definition at line 184 of file cairo-render-context.h.
Inkscape::Extension::Internal::CairoRenderContext::~CairoRenderContext | ( | ) |
Definition at line 145 of file cairo-render-context.cpp.
References _freeResources().
|
delete |
Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContext | ( | CairoRenderContext && | other | ) |
Definition at line 143 of file cairo-render-context.cpp.
|
private |
Definition at line 112 of file cairo-render-context.cpp.
References _addState().
|
inlineprivate |
Definition at line 266 of file cairo-render-context.h.
References _state_stack.
Referenced by CairoRenderContext(), and pushState().
|
private |
|
private |
|
private |
Definition at line 1156 of file cairo-render-context.cpp.
References _renderer, SPHatch::bounds(), bounds, SPHatch::calculateRenderInfo(), SPHatch::RenderInfo::child_transform, createSimilar(), SPItem::display_key_new(), floor(), getSurface(), SPHatch::hatchPaths(), Geom::GenericRect< C >::height(), SPHatch::hide(), ink_cairo_pattern_set_matrix(), Geom::Affine::inverse(), Geom::GenericRect< C >::max(), MAX, Geom::GenericRect< C >::min(), SPStyle::overflow, SPHatch::RenderInfo::pattern_to_user_transform, SPHatch::pitch(), popState(), pushState(), Inkscape::Extension::Internal::CairoRenderer::renderHatchPath(), result, saveAsPng(), setTransform(), SPHatch::show(), SP_CSS_OVERFLOW_VISIBLE, SPObject::style, TEST(), SPHatch::RenderInfo::tile_rect, transform(), and Geom::GenericRect< C >::width().
Referenced by _createPatternForPaintServer().
|
private |
Definition at line 1230 of file cairo-render-context.cpp.
References _cr, _createHatchPainter(), _createPatternPainter(), c, Geom::identity(), ink_cairo_pattern_add_color_stop(), ink_cairo_pattern_set_matrix(), SP_GRADIENT_SPREAD_PAD, SP_GRADIENT_SPREAD_REFLECT, SP_GRADIENT_SPREAD_REPEAT, SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX, Geom::X, and Geom::Y.
Referenced by _setFillStyle(), and _setStrokeStyle().
|
private |
Definition at line 1028 of file cairo-render-context.cpp.
References _renderer, _vector_based_target, child, createSimilar(), SPItem::display_key_new(), SPPatternReference::getObject(), getSurface(), SPPattern::getTransform(), Geom::GenericRect< C >::height(), height, SPPattern::height(), Geom::identity(), ink_cairo_pattern_set_matrix(), Geom::Affine::inverse(), Geom::GenericRect< C >::left(), MAX, SPPattern::patternContentUnits(), SPPattern::patternUnits(), popState(), pushState(), SPPattern::ref, Inkscape::Extension::Internal::CairoRenderer::renderItem(), result, saveAsPng(), setTransform(), TEST(), Geom::GenericRect< C >::top(), SPPattern::UNITS_OBJECTBOUNDINGBOX, SPPattern::viewbox(), SPViewBox::viewBox_set, w, Geom::GenericRect< C >::width(), width, SPPattern::width(), Geom::X, SPPattern::x(), Geom::Y, and SPPattern::y().
Referenced by _createPatternForPaintServer().
|
private |
Definition at line 786 of file cairo-render-context.cpp.
References _cr, _height, _is_valid, _surface, _vector_based_target, _width, cairo_rectangle(), Inkscape::Util::Quantity::convert(), and surface.
Referenced by setSurfaceTarget(), and setupSurface().
|
private |
Definition at line 118 of file cairo-render-context.cpp.
References _cr, _font_table, _layout, _stream, _surface, and font_data_free().
Referenced by operator=(), and ~CairoRenderContext().
|
private |
Definition at line 1323 of file cairo-render-context.cpp.
References _state_stack.
Referenced by _setFillStyle(), and _setStrokeStyle().
|
private |
Definition at line 1437 of file cairo-render-context.cpp.
References _cr, _is_omittext, _omittext_state, _render_mode, _state_stack, _target, getCurrentState(), GRAPHIC_ON_TOP, NEW_PAGE_ON_GRAPHIC, popLayer(), pushLayer(), RENDER_MODE_CLIP, setTransform(), and transform().
Referenced by renderImage(), and renderPathVector().
|
private |
Definition at line 1481 of file cairo-render-context.cpp.
References _is_omittext, _omittext_state, _target, GRAPHIC_ON_TOP, and NEW_PAGE_ON_GRAPHIC.
Referenced by renderGlyphtext().
|
private |
Definition at line 1329 of file cairo-render-context.cpp.
References _cr, _createPatternForPaintServer(), _mergedOpacity(), cairo_set_source_rgba(), SPStyle::fill, SPStyle::fill_opacity, SPStyle::getFillPaintServer(), ink_cairo_set_source_color(), and SPPaintServer::isValid().
Referenced by renderGlyphtext(), and renderPathVector().
|
private |
Definition at line 1360 of file cairo-render-context.cpp.
References _cr, _createPatternForPaintServer(), _mergedOpacity(), SPStyle::getStrokePaintServer(), ink_cairo_set_hairline(), ink_cairo_set_source_color(), SPPaintServer::isValid(), Inkscape::join(), MAX, SP_STROKE_LINECAP_BUTT, SP_STROKE_LINECAP_ROUND, SP_STROKE_LINECAP_SQUARE, SP_STROKE_LINEJOIN_BEVEL, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINEJOIN_ROUND, SPStyle::stroke, SPStyle::stroke_dasharray, SPStyle::stroke_dashoffset, SPStyle::stroke_extensions, SPStyle::stroke_linecap, SPStyle::stroke_linejoin, SPStyle::stroke_miterlimit, SPStyle::stroke_opacity, and SPStyle::stroke_width.
Referenced by renderGlyphtext(), and renderPathVector().
|
private |
Definition at line 819 of file cairo-render-context.cpp.
References _metadata, _target, Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::author, Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::cdate, Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::copyright, Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::creator, Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::keywords, Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::mdate, Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::subject, surface, and Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::title.
Referenced by setupSurface().
|
private |
Definition at line 301 of file cairo-render-context.cpp.
References _stream, _target, _vector_based_target, Inkscape::IO::dump_fopen_call(), Inkscape::IO::fopen_utf8name(), and qn.
|
private |
Definition at line 1670 of file cairo-render-context.cpp.
Referenced by renderGlyphtext().
void Inkscape::Extension::Internal::CairoRenderContext::addClipPath | ( | Geom::PathVector const & | pv, |
SPIEnum< SPWindRule > const * | fill_rule | ||
) |
Definition at line 670 of file cairo-render-context.cpp.
References _cr, _is_valid, addPathVector(), SP_WIND_RULE_EVENODD, and SPIEnum< T >::value.
Referenced by renderPathVector().
void Inkscape::Extension::Internal::CairoRenderContext::addClippingRect | ( | double | x, |
double | y, | ||
double | width, | ||
double | height | ||
) |
Definition at line 685 of file cairo-render-context.cpp.
References _cr, _is_valid, cairo_rectangle(), height, and width.
Referenced by Inkscape::Extension::Internal::sp_image_render(), and Inkscape::Extension::Internal::sp_root_render().
void Inkscape::Extension::Internal::CairoRenderContext::addPathVector | ( | Geom::PathVector const & | pv | ) |
Definition at line 1812 of file cairo-render-context.cpp.
References _cr, and feed_pathvector_to_cairo().
Referenced by addClipPath(), and setPathVector().
CairoRenderContext Inkscape::Extension::Internal::CairoRenderContext::createSimilar | ( | double | width, |
double | height | ||
) | const |
Creates a new render context which will be compatible with the given context's Cairo surface.
width | width of the surface to be created |
height | height of the surface to be created |
Definition at line 263 of file cairo-render-context.cpp.
References _cr, _height, _is_valid, _renderer, _surface, _width, Inkscape::Extension::Internal::CairoRenderer::createContext(), height, and width.
Referenced by _createHatchPainter(), and _createPatternPainter().
void Inkscape::Extension::Internal::CairoRenderContext::destBegin | ( | const char * | link | ) |
Definition at line 653 of file cairo-render-context.cpp.
References _cr.
Referenced by Inkscape::Extension::Internal::CairoRenderer::renderPages(), and Inkscape::Extension::Internal::sp_item_invoke_render().
void Inkscape::Extension::Internal::CairoRenderContext::destEnd | ( | ) |
Definition at line 662 of file cairo-render-context.cpp.
References _cr.
Referenced by Inkscape::Extension::Internal::CairoRenderer::renderPages(), and Inkscape::Extension::Internal::sp_item_invoke_render().
bool Inkscape::Extension::Internal::CairoRenderContext::finish | ( | bool | finish_surface = true | ) |
Definition at line 917 of file cairo-render-context.cpp.
References _cr, _is_show_page, _is_valid, _layout, _stream, _surface, and _vector_based_target.
Referenced by Inkscape::Extension::Internal::pdf_render_document_to_file(), and Inkscape::Extension::Internal::ps_print_document_to_file().
bool Inkscape::Extension::Internal::CairoRenderContext::finishPage | ( | ) |
Each page that's made should call finishPage to complete it.
Definition at line 865 of file cairo-render-context.cpp.
References _cr, _is_show_page, _is_valid, and _vector_based_target.
Referenced by Inkscape::Extension::Internal::CairoRenderer::renderPages().
|
staticprivate |
Definition at line 203 of file cairo-render-context.cpp.
References data.
Referenced by _freeResources().
|
inline |
Definition at line 120 of file cairo-render-context.h.
References _bitmapresolution.
Referenced by Inkscape::Extension::Internal::sp_asbitmap_render().
|
inline |
Definition at line 139 of file cairo-render-context.h.
References _clip_mode.
Referenced by Inkscape::Extension::Internal::CairoRenderer::applyClipPath().
|
inline |
Definition at line 155 of file cairo-render-context.h.
References _state_stack.
Referenced by _prepareRenderGraphic(), Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), Inkscape::Extension::Internal::CairoRenderer::applyMask(), getItemTransform(), getParentState(), popLayer(), Inkscape::Extension::Internal::CairoRenderer::renderItem(), Inkscape::Extension::Internal::sp_image_render(), and Inkscape::Extension::Internal::sp_root_render().
|
inline |
Definition at line 118 of file cairo-render-context.h.
References _is_filtertobitmap.
Referenced by Inkscape::Extension::Internal::CairoRenderer::_shouldRasterize().
Geom::Affine Inkscape::Extension::Internal::CairoRenderContext::getItemTransform | ( | ) | const |
Definition at line 991 of file cairo-render-context.cpp.
References getCurrentState(), and getParentTransform().
Referenced by popLayer().
const CairoRenderState * Inkscape::Extension::Internal::CairoRenderContext::getParentState | ( | ) | const |
Definition at line 210 of file cairo-render-context.cpp.
References _state_stack, and getCurrentState().
Referenced by getParentTransform(), and popLayer().
Geom::Affine Inkscape::Extension::Internal::CairoRenderContext::getParentTransform | ( | ) | const |
Definition at line 1000 of file cairo-render-context.cpp.
References _is_valid, getParentState(), and Inkscape::Extension::Internal::CairoRenderState::transform.
Referenced by getItemTransform().
|
inline |
Definition at line 101 of file cairo-render-context.h.
References _renderer.
Referenced by Inkscape::Extension::Internal::sp_anchor_render(), Inkscape::Extension::Internal::sp_group_render(), Inkscape::Extension::Internal::sp_shape_render(), and Inkscape::Extension::Internal::sp_use_render().
|
inline |
Definition at line 137 of file cairo-render-context.h.
References _render_mode.
Referenced by Inkscape::Extension::Internal::CairoRenderer::applyClipPath().
cairo_surface_t * Inkscape::Extension::Internal::CairoRenderContext::getSurface | ( | ) |
Definition at line 400 of file cairo-render-context.cpp.
References _is_valid, and _surface.
Referenced by _createHatchPainter(), _createPatternPainter(), and popLayer().
Geom::Affine Inkscape::Extension::Internal::CairoRenderContext::getTransform | ( | ) | const |
Definition at line 982 of file cairo-render-context.cpp.
References _cr, _is_valid, and ink_matrix_to_2geom().
Referenced by Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), Inkscape::Extension::Internal::sp_anchor_render(), and transform().
void Inkscape::Extension::Internal::CairoRenderContext::newPage | ( | ) |
On targets supporting multiple pages, sends subsequent rendering to a new page.
bool Inkscape::Extension::Internal::CairoRenderContext::nextPage | ( | double | width, |
double | height, | ||
char const * | label | ||
) |
When writing multiple pages, resize the next page.
Definition at line 888 of file cairo-render-context.cpp.
References _height, _is_pdf, _is_ps, _is_show_page, _is_valid, _surface, _vector_based_target, _width, height, label, and width.
Referenced by Inkscape::Extension::Internal::CairoRenderer::renderPage().
CairoRenderContext & Inkscape::Extension::Internal::CairoRenderContext::operator= | ( | CairoRenderContext && | other | ) |
Definition at line 147 of file cairo-render-context.cpp.
References _bitmapresolution, _clip_mode, _clip_rule, _clip_winding_failed, _cr, _dpi, _eps, _freeResources(), _height, _is_filtertobitmap, _is_omittext, _is_pdf, _is_ps, _is_show_page, _is_texttopath, _is_valid, _layout, _metadata, _omittext_state, _pdf_level, _ps_level, _render_mode, _renderer, _state_stack, _stream, _surface, _target, _target_format, _vector_based_target, and _width.
|
delete |
void Inkscape::Extension::Internal::CairoRenderContext::popLayer | ( | cairo_operator_t | composite = CAIRO_OPERATOR_CLEAR | ) |
Definition at line 454 of file cairo-render-context.cpp.
References _clip_mode, _cr, _dpi, _height, _is_valid, _render_mode, _renderer, _vector_based_target, _width, Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), Inkscape::Extension::Internal::CairoRenderer::applyMask(), cairo_rectangle(), cairo_set_source_rgba(), CLIP_MODE_MASK, CLIP_MODE_PATH, Inkscape::Extension::Internal::CairoRenderState::clip_path, Inkscape::Extension::Internal::CairoRenderer::createContext(), getCurrentState(), getItemTransform(), getParentState(), getSurface(), height, Inkscape::Extension::Internal::CairoRenderState::mask, Inkscape::Extension::Internal::CairoRenderState::opacity, RENDER_MODE_CLIP, RENDER_MODE_NORMAL, saveAsPng(), setClipMode(), setImageTarget(), setRenderMode(), setTransform(), setupSurface(), stride, TEST(), transform(), and width.
Referenced by _prepareRenderGraphic(), Inkscape::Extension::Internal::CairoRenderer::renderItem(), renderPathVector(), and Inkscape::Text::Layout::showGlyphs().
void Inkscape::Extension::Internal::CairoRenderContext::popState | ( | ) |
Definition at line 1017 of file cairo-render-context.cpp.
References _cr, _is_valid, and _state_stack.
Referenced by _createHatchPainter(), _createPatternPainter(), Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), Inkscape::Extension::Internal::CairoRenderer::applyMask(), Inkscape::Extension::Internal::CairoRenderer::renderHatchPath(), Inkscape::Extension::Internal::CairoRenderer::renderItem(), Inkscape::Extension::Internal::CairoRenderer::renderPage(), Inkscape::Extension::Internal::CairoRenderer::renderPages(), Inkscape::Text::Layout::showGlyphs(), Inkscape::Extension::Internal::sp_root_render(), Inkscape::Extension::Internal::sp_symbol_render(), and Inkscape::Extension::Internal::sp_use_render().
void Inkscape::Extension::Internal::CairoRenderContext::pushLayer | ( | ) |
Definition at line 438 of file cairo-render-context.cpp.
References _cr, _is_valid, and _vector_based_target.
Referenced by _prepareRenderGraphic(), Inkscape::Extension::Internal::CairoRenderer::renderItem(), renderPathVector(), and Inkscape::Text::Layout::showGlyphs().
void Inkscape::Extension::Internal::CairoRenderContext::pushState | ( | ) |
Definition at line 1006 of file cairo-render-context.cpp.
References _addState(), _cr, _is_valid, _state_stack, and Inkscape::Extension::Internal::CairoRenderState::transform.
Referenced by _createHatchPainter(), _createPatternPainter(), Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), Inkscape::Extension::Internal::CairoRenderer::applyMask(), Inkscape::Extension::Internal::CairoRenderer::renderHatchPath(), Inkscape::Extension::Internal::CairoRenderer::renderItem(), Inkscape::Extension::Internal::CairoRenderer::renderPage(), Inkscape::Extension::Internal::CairoRenderer::renderPages(), Inkscape::Text::Layout::showGlyphs(), Inkscape::Extension::Internal::sp_root_render(), Inkscape::Extension::Internal::sp_symbol_render(), and Inkscape::Extension::Internal::sp_use_render().
bool Inkscape::Extension::Internal::CairoRenderContext::renderGlyphtext | ( | PangoFont * | font, |
Geom::Affine const & | font_matrix, | ||
std::vector< CairoGlyphInfo > const & | glyphtext, | ||
SPStyle const * | style, | ||
bool | second_pass = false |
||
) |
Called by Layout-TNG-Output, this function decides how to apply styles and write out the final shapes of a set of glyphs to the target.
font - The PangoFont to use in cairo. font_matrix - The specific text transform to apply to these glyphs. glyphtext - A list of glyphs to write or render out. style - The style from the span or text node in context. second_pass - True if this is being called in a second pass.
Returns true if a second pass is required for fill over stroke paint order.
Definition at line 1715 of file cairo-render-context.cpp.
References _clip_mode, _cr, _font_table, _is_omittext, _is_texttopath, _prepareRenderText(), _render_mode, _setFillStyle(), _setStrokeStyle(), _showGlyphs(), CLIP_MODE_MASK, SPStyle::fill, fill, SPStyle::fill_rule, ink_css_blend_to_cairo_operator(), ink_matrix_to_cairo(), SPStyle::mix_blend_mode, SPStyle::paint_order, RENDER_MODE_CLIP, SP_CSS_PAINT_ORDER_FILL, SP_CSS_PAINT_ORDER_STROKE, SP_WIND_RULE_EVENODD, SPStyle::stroke, and stroke.
Referenced by Inkscape::Text::Layout::showGlyphs().
bool Inkscape::Extension::Internal::CairoRenderContext::renderImage | ( | Inkscape::Pixbuf const * | pb, |
Geom::Affine const & | image_transform, | ||
SPStyle const * | style | ||
) |
Definition at line 1595 of file cairo-render-context.cpp.
References _cr, _is_valid, _prepareRenderGraphic(), _render_mode, _vector_based_target, cairo_rectangle(), Inkscape::Pixbuf::getSurfaceRaw(), Inkscape::Pixbuf::height(), SPStyle::image_rendering, ink_css_blend_to_cairo_operator(), SPStyle::mix_blend_mode, RENDER_MODE_CLIP, SP_CSS_IMAGE_RENDERING_AUTO, SP_CSS_IMAGE_RENDERING_CRISPEDGES, SP_CSS_IMAGE_RENDERING_OPTIMIZEQUALITY, SP_CSS_IMAGE_RENDERING_OPTIMIZESPEED, SP_CSS_IMAGE_RENDERING_PIXELATED, transform(), w, and Inkscape::Pixbuf::width().
Referenced by Inkscape::Extension::Internal::sp_asbitmap_render(), and Inkscape::Extension::Internal::sp_image_render().
bool Inkscape::Extension::Internal::CairoRenderContext::renderPathVector | ( | Geom::PathVector const & | pathv, |
SPStyle const * | style, | ||
Geom::OptRect const & | pbox, | ||
CairoPaintOrder | order = STROKE_OVER_FILL |
||
) |
Definition at line 1493 of file cairo-render-context.cpp.
References _clip_mode, _cr, _is_valid, _prepareRenderGraphic(), _render_mode, _setFillStyle(), _setStrokeStyle(), _state_stack, _surface, addClipPath(), CLIP_MODE_PATH, SPStyle::fill, FILL_ONLY, SPStyle::fill_opacity, FILL_OVER_STROKE, SPStyle::fill_rule, ink_css_blend_to_cairo_operator(), SPStyle::mix_blend_mode, order, popLayer(), pushLayer(), RENDER_MODE_CLIP, setPathVector(), SP_CSS_BLEND_NORMAL, SP_WIND_RULE_EVENODD, SPStyle::stroke, SPStyle::stroke_extensions, STROKE_ONLY, SPStyle::stroke_opacity, STROKE_OVER_FILL, SPStyle::stroke_width, and TEST().
Referenced by Inkscape::Extension::Internal::CairoRenderer::renderHatchPath(), and Inkscape::Extension::Internal::sp_shape_render().
bool Inkscape::Extension::Internal::CairoRenderContext::saveAsPng | ( | const char * | file_name | ) |
Saves the contents of the context to a PNG file.
Definition at line 407 of file cairo-render-context.cpp.
References _surface, and file_name.
Referenced by _createHatchPainter(), _createPatternPainter(), and popLayer().
|
inline |
Definition at line 119 of file cairo-render-context.h.
References _bitmapresolution.
Referenced by Inkscape::Extension::Internal::pdf_render_document_to_file(), and Inkscape::Extension::Internal::ps_print_document_to_file().
void Inkscape::Extension::Internal::CairoRenderContext::setClipMode | ( | CairoClipMode | mode | ) |
Definition at line 425 of file cairo-render-context.cpp.
References _clip_mode, CLIP_MODE_MASK, CLIP_MODE_PATH, and mode.
Referenced by popLayer().
|
inline |
Definition at line 113 of file cairo-render-context.h.
References _eps.
Referenced by Inkscape::Extension::Internal::ps_print_document_to_file().
|
inline |
Definition at line 117 of file cairo-render-context.h.
References _is_filtertobitmap.
Referenced by Inkscape::Extension::Internal::pdf_render_document_to_file(), and Inkscape::Extension::Internal::ps_print_document_to_file().
bool Inkscape::Extension::Internal::CairoRenderContext::setImageTarget | ( | cairo_format_t | format | ) |
Definition at line 278 of file cairo-render-context.cpp.
References _is_valid, _target, and _target_format.
Referenced by popLayer().
void Inkscape::Extension::Internal::CairoRenderContext::setItemTransform | ( | Geom::Affine const & | transform | ) |
Definition at line 976 of file cairo-render-context.cpp.
References _is_valid, _state_stack, and transform().
void Inkscape::Extension::Internal::CairoRenderContext::setMetadata | ( | SPDocument const & | document | ) |
Extract metadata from the document and store it in the context.
Definition at line 751 of file cairo-render-context.cpp.
References _metadata, Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::author, Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::cdate, Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::copyright, Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::creator, Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::keywords, ReproducibleBuilds::now_iso_8601(), rdf_find_entity(), rdf_get_work_entity(), Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::subject, Inkscape::Extension::Internal::CairoRenderContext::CairoRenderContextMetadata::title, and Inkscape::version_string_without_revision.
Referenced by Inkscape::Extension::Internal::CairoRenderer::setupDocument().
|
inline |
Definition at line 116 of file cairo-render-context.h.
References _is_omittext.
Referenced by Inkscape::Extension::Internal::pdf_render_document_to_file(), and Inkscape::Extension::Internal::ps_print_document_to_file().
void Inkscape::Extension::Internal::CairoRenderContext::setPathVector | ( | Geom::PathVector const & | pv | ) |
Definition at line 1806 of file cairo-render-context.cpp.
References _cr, and addPathVector().
Referenced by renderPathVector().
void Inkscape::Extension::Internal::CairoRenderContext::setPDFLevel | ( | unsigned int | level | ) |
Definition at line 393 of file cairo-render-context.cpp.
References _is_pdf, _is_ps, and _pdf_level.
Referenced by Inkscape::Extension::Internal::pdf_render_document_to_file().
bool Inkscape::Extension::Internal::CairoRenderContext::setPdfTarget | ( | gchar const * | utf8_fn | ) |
Definition at line 383 of file cairo-render-context.cpp.
Referenced by Inkscape::Extension::Internal::pdf_render_document_to_file().
void Inkscape::Extension::Internal::CairoRenderContext::setPSLevel | ( | unsigned int | level | ) |
Definition at line 386 of file cairo-render-context.cpp.
References _is_pdf, _is_ps, and _ps_level.
Referenced by Inkscape::Extension::Internal::ps_print_document_to_file().
bool Inkscape::Extension::Internal::CairoRenderContext::setPsTarget | ( | gchar const * | utf8_fn | ) |
Definition at line 384 of file cairo-render-context.cpp.
Referenced by Inkscape::Extension::Internal::ps_print_document_to_file().
void Inkscape::Extension::Internal::CairoRenderContext::setRenderMode | ( | CairoRenderMode | mode | ) |
Definition at line 412 of file cairo-render-context.cpp.
References _render_mode, mode, RENDER_MODE_CLIP, and RENDER_MODE_NORMAL.
Referenced by Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), and popLayer().
void Inkscape::Extension::Internal::CairoRenderContext::setStateForItem | ( | SPItem const * | item | ) |
Definition at line 236 of file cairo-render-context.cpp.
References _is_valid, _state_stack, SPItem::getClipObject(), SPItem::getMaskObject(), item, setStateForStyle(), SPObject::style, and SPItem::transform.
Referenced by Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), Inkscape::Extension::Internal::CairoRenderer::renderItem(), and Inkscape::Extension::Internal::sp_root_render().
void Inkscape::Extension::Internal::CairoRenderContext::setStateForStyle | ( | SPStyle const * | style | ) |
Definition at line 220 of file cairo-render-context.cpp.
References _state_stack, SPStyle::fill, SPStyle::filter, SPStyle::opacity, SPStyle::overflow, SP_CSS_OVERFLOW_VISIBLE, and SPStyle::stroke.
Referenced by Inkscape::Extension::Internal::CairoRenderer::renderHatchPath(), setStateForItem(), and Inkscape::Text::Layout::showGlyphs().
|
inline |
Definition at line 160 of file cairo-render-context.h.
References _state_stack.
Referenced by Inkscape::Extension::Internal::CairoRenderer::renderItem().
|
inline |
Definition at line 159 of file cairo-render-context.h.
References _state_stack.
Referenced by Inkscape::Extension::Internal::CairoRenderer::renderItem().
bool Inkscape::Extension::Internal::CairoRenderContext::setSurfaceTarget | ( | cairo_surface_t * | surface, |
bool | is_vector, | ||
cairo_matrix_t * | ctm = nullptr |
||
) |
Set the cairo_surface_t from an external source.
Definition at line 739 of file cairo-render-context.cpp.
References _finishSurfaceSetup(), _is_valid, _vector_based_target, and surface.
|
inline |
Definition at line 115 of file cairo-render-context.h.
References _is_texttopath.
Referenced by Inkscape::UI::Dialog::Print::draw_page(), Inkscape::Extension::Internal::pdf_render_document_to_file(), and Inkscape::Extension::Internal::ps_print_document_to_file().
void Inkscape::Extension::Internal::CairoRenderContext::setTransform | ( | Geom::Affine const & | transform | ) |
Definition at line 969 of file cairo-render-context.cpp.
References _cr, _is_valid, _state_stack, ink_cairo_transform(), and transform().
Referenced by _createHatchPainter(), _createPatternPainter(), _prepareRenderGraphic(), Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), Inkscape::Extension::Internal::CairoRenderer::applyMask(), and popLayer().
bool Inkscape::Extension::Internal::CairoRenderContext::setupSurface | ( | double | width, |
double | height | ||
) |
Creates the cairo_surface_t for the context with the given width, height and with the currently set target surface type.
Also sets supported metadata on the surface.
Definition at line 694 of file cairo-render-context.cpp.
References _eps, _finishSurfaceSetup(), _height, _is_valid, _pdf_level, _ps_level, _setSurfaceMetadata(), _stream, _target, _target_format, _vector_based_target, _width, Inkscape::Extension::Internal::_write_callback(), height, surface, and width.
Referenced by popLayer(), and Inkscape::Extension::Internal::CairoRenderer::setupDocument().
void Inkscape::Extension::Internal::CairoRenderContext::tagBegin | ( | const char * | link | ) |
Definition at line 639 of file cairo-render-context.cpp.
References _cr.
Referenced by Inkscape::Extension::Internal::sp_anchor_render().
void Inkscape::Extension::Internal::CairoRenderContext::tagEnd | ( | ) |
Definition at line 646 of file cairo-render-context.cpp.
References _cr.
Referenced by Inkscape::Extension::Internal::sp_anchor_render().
void Inkscape::Extension::Internal::CairoRenderContext::transform | ( | Geom::Affine const & | transform | ) |
Definition at line 954 of file cairo-render-context.cpp.
References _cr, _is_valid, _state_stack, getTransform(), ink_cairo_transform(), and transform().
Referenced by _createHatchPainter(), _prepareRenderGraphic(), Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), popLayer(), Inkscape::Extension::Internal::CairoRenderer::renderHatchPath(), renderImage(), Inkscape::Extension::Internal::CairoRenderer::renderItem(), Inkscape::Extension::Internal::CairoRenderer::renderPage(), setItemTransform(), setTransform(), Inkscape::Extension::Internal::sp_root_render(), Inkscape::Extension::Internal::sp_symbol_render(), Inkscape::Extension::Internal::sp_use_render(), and transform().
|
friend |
Definition at line 67 of file cairo-render-context.h.
|
private |
Definition at line 195 of file cairo-render-context.h.
Referenced by getBitmapResolution(), operator=(), and setBitmapResolution().
|
private |
Definition at line 224 of file cairo-render-context.h.
Referenced by getClipMode(), operator=(), popLayer(), renderGlyphtext(), renderPathVector(), and setClipMode().
|
private |
Definition at line 207 of file cairo-render-context.h.
Referenced by operator=().
|
private |
Definition at line 208 of file cairo-render-context.h.
Referenced by operator=().
|
private |
Definition at line 214 of file cairo-render-context.h.
Referenced by _createPatternForPaintServer(), _finishSurfaceSetup(), _freeResources(), _prepareRenderGraphic(), _setFillStyle(), _setStrokeStyle(), addClipPath(), addClippingRect(), addPathVector(), Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), createSimilar(), destBegin(), destEnd(), finish(), finishPage(), getTransform(), operator=(), popLayer(), popState(), pushLayer(), pushState(), renderGlyphtext(), renderImage(), renderPathVector(), setPathVector(), setTransform(), tagBegin(), tagEnd(), and transform().
|
private |
Definition at line 192 of file cairo-render-context.h.
Referenced by operator=(), and popLayer().
|
private |
Definition at line 198 of file cairo-render-context.h.
Referenced by operator=(), setEPS(), and setupSurface().
|
private |
Definition at line 263 of file cairo-render-context.h.
Referenced by _freeResources(), and renderGlyphtext().
|
private |
Definition at line 191 of file cairo-render-context.h.
Referenced by _finishSurfaceSetup(), createSimilar(), nextPage(), operator=(), popLayer(), and setupSurface().
|
private |
Definition at line 202 of file cairo-render-context.h.
Referenced by getFilterToBitmap(), operator=(), and setFilterToBitmap().
|
private |
Definition at line 200 of file cairo-render-context.h.
Referenced by _prepareRenderGraphic(), _prepareRenderText(), operator=(), renderGlyphtext(), and setOmitText().
|
private |
Definition at line 204 of file cairo-render-context.h.
Referenced by nextPage(), operator=(), setPDFLevel(), and setPSLevel().
|
private |
Definition at line 205 of file cairo-render-context.h.
Referenced by nextPage(), operator=(), setPDFLevel(), and setPSLevel().
|
private |
Definition at line 201 of file cairo-render-context.h.
Referenced by finish(), finishPage(), nextPage(), and operator=().
|
private |
Definition at line 199 of file cairo-render-context.h.
Referenced by operator=(), renderGlyphtext(), and setTextToPath().
|
private |
Definition at line 197 of file cairo-render-context.h.
Referenced by _finishSurfaceSetup(), addClipPath(), addClippingRect(), Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), Inkscape::Extension::Internal::CairoRenderer::applyMask(), createSimilar(), finish(), finishPage(), getParentTransform(), getSurface(), getTransform(), nextPage(), operator=(), popLayer(), popState(), pushLayer(), pushState(), renderImage(), renderPathVector(), setImageTarget(), setItemTransform(), setStateForItem(), setSurfaceTarget(), setTransform(), setupSurface(), and transform().
|
private |
Definition at line 219 of file cairo-render-context.h.
Referenced by _freeResources(), finish(), and operator=().
|
private |
Referenced by _setSurfaceMetadata(), operator=(), and setMetadata().
|
private |
Definition at line 210 of file cairo-render-context.h.
Referenced by _prepareRenderGraphic(), _prepareRenderText(), and operator=().
|
private |
Definition at line 193 of file cairo-render-context.h.
Referenced by operator=(), setPDFLevel(), and setupSurface().
|
private |
Definition at line 194 of file cairo-render-context.h.
Referenced by operator=(), setPSLevel(), and setupSurface().
|
private |
Definition at line 223 of file cairo-render-context.h.
Referenced by _prepareRenderGraphic(), getRenderMode(), operator=(), popLayer(), renderGlyphtext(), renderImage(), renderPathVector(), and setRenderMode().
|
private |
Definition at line 221 of file cairo-render-context.h.
Referenced by _createHatchPainter(), _createPatternPainter(), createSimilar(), getRenderer(), operator=(), and popLayer().
|
private |
Definition at line 220 of file cairo-render-context.h.
Referenced by _addState(), _mergedOpacity(), _prepareRenderGraphic(), getCurrentState(), getParentState(), operator=(), popState(), pushState(), renderPathVector(), setItemTransform(), setStateForItem(), setStateForStyle(), setStateMergeOpacity(), setStateNeedsLayer(), setTransform(), and transform().
|
private |
Definition at line 212 of file cairo-render-context.h.
Referenced by _freeResources(), _setVectorTarget(), finish(), operator=(), and setupSurface().
|
private |
Definition at line 215 of file cairo-render-context.h.
Referenced by _finishSurfaceSetup(), _freeResources(), createSimilar(), finish(), getSurface(), nextPage(), operator=(), renderPathVector(), and saveAsPng().
|
private |
Definition at line 216 of file cairo-render-context.h.
Referenced by _prepareRenderGraphic(), _prepareRenderText(), _setSurfaceMetadata(), _setVectorTarget(), operator=(), setImageTarget(), and setupSurface().
|
private |
Definition at line 217 of file cairo-render-context.h.
Referenced by operator=(), setImageTarget(), and setupSurface().
|
private |
Definition at line 209 of file cairo-render-context.h.
Referenced by _createPatternPainter(), _finishSurfaceSetup(), _setVectorTarget(), finish(), finishPage(), nextPage(), operator=(), popLayer(), pushLayer(), renderImage(), setSurfaceTarget(), Inkscape::Extension::Internal::CairoRenderer::setupDocument(), and setupSurface().
|
private |
Definition at line 190 of file cairo-render-context.h.
Referenced by _finishSurfaceSetup(), createSimilar(), nextPage(), operator=(), popLayer(), and setupSurface().