Inkscape
Vector Graphics Editor
|
SVG drawing item for display. More...
#include <drawing-item.h>
Public Types | |
enum | RenderFlags { RENDER_DEFAULT = 0 , RENDER_CACHE_ONLY = 1 << 0 , RENDER_BYPASS_CACHE = 1 << 1 , RENDER_FILTER_BACKGROUND = 1 << 2 , RENDER_OUTLINE = 1 << 3 , RENDER_NO_FILTERS = 1 << 4 , RENDER_VISIBLE_HAIRLINES = 1 << 5 } |
enum | StateFlags { STATE_NONE = 0 , STATE_BBOX = 1 << 0 , STATE_CACHE = 1 << 1 , STATE_PICK = 1 << 2 , STATE_RENDER = 1 << 3 , STATE_BACKGROUND = 1 << 4 , STATE_ALL = (1 << 5) - 1 , STATE_TOTAL_INV = 1 << 5 } |
enum | PickFlags { PICK_NORMAL = 0 , PICK_STICKY = 1 << 0 , PICK_AS_CLIP = 1 << 1 , PICK_OUTLINE = 1 << 2 } |
Public Member Functions | |
DrawingItem (Drawing &drawing) | |
DrawingItem (DrawingItem const &)=delete | |
DrawingItem & | operator= (DrawingItem const &)=delete |
void | unlink () |
virtual int | tag () const |
Unlink this node and its subtree from the rendering tree and destroy. | |
Geom::OptIntRect const & | bbox () const |
Geom::OptIntRect const & | drawbox () const |
Geom::OptRect const & | itemBounds () const |
Geom::Affine const & | ctm () const |
Geom::Affine | transform () const |
Drawing & | drawing () const |
DrawingItem * | parent () const |
bool | isAncestorOf (DrawingItem const *item) const |
Returns true if item is among the descendants. Will return false if item == this. | |
int | getUpdateComplexity () const |
bool | unisolatedBlend () const |
void | appendChild (DrawingItem *item) |
void | prependChild (DrawingItem *item) |
void | clearChildren () |
bool | visible () const |
void | setVisible (bool visible) |
bool | sensitive () const |
void | setSensitive (bool sensitive) |
virtual void | setStyle (SPStyle const *style, SPStyle const *context_style=nullptr) |
Process information related to the new style. | |
virtual void | setChildrenStyle (SPStyle const *context_style) |
Recursively update children style. | |
void | setOpacity (float opacity) |
void | setAntialiasing (Antialiasing antialias) |
void | setIsolation (bool isolation) |
void | setBlendMode (SPBlendMode blend_mode) |
void | setTransform (Geom::Affine const &trans) |
void | setClip (DrawingItem *item) |
void | setMask (DrawingItem *item) |
void | setFillPattern (DrawingPattern *pattern) |
void | setStrokePattern (DrawingPattern *pattern) |
void | setZOrder (unsigned zorder) |
Move this item to the given place in the Z order of siblings. Does nothing if the item is not a normal child. | |
void | setItemBounds (Geom::OptRect const &bounds) |
void | setFilterRenderer (std::unique_ptr< Filters::Filter > renderer) |
void | setKey (unsigned key) |
unsigned | key () const |
void | setItem (SPItem *item) |
SPItem * | getItem () const |
void | update (Geom::IntRect const &area=Geom::IntRect::infinite(), UpdateContext const &ctx=UpdateContext(), unsigned flags=STATE_ALL, unsigned reset=0) |
Update derived data before operations. | |
unsigned | render (DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags=0, DrawingItem const *stop_at=nullptr) const |
Rasterize items. | |
unsigned | render (DrawingContext &dc, Geom::IntRect const &area, unsigned flags=0) const |
A stand alone render, ignoring all other objects in the document. | |
void | clip (DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area) const |
Rasterize the clipping path. | |
DrawingItem * | pick (Geom::Point const &p, double delta, unsigned flags=0) |
Get the item under the specified point. | |
Glib::ustring | name () const |
void | recursivePrintTree (unsigned level=0) const |
Protected Types | |
enum class | ChildType : unsigned char { ORPHAN = 0 , NORMAL = 1 , CLIP = 2 , MASK = 3 , FILL = 4 , STROKE = 5 , ROOT = 6 } |
enum | RenderResult { RENDER_OK = 0 , RENDER_STOP = 1 } |
using | ListHook = boost::intrusive::list_member_hook<> |
using | ChildrenList = boost::intrusive::list< DrawingItem, boost::intrusive::member_hook< DrawingItem, ListHook, &DrawingItem::_child_hook > > |
Protected Member Functions | |
virtual | ~DrawingItem () |
void | _renderOutline (DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags) const |
void | _markForUpdate (unsigned state, bool propagate) |
Marks the item as needing a recomputation of internal data. | |
void | _markForRendering () |
Marks the current visual bounding box of the item for redrawing. | |
void | _invalidateFilterBackground (Geom::IntRect const &area) |
double | _cacheScore () |
Compute the caching score. | |
Geom::OptIntRect | _cacheRect () const |
void | _setCached (bool cached, bool persistent=false) |
Enable / disable storing the rendering in memory. | |
virtual unsigned | _updateItem (Geom::IntRect const &area, UpdateContext const &ctx, unsigned flags, unsigned reset) |
virtual unsigned | _renderItem (DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags, DrawingItem const *stop_at) const |
virtual void | _clipItem (DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area) const |
virtual DrawingItem * | _pickItem (Geom::Point const &p, double delta, unsigned flags) |
virtual bool | _canClip () const |
virtual void | _dropPatternCache () |
template<typename F > | |
void | defer (F &&f) |
Protected Attributes | |
Drawing & | _drawing |
DrawingItem * | _parent |
ListHook | _child_hook |
ChildrenList | _children |
unsigned | _key |
Auxiliary key used by the object tree for showing clips/masks/patterns. | |
SPItem * | _item |
Used to associate DrawingItems with SPItems that created them. | |
SPStyle const * | _style |
SPStyle const * | _context_style |
float | _opacity |
std::unique_ptr< Geom::Affine > | _transform |
Incremental transform from parent to this item's coords. | |
Geom::Affine | _ctm |
Total transform from item coords to display coords. | |
Geom::OptIntRect | _bbox |
Bounding box in display (pixel) coords including stroke. | |
Geom::OptIntRect | _drawbox |
Full visual bounding box - enlarged by filters, shrunk by clips and masks. | |
Geom::OptRect | _item_bbox |
Geometric bounding box in item's user space. | |
DrawingItem * | _clip |
DrawingItem * | _mask |
DrawingPattern * | _fill_pattern |
DrawingPattern * | _stroke_pattern |
std::unique_ptr< Inkscape::Filters::Filter > | _filter |
std::unique_ptr< CacheData > | _cache |
int | _update_complexity = 0 |
bool | _contains_unisolated_blend: 1 |
CacheList::iterator | _cache_iterator |
bool | style_vector_effect_size: 1 |
bool | style_vector_effect_rotate: 1 |
bool | style_vector_effect_fixed: 1 |
unsigned | _state: 8 |
unsigned | _propagate_state: 8 |
ChildType | _child_type: 3 |
unsigned | _background_new: 1 |
Whether enable-background: new is set for this element. | |
unsigned | _background_accumulate: 1 |
Whether this element accumulates background (has any ancestor with enable-background: new) | |
unsigned | _visible: 1 |
unsigned | _sensitive: 1 |
Whether this item responds to events. | |
unsigned | _cached_persistent: 1 |
If set, will always be cached regardless of score. | |
unsigned | _has_cache_iterator: 1 |
If set, _cache_iterator is valid. | |
unsigned | _pick_children: 1 |
For groups: if true, children are returned from pick(), otherwise the group is returned. | |
Antialiasing | _antialias: 2 |
antialiasing level (default is Good) | |
bool | _isolation: 1 |
SPBlendMode | _blend_mode |
Friends | |
class | Drawing |
SVG drawing item for display.
This class represents the renderable portion of the SVG document. Typically this is created by the SP tree, in particular the invoke_show() virtual function.
Deleting a DrawingItem will cause all of its children to be deleted as well. This can lead to nasty surprises if you hold references to things which are children of what is being deleted. Therefore, in the SP tree, you always need to delete the item views of children before deleting the view of the parent. Do not call delete on things returned from invoke_show()
Outside of the SP tree, you should not use any references after the root node has been deleted.
Definition at line 81 of file drawing-item.h.
|
protected |
Definition at line 205 of file drawing-item.h.
|
protected |
Definition at line 202 of file drawing-item.h.
|
strongprotected |
Enumerator | |
---|---|
ORPHAN | |
NORMAL | |
CLIP | |
MASK | |
FILL | |
STROKE | |
ROOT |
Definition at line 169 of file drawing-item.h.
Enumerator | |
---|---|
PICK_NORMAL | |
PICK_STICKY | |
PICK_AS_CLIP | |
PICK_OUTLINE |
Definition at line 105 of file drawing-item.h.
Enumerator | |
---|---|
RENDER_DEFAULT | |
RENDER_CACHE_ONLY | |
RENDER_BYPASS_CACHE | |
RENDER_FILTER_BACKGROUND | |
RENDER_OUTLINE | |
RENDER_NO_FILTERS | |
RENDER_VISIBLE_HAIRLINES |
Definition at line 84 of file drawing-item.h.
|
protected |
Enumerator | |
---|---|
RENDER_OK | |
RENDER_STOP |
Definition at line 179 of file drawing-item.h.
Enumerator | |
---|---|
STATE_NONE | |
STATE_BBOX | |
STATE_CACHE | |
STATE_PICK | |
STATE_RENDER | |
STATE_BACKGROUND | |
STATE_ALL | |
STATE_TOTAL_INV |
Definition at line 94 of file drawing-item.h.
Inkscape::DrawingItem::DrawingItem | ( | Drawing & | drawing | ) |
Definition at line 64 of file drawing-item.cpp.
|
delete |
|
protectedvirtual |
Definition at line 96 of file drawing-item.cpp.
References _cache_iterator, Inkscape::Drawing::_candidate_items, _children, _clip, _drawing, _fill_pattern, _has_cache_iterator, _mask, _setCached(), _stroke_pattern, c, and Inkscape::Drawing::getCanvasItemDrawing().
|
protected |
Definition at line 1231 of file drawing-item.cpp.
References _drawbox, _drawing, and Inkscape::Drawing::cacheLimit().
Referenced by _cacheScore(), render(), and update().
|
protected |
Compute the caching score.
Higher scores mean the item is more aggressively prioritized for automatic caching by Inkscape::Drawing.
Definition at line 1202 of file drawing-item.cpp.
References _bbox, _cacheRect(), _cacheScore(), _clip, _ctm, _drawing, _filter, _mask, Geom::GenericRect< C >::area(), Geom::GenericOptRect< C >::area(), Geom::GenericRect< C >::from_xywh(), Inkscape::NO_FILTERS, and Inkscape::Drawing::renderMode().
Referenced by _cacheScore(), and update().
|
inlineprotectedvirtual |
Reimplemented in Inkscape::DrawingGroup, Inkscape::DrawingShape, and Inkscape::DrawingText.
Definition at line 196 of file drawing-item.h.
Referenced by clip().
|
inlineprotectedvirtual |
Reimplemented in Inkscape::DrawingGroup, Inkscape::DrawingShape, and Inkscape::DrawingText.
Definition at line 194 of file drawing-item.h.
Referenced by clip().
|
inlineprotectedvirtual |
Reimplemented in Inkscape::DrawingPattern.
Definition at line 197 of file drawing-item.h.
Referenced by update().
|
protected |
Definition at line 1142 of file drawing-item.cpp.
References _cache, _children, _drawbox, _filter, and Geom::GenericOptRect< C >::intersects().
Referenced by _markForRendering().
|
protected |
Marks the current visual bounding box of the item for redrawing.
This is called whenever the object changes its visible appearance. For some cases (such as setting opacity) this is enough, but for others _markForUpdate() also needs to be called.
Definition at line 1111 of file drawing-item.cpp.
References _bbox, _drawbox, _drawing, _filter, _invalidateFilterBackground(), _parent, drawing(), Inkscape::OUTLINE, Inkscape::outline(), Inkscape::Drawing::outlineOverlay(), and Inkscape::Drawing::renderMode().
Referenced by Inkscape::DrawingText::addComponent(), clearChildren(), setAntialiasing(), setBlendMode(), Inkscape::DrawingGroup::setChildTransform(), setClip(), Inkscape::Drawing::setClip(), Inkscape::Drawing::setClipOutlineColor(), Inkscape::Drawing::setColorMode(), setFillPattern(), setFilterRenderer(), Inkscape::DrawingGlyphs::setGlyph(), Inkscape::Drawing::setGrayscaleMatrix(), Inkscape::Drawing::setImageOutlineColor(), Inkscape::Drawing::setImageOutlineMode(), setIsolation(), setMask(), Inkscape::Drawing::setMaskOutlineColor(), setOpacity(), Inkscape::DrawingShape::setPath(), Inkscape::DrawingPattern::setPatternToUserTransform(), Inkscape::Drawing::setRenderMode(), setStrokePattern(), setStyle(), setTransform(), setVisible(), setZOrder(), unlink(), and update().
|
protected |
Marks the item as needing a recomputation of internal data.
This mechanism avoids traversing the entire rendering tree (which could be vast) on every trivial state changed in any item. Only items marked as needing an update (having some bits in their _state unset) will be traversed during the update call.
The _propagate variable is another optimization. We use it to specify that all children should also have the corresponding flags unset before checking whether they need to be traversed. This way there is one less traversal of the tree. Without this we would need to unset state bits in all children. With _propagate we do this during the update call, when we have to recurse into children anyway.
Definition at line 1170 of file drawing-item.cpp.
References _markForUpdate(), _parent, _propagate_state, _state, drawing(), Inkscape::Drawing::getCanvasItemDrawing(), and Inkscape::CanvasItem::request_update().
Referenced by _markForUpdate(), clearChildren(), Inkscape::Drawing::setAntialiasingOverride(), Inkscape::Drawing::setBlurQuality(), Inkscape::DrawingGroup::setChildTransform(), setClip(), Inkscape::DrawingImage::setClipbox(), Inkscape::Drawing::setDithering(), setFillPattern(), Inkscape::Drawing::setFilterQuality(), Inkscape::DrawingGlyphs::setGlyph(), setMask(), Inkscape::DrawingImage::setOrigin(), Inkscape::Drawing::setOutlineOverlay(), Inkscape::DrawingShape::setPath(), Inkscape::DrawingPattern::setPatternToUserTransform(), Inkscape::DrawingImage::setPixbuf(), Inkscape::Drawing::setRenderMode(), Inkscape::DrawingImage::setScale(), setStrokePattern(), setStyle(), Inkscape::DrawingPattern::setTileRect(), setTransform(), and unlink().
|
inlineprotectedvirtual |
Reimplemented in Inkscape::DrawingGroup, Inkscape::DrawingImage, Inkscape::DrawingShape, Inkscape::DrawingGlyphs, and Inkscape::DrawingText.
Definition at line 195 of file drawing-item.h.
Referenced by pick().
|
inlineprotectedvirtual |
Reimplemented in Inkscape::DrawingGroup, Inkscape::DrawingImage, Inkscape::DrawingShape, and Inkscape::DrawingText.
Definition at line 193 of file drawing-item.h.
References RENDER_OK.
Referenced by _renderOutline(), and render().
|
protected |
Definition at line 954 of file drawing-item.cpp.
References _bbox, _clip, _drawing, _mask, _renderItem(), Inkscape::Drawing::clipOutlineColor(), Geom::intersect(), Inkscape::Drawing::maskOutlineColor(), rc, and render().
Referenced by render().
|
protected |
Enable / disable storing the rendering in memory.
Calling setCached(false, true) will also remove the persistent status
Definition at line 256 of file drawing-item.cpp.
References _cache, Inkscape::Drawing::_cached_items, _cached_persistent, and _drawing.
Referenced by update(), and ~DrawingItem().
|
inlineprotectedvirtual |
Reimplemented in Inkscape::DrawingGroup, Inkscape::DrawingImage, Inkscape::DrawingPattern, Inkscape::DrawingShape, Inkscape::DrawingGlyphs, and Inkscape::DrawingText.
Definition at line 192 of file drawing-item.h.
Referenced by update().
void Inkscape::DrawingItem::appendChild | ( | DrawingItem * | item | ) |
Definition at line 142 of file drawing-item.cpp.
References _children, defer(), item, NORMAL, ORPHAN, and STATE_ALL.
Referenced by SPGroup::_showChildren(), SPSwitch::_showChildren(), Inkscape::DrawingText::addComponent(), SPPattern::attach_view(), SPClipPath::show(), SPMask::show(), and SPHatch::show().
|
inline |
Definition at line 119 of file drawing-item.h.
References _bbox.
void Inkscape::DrawingItem::clearChildren | ( | ) |
Definition at line 177 of file drawing-item.cpp.
References _children, _markForRendering(), _markForUpdate(), c, defer(), and STATE_ALL.
Referenced by SPFlowtext::_clearFlow(), and SPText::_clearFlow().
void Inkscape::DrawingItem::clip | ( | DrawingContext & | dc, |
Inkscape::RenderContext & | rc, | ||
Geom::IntRect const & | area | ||
) | const |
Rasterize the clipping path.
This method submits drawing operations required to draw a basic filled shape of the item to the supplied drawing context. Rendering is limited to the given area. The rendering of the clipped object is composited into the result of this call using the IN operator. See the implementation of render() for details.
Definition at line 988 of file drawing-item.cpp.
References _bbox, _canClip(), _clip, _clipItem(), _visible, clip(), Geom::GenericRect< C >::intersects(), Inkscape::DrawingContext::paint(), Inkscape::DrawingContext::popGroupToSource(), Inkscape::DrawingContext::pushGroup(), rc, Inkscape::DrawingContext::setOperator(), and Inkscape::DrawingContext::setSource().
|
inline |
|
inlineprotected |
Definition at line 259 of file drawing-item.h.
References _drawing, Inkscape::Drawing::defer(), and drawing().
Referenced by Inkscape::DrawingText::addComponent(), appendChild(), clearChildren(), prependChild(), setAntialiasing(), setBlendMode(), Inkscape::DrawingShape::setChildrenStyle(), Inkscape::DrawingText::setChildrenStyle(), Inkscape::DrawingGroup::setChildTransform(), setClip(), Inkscape::DrawingImage::setClipbox(), setFillPattern(), setFilterRenderer(), Inkscape::DrawingGlyphs::setGlyph(), setIsolation(), setItemBounds(), setMask(), setOpacity(), Inkscape::DrawingImage::setOrigin(), Inkscape::DrawingPattern::setOverflow(), Inkscape::DrawingShape::setPath(), Inkscape::DrawingPattern::setPatternToUserTransform(), Inkscape::DrawingGroup::setPickChildren(), Inkscape::DrawingImage::setPixbuf(), Inkscape::DrawingImage::setScale(), setSensitive(), setStrokePattern(), setStyle(), Inkscape::DrawingImage::setStyle(), Inkscape::DrawingShape::setStyle(), Inkscape::DrawingText::setStyle(), Inkscape::DrawingPattern::setTileRect(), setTransform(), setVisible(), setZOrder(), and unlink().
|
inline |
Definition at line 120 of file drawing-item.h.
References _drawbox.
Referenced by Inkscape::Filters::FilterImage::render_cairo().
|
inline |
Definition at line 124 of file drawing-item.h.
References _drawing.
Referenced by _markForRendering(), _markForUpdate(), and defer().
|
inline |
Definition at line 157 of file drawing-item.h.
References _item.
Referenced by SPDesktop::drawing_handler(), and Inkscape::UI::View::SVGViewWidget::event().
|
inline |
Definition at line 127 of file drawing-item.h.
References _update_complexity.
bool Inkscape::DrawingItem::isAncestorOf | ( | DrawingItem const * | item | ) | const |
Returns true if item is among the descendants. Will return false if item == this.
Definition at line 123 of file drawing-item.cpp.
|
inline |
Definition at line 121 of file drawing-item.h.
References _item_bbox.
|
inline |
Definition at line 155 of file drawing-item.h.
References _key.
Referenced by SPItem::ensure_key(), setKey(), SPShape::show(), and sp_marker_show_instance().
Glib::ustring Inkscape::DrawingItem::name | ( | ) | const |
Definition at line 1077 of file drawing-item.cpp.
References _item, and SPObject::getId().
Referenced by recursivePrintTree().
|
delete |
|
inline |
Definition at line 125 of file drawing-item.h.
References _parent.
DrawingItem * Inkscape::DrawingItem::pick | ( | Geom::Point const & | p, |
double | delta, | ||
unsigned | flags = 0 |
||
) |
Get the item under the specified point.
Searches the tree for the first item in the Z-order which is closer than delta to the given point. The pick should be visual - for example an object with a thick stroke should pick on the entire area of the stroke.
p | Search point |
delta | Maximum allowed distance from the point |
sticky | Whether the pick should ignore visibility and sensitivity. When false, only visible and sensitive objects are considered. When true, invisible and insensitive objects can also be picked. |
Definition at line 1026 of file drawing-item.cpp.
References _bbox, _clip, _drawbox, _mask, _pickItem(), _sensitive, _state, _visible, Geom::GenericRect< C >::contains(), delta, Geom::GenericRect< C >::expandBy(), Inkscape::outline(), pick(), PICK_AS_CLIP, PICK_OUTLINE, PICK_STICKY, STATE_BBOX, and STATE_PICK.
Referenced by Inkscape::DrawingGroup::_pickItem(), Inkscape::DrawingImage::_pickItem(), Inkscape::DrawingShape::_pickItem(), Inkscape::CanvasItemDrawing::contains(), Inkscape::CanvasItemDrawing::handle_event(), Inkscape::Drawing::pick(), and pick().
void Inkscape::DrawingItem::prependChild | ( | DrawingItem * | item | ) |
Definition at line 162 of file drawing-item.cpp.
References _children, defer(), item, NORMAL, ORPHAN, and STATE_ALL.
Referenced by SPDesktop::_attachDocument(), and Inkscape::UI::View::SVGViewWidget::setDocument().
void Inkscape::DrawingItem::recursivePrintTree | ( | unsigned | level = 0 | ) | const |
Definition at line 1090 of file drawing-item.cpp.
unsigned Inkscape::DrawingItem::render | ( | DrawingContext & | dc, |
Geom::IntRect const & | area, | ||
unsigned | flags = 0 |
||
) | const |
A stand alone render, ignoring all other objects in the document.
Definition at line 944 of file drawing-item.cpp.
References Inkscape::Drawing::_antialiasing_override, _drawing, Inkscape::Drawing::_use_dithering, Inkscape::RenderContext::outline_color, rc, and render().
unsigned Inkscape::DrawingItem::render | ( | DrawingContext & | dc, |
RenderContext & | rc, | ||
Geom::IntRect const & | area, | ||
unsigned | flags = 0 , |
||
DrawingItem const * | stop_at = nullptr |
||
) | const |
Rasterize items.
This method submits the drawing operations required to draw this item to the supplied DrawingContext, restricting drawing the specified area.
This method does some common tasks and calls the item-specific rendering function, _renderItem(), to render e.g. paths or bitmaps.
flags | Rendering options. This deals mainly with cache control. |
Definition at line 703 of file drawing-item.cpp.
References _antialias, _background_accumulate, _blend_mode, _cache, _cacheRect(), _child_type, _clip, _contains_unisolated_blend, _ctm, _drawbox, _drawing, _filter, _isolation, _mask, _opacity, _renderItem(), _renderOutline(), _visible, Inkscape::apply_antialias(), clip(), Inkscape::Drawing::colorMode(), Inkscape::DrawingSurface::device_scale(), Inkscape::DrawingContext::fill(), Inkscape::GRAYSCALE, Inkscape::Drawing::grayscaleMatrix(), ink_cairo_surface_filter(), ink_css_blend_to_cairo_operator(), Geom::GenericOptRect< C >::intersectWith(), Geom::Affine::isSingular(), Inkscape::outline(), Inkscape::DrawingContext::paint(), Inkscape::DrawingContext::popGroupToSource(), Inkscape::DrawingContext::pushGroup(), Inkscape::DrawingContext::raw(), Inkscape::DrawingContext::rawTarget(), rc, Inkscape::DrawingContext::rectangle(), render(), RENDER_BYPASS_CACHE, RENDER_FILTER_BACKGROUND, RENDER_NO_FILTERS, RENDER_OK, RENDER_OUTLINE, RENDER_STOP, ROOT, Inkscape::DrawingContext::setOperator(), Inkscape::DrawingContext::setSource(), SP_CSS_BLEND_NORMAL, SP_CSS_ISOLATION_ISOLATE, and Inkscape::DrawingContext::surface().
Referenced by _renderOutline(), render(), Inkscape::Drawing::render(), render(), Inkscape::Filters::FilterImage::render_cairo(), and Inkscape::DrawingPattern::renderPattern().
|
inline |
void Inkscape::DrawingItem::setAntialiasing | ( | Antialiasing | antialias | ) |
Definition at line 209 of file drawing-item.cpp.
References _antialias, _markForRendering(), and defer().
void Inkscape::DrawingItem::setBlendMode | ( | SPBlendMode | blend_mode | ) |
Definition at line 227 of file drawing-item.cpp.
References _blend_mode, _markForRendering(), and defer().
|
virtual |
Recursively update children style.
The purpose of this call is to update fill and stroke for markers that have elements with fill/stroke property values of 'context-fill' or 'context-stroke'. Marker styling is not updated like other 'clones' as marker instances are not included the SP object tree. Note: this is a virtual function.
Reimplemented in Inkscape::DrawingShape, and Inkscape::DrawingText.
Definition at line 333 of file drawing-item.cpp.
References _children, and _context_style.
Referenced by Inkscape::DrawingShape::setChildrenStyle(), and Inkscape::DrawingText::setChildrenStyle().
void Inkscape::DrawingItem::setClip | ( | DrawingItem * | item | ) |
Definition at line 341 of file drawing-item.cpp.
References _clip, _markForRendering(), _markForUpdate(), CLIP, defer(), item, ORPHAN, and STATE_ALL.
void Inkscape::DrawingItem::setFillPattern | ( | DrawingPattern * | pattern | ) |
Definition at line 373 of file drawing-item.cpp.
References _child_type, _fill_pattern, _markForRendering(), _markForUpdate(), _parent, defer(), FILL, ORPHAN, and STATE_ALL.
void Inkscape::DrawingItem::setFilterRenderer | ( | std::unique_ptr< Filters::Filter > | renderer | ) |
Definition at line 428 of file drawing-item.cpp.
References _filter, _markForRendering(), and defer().
void Inkscape::DrawingItem::setIsolation | ( | bool | isolation | ) |
Definition at line 218 of file drawing-item.cpp.
References _isolation, _markForRendering(), and defer().
|
inline |
Definition at line 156 of file drawing-item.h.
void Inkscape::DrawingItem::setItemBounds | ( | Geom::OptRect const & | bounds | ) |
Definition at line 421 of file drawing-item.cpp.
References _item_bbox, bounds, and defer().
|
inline |
Definition at line 154 of file drawing-item.h.
Referenced by SPItem::ensure_key().
void Inkscape::DrawingItem::setMask | ( | DrawingItem * | item | ) |
Definition at line 357 of file drawing-item.cpp.
References _markForRendering(), _markForUpdate(), _mask, defer(), item, MASK, ORPHAN, and STATE_ALL.
void Inkscape::DrawingItem::setOpacity | ( | float | opacity | ) |
Definition at line 200 of file drawing-item.cpp.
References _markForRendering(), _opacity, and defer().
Referenced by Inkscape::Drawing::setOpacity(), Inkscape::Display::TranslucencyGroup::setSolidItem(), sp_generate_internal_bitmap(), Inkscape::UI::Tools::SelectTool::sp_select_context_cycle_through_items(), and Inkscape::UI::Tools::SelectTool::sp_select_context_reset_opacities().
void Inkscape::DrawingItem::setSensitive | ( | bool | sensitive | ) |
Definition at line 245 of file drawing-item.cpp.
References _sensitive, defer(), and sensitive().
void Inkscape::DrawingItem::setStrokePattern | ( | DrawingPattern * | pattern | ) |
Definition at line 389 of file drawing-item.cpp.
References _child_type, _markForRendering(), _markForUpdate(), _parent, _stroke_pattern, defer(), ORPHAN, STATE_ALL, and STROKE.
|
virtual |
Process information related to the new style.
Note: _style is not used by DrawingGlyphs which uses its parent style.
Reimplemented in Inkscape::DrawingImage, Inkscape::DrawingShape, Inkscape::DrawingGlyphs, and Inkscape::DrawingText.
Definition at line 287 of file drawing-item.cpp.
References _background_new, _context_style, _markForRendering(), _markForUpdate(), _parent, _style, defer(), SPStyle::enable_background, SP_CSS_BACKGROUND_NEW, STATE_ALL, STATE_BACKGROUND, style_vector_effect_fixed, style_vector_effect_rotate, style_vector_effect_size, and SPStyle::vector_effect.
Referenced by Inkscape::DrawingImage::setStyle(), Inkscape::DrawingShape::setStyle(), Inkscape::DrawingText::setStyle(), SPFlowtext::show(), SPGroup::show(), SPText::show(), and SPUse::show().
void Inkscape::DrawingItem::setTransform | ( | Geom::Affine const & | trans | ) |
Definition at line 187 of file drawing-item.cpp.
References _markForRendering(), _markForUpdate(), _transform, Geom::are_near(), current, defer(), Geom::identity(), Geom::Affine::isIdentity(), STATE_ALL, and transform().
Referenced by render_surface(), Inkscape::DrawingGlyphs::setGlyph(), sp_export_png_file(), sp_generate_internal_bitmap(), and Inkscape::UI::Dialog::sp_icon_doc_icon().
void Inkscape::DrawingItem::setVisible | ( | bool | visible | ) |
Definition at line 236 of file drawing-item.cpp.
References _markForRendering(), _visible, defer(), and visible().
void Inkscape::DrawingItem::setZOrder | ( | unsigned | zorder | ) |
Move this item to the given place in the Z order of siblings. Does nothing if the item is not a normal child.
Definition at line 406 of file drawing-item.cpp.
References _child_type, _children, _markForRendering(), _parent, defer(), and NORMAL.
Referenced by SPPattern::order_changed().
|
inlinevirtual |
Unlink this node and its subtree from the rendering tree and destroy.
Reimplemented in Inkscape::DrawingGroup, Inkscape::DrawingImage, Inkscape::DrawingPattern, Inkscape::DrawingShape, Inkscape::DrawingGlyphs, and Inkscape::DrawingText.
Definition at line 117 of file drawing-item.h.
References tag_of.
|
inline |
Definition at line 123 of file drawing-item.h.
References _transform, and Geom::identity().
Referenced by Inkscape::DrawingGroup::setChildTransform(), Inkscape::DrawingPattern::setPatternToUserTransform(), and setTransform().
bool Inkscape::DrawingItem::unisolatedBlend | ( | ) | const |
Definition at line 131 of file drawing-item.cpp.
References _blend_mode, _contains_unisolated_blend, _filter, _isolation, _mask, _opacity, SP_CSS_BLEND_NORMAL, and SP_CSS_ISOLATION_ISOLATE.
void Inkscape::DrawingItem::unlink | ( | ) |
Definition at line 1277 of file drawing-item.cpp.
References _child_type, _children, _clip, _drawing, _fill_pattern, _markForRendering(), _markForUpdate(), _mask, _parent, Inkscape::Drawing::_root, _stroke_pattern, CLIP, defer(), FILL, MASK, NORMAL, ROOT, STATE_ALL, and STROKE.
void Inkscape::DrawingItem::update | ( | Geom::IntRect const & | area = Geom::IntRect::infinite() , |
UpdateContext const & | ctx = UpdateContext() , |
||
unsigned | flags = STATE_ALL , |
||
unsigned | reset = 0 |
||
) |
Update derived data before operations.
The purpose of this call is to recompute internal data which depends on the attributes of the object, but is not directly settable by the user. Precomputing this data speeds up later rendering, because some items can be omitted.
Currently this method handles updating the visual and geometric bounding boxes in pixels, storing the total transformation from item space to the screen and cache invalidation.
area | Area to which the update should be restricted. Only takes effect if the bounding box is known. |
ctx | A structure to store cascading state. |
flags | Which internal data should be recomputed. This can be any combination of StateFlags. |
reset | State fields that should be reset before processing them. This is a means to force a recomputation of internal data even if the item considers it up to date. Mainly for internal use, such as propagating bounding box recomputation to children when the item's transform changes. |
Definition at line 458 of file drawing-item.cpp.
References _background_accumulate, _background_new, _bbox, _blend_mode, _cache, _cache_iterator, _cacheRect(), _cacheScore(), Inkscape::Drawing::_candidate_items, _child_type, _clip, _contains_unisolated_blend, _ctm, _drawbox, _drawing, _dropPatternCache(), _fill_pattern, _filter, _has_cache_iterator, _isolation, _item_bbox, _markForRendering(), _mask, _opacity, _parent, _propagate_state, _setCached(), _state, _stroke_pattern, _transform, _update_complexity, _updateItem(), _visible, Geom::are_near(), Geom::GenericOptRect< C >::area(), c, CACHE_SCORE_THRESHOLD, Inkscape::CacheRecord::cache_size, Inkscape::UpdateContext::ctm, ctm(), Geom::Affine::descrim(), Geom::GenericRect< C >::intersects(), Geom::GenericOptRect< C >::intersectWith(), Geom::Affine::inverse(), Inkscape::CacheRecord::item, Inkscape::NO_FILTERS, NORMAL, Inkscape::OUTLINE, Inkscape::outline(), Inkscape::Drawing::outlineOverlay(), Inkscape::Drawing::renderMode(), ROOT, Inkscape::CacheRecord::score, Geom::Affine::setTranslation(), SP_CSS_BLEND_NORMAL, SP_CSS_ISOLATION_ISOLATE, STATE_ALL, STATE_BACKGROUND, STATE_BBOX, STATE_CACHE, STATE_RENDER, STATE_TOTAL_INV, style_vector_effect_fixed, style_vector_effect_rotate, style_vector_effect_size, Geom::GenericOptRect< C >::unionWith(), and update().
Referenced by Inkscape::Filters::FilterImage::update(), Inkscape::Drawing::update(), and update().
|
inline |
Definition at line 134 of file drawing-item.h.
References _visible.
Referenced by Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), and setVisible().
|
friend |
Definition at line 266 of file drawing-item.h.
|
protected |
antialiasing level (default is Good)
Definition at line 253 of file drawing-item.h.
Referenced by Inkscape::Drawing::render(), render(), and setAntialiasing().
|
protected |
Whether this element accumulates background (has any ancestor with enable-background: new)
Definition at line 245 of file drawing-item.h.
|
protected |
Whether enable-background: new is set for this element.
Definition at line 244 of file drawing-item.h.
Referenced by setStyle(), and update().
|
protected |
Bounding box in display (pixel) coords including stroke.
Definition at line 220 of file drawing-item.h.
Referenced by _cacheScore(), _markForRendering(), Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), _renderOutline(), Inkscape::DrawingGroup::_updateItem(), Inkscape::DrawingImage::_updateItem(), Inkscape::DrawingShape::_updateItem(), Inkscape::DrawingGlyphs::_updateItem(), bbox(), clip(), pick(), and update().
|
protected |
Definition at line 256 of file drawing-item.h.
Referenced by render(), setBlendMode(), unisolatedBlend(), and update().
|
protected |
Definition at line 231 of file drawing-item.h.
Referenced by _invalidateFilterBackground(), _setCached(), render(), and update().
|
protected |
Definition at line 235 of file drawing-item.h.
Referenced by update(), and ~DrawingItem().
|
protected |
If set, will always be cached regardless of score.
Definition at line 249 of file drawing-item.h.
Referenced by _setCached().
|
protected |
Definition at line 203 of file drawing-item.h.
|
protected |
Definition at line 243 of file drawing-item.h.
Referenced by render(), setFillPattern(), Inkscape::Drawing::setRoot(), setStrokePattern(), setZOrder(), unlink(), and update().
|
protected |
Definition at line 209 of file drawing-item.h.
Referenced by Inkscape::DrawingGroup::_clipItem(), Inkscape::DrawingText::_clipItem(), _invalidateFilterBackground(), Inkscape::DrawingGroup::_pickItem(), Inkscape::DrawingShape::_pickItem(), Inkscape::DrawingGroup::_renderItem(), Inkscape::DrawingText::_renderItem(), Inkscape::DrawingShape::_renderMarkers(), Inkscape::DrawingGroup::_updateItem(), Inkscape::DrawingShape::_updateItem(), appendChild(), clearChildren(), prependChild(), recursivePrintTree(), setChildrenStyle(), setZOrder(), unlink(), and ~DrawingItem().
|
protected |
Definition at line 226 of file drawing-item.h.
Referenced by _cacheScore(), _renderOutline(), clip(), pick(), render(), setClip(), unlink(), update(), and ~DrawingItem().
|
protected |
Definition at line 233 of file drawing-item.h.
Referenced by Inkscape::DrawingGroup::_updateItem(), render(), unisolatedBlend(), and update().
|
protected |
Definition at line 215 of file drawing-item.h.
Referenced by setChildrenStyle(), Inkscape::DrawingShape::setChildrenStyle(), Inkscape::DrawingText::setChildrenStyle(), setStyle(), Inkscape::DrawingShape::setStyle(), and Inkscape::DrawingText::setStyle().
|
protected |
Total transform from item coords to display coords.
Definition at line 219 of file drawing-item.h.
Referenced by _cacheScore(), Inkscape::DrawingShape::_clipItem(), Inkscape::DrawingImage::_pickItem(), Inkscape::DrawingShape::_pickItem(), Inkscape::DrawingShape::_renderFill(), Inkscape::DrawingImage::_renderItem(), Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), Inkscape::DrawingShape::_renderStroke(), Inkscape::DrawingImage::_updateItem(), ctm(), Inkscape::Drawing::render(), render(), Inkscape::DrawingPattern::renderPattern(), and update().
|
protected |
Full visual bounding box - enlarged by filters, shrunk by clips and masks.
Definition at line 221 of file drawing-item.h.
Referenced by _cacheRect(), _invalidateFilterBackground(), _markForRendering(), drawbox(), pick(), render(), and update().
|
protected |
Definition at line 199 of file drawing-item.h.
Referenced by _cacheRect(), _cacheScore(), _markForRendering(), Inkscape::DrawingImage::_pickItem(), Inkscape::DrawingShape::_pickItem(), Inkscape::DrawingImage::_renderItem(), _renderOutline(), _setCached(), Inkscape::DrawingGroup::_updateItem(), Inkscape::DrawingShape::_updateItem(), Inkscape::DrawingText::addComponent(), defer(), drawing(), render(), render(), Inkscape::DrawingGlyphs::setGlyph(), unlink(), update(), and ~DrawingItem().
|
protected |
Definition at line 228 of file drawing-item.h.
Referenced by Inkscape::DrawingShape::_renderFill(), Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), setFillPattern(), unlink(), update(), and ~DrawingItem().
|
protected |
Definition at line 230 of file drawing-item.h.
Referenced by _cacheScore(), _invalidateFilterBackground(), _markForRendering(), render(), setFilterRenderer(), unisolatedBlend(), and update().
|
protected |
If set, _cache_iterator is valid.
Definition at line 250 of file drawing-item.h.
Referenced by update(), and ~DrawingItem().
|
protected |
Definition at line 255 of file drawing-item.h.
Referenced by render(), setIsolation(), unisolatedBlend(), and update().
|
protected |
Used to associate DrawingItems with SPItems that created them.
Definition at line 213 of file drawing-item.h.
|
protected |
Geometric bounding box in item's user space.
This is used to compute the filter effect region and render in objectBoundingBox units.
Definition at line 222 of file drawing-item.h.
Referenced by Inkscape::DrawingShape::_renderFill(), Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), Inkscape::DrawingShape::_renderStroke(), itemBounds(), setItemBounds(), and update().
|
protected |
Auxiliary key used by the object tree for showing clips/masks/patterns.
Definition at line 212 of file drawing-item.h.
|
protected |
Definition at line 227 of file drawing-item.h.
Referenced by _cacheScore(), _renderOutline(), pick(), render(), setMask(), unisolatedBlend(), unlink(), update(), and ~DrawingItem().
|
protected |
Definition at line 217 of file drawing-item.h.
Referenced by Inkscape::DrawingImage::_pickItem(), render(), setOpacity(), unisolatedBlend(), and update().
|
protected |
Definition at line 200 of file drawing-item.h.
Referenced by _markForRendering(), _markForUpdate(), Inkscape::DrawingGlyphs::_pickItem(), Inkscape::DrawingGlyphs::_updateItem(), parent(), setFillPattern(), setStrokePattern(), setStyle(), setZOrder(), unlink(), and update().
|
protected |
For groups: if true, children are returned from pick(), otherwise the group is returned.
Definition at line 251 of file drawing-item.h.
Referenced by Inkscape::DrawingGroup::_pickItem(), Inkscape::DrawingGroup::pickChildren(), and Inkscape::DrawingGroup::setPickChildren().
|
protected |
Definition at line 242 of file drawing-item.h.
Referenced by _markForUpdate(), and update().
|
protected |
Whether this item responds to events.
Definition at line 248 of file drawing-item.h.
Referenced by pick(), sensitive(), and setSensitive().
|
protected |
Definition at line 241 of file drawing-item.h.
Referenced by _markForUpdate(), Inkscape::DrawingShape::_updateItem(), pick(), and update().
|
protected |
Definition at line 229 of file drawing-item.h.
Referenced by Inkscape::DrawingShape::_renderItem(), Inkscape::DrawingText::_renderItem(), Inkscape::DrawingShape::_renderStroke(), setStrokePattern(), unlink(), update(), and ~DrawingItem().
|
protected |
Definition at line 214 of file drawing-item.h.
Referenced by Inkscape::DrawingShape::setChildrenStyle(), Inkscape::DrawingText::setChildrenStyle(), setStyle(), Inkscape::DrawingImage::setStyle(), Inkscape::DrawingShape::setStyle(), and Inkscape::DrawingText::setStyle().
|
protected |
Incremental transform from parent to this item's coords.
Definition at line 218 of file drawing-item.h.
Referenced by Inkscape::DrawingGlyphs::_updateItem(), setTransform(), transform(), and update().
|
protected |
Definition at line 232 of file drawing-item.h.
Referenced by Inkscape::DrawingGroup::_updateItem(), getUpdateComplexity(), and update().
|
protected |
Definition at line 247 of file drawing-item.h.
Referenced by clip(), pick(), render(), setVisible(), update(), and visible().
|
protected |
Definition at line 239 of file drawing-item.h.
Referenced by setStyle(), and update().
|
protected |
Definition at line 238 of file drawing-item.h.
Referenced by setStyle(), and update().
|
protected |
Definition at line 237 of file drawing-item.h.
Referenced by setStyle(), and update().