Inkscape
Vector Graphics Editor
|
#include <drawing-surface.h>
Public Member Functions | |
DrawingCache (Geom::IntRect const &area, int device_scale=1) | |
~DrawingCache () override | |
void | markDirty (Geom::IntRect const &area=Geom::IntRect::infinite()) |
void | markClean (Geom::IntRect const &area=Geom::IntRect::infinite()) |
void | scheduleTransform (Geom::IntRect const &new_area, Geom::Affine const &trans) |
Call this during the update phase to schedule a transformation of the cache. | |
void | prepare () |
Transforms the cache according to the transform specified during the update phase. | |
void | paintFromCache (DrawingContext &dc, Geom::OptIntRect &area, bool is_filter) |
Paints the clean area from cache and modifies the area parameter to the bounds of the region that must be repainted. | |
![]() | |
DrawingSurface (Geom::IntRect const &area, int device_scale=1) | |
Creates a surface with the given physical extents. | |
DrawingSurface (Geom::Rect const &logbox, Geom::IntPoint const &pixdims, int device_scale=1) | |
Creates a surface with the given logical and physical extents. | |
DrawingSurface (cairo_surface_t *surface, Geom::Point const &origin) | |
Wrap a cairo_surface_t. | |
virtual | ~DrawingSurface () |
Geom::Rect | area () const |
Get the logical extents of the surface. | |
Geom::IntPoint | pixels () const |
Get the pixel dimensions of the surface. | |
Geom::Point | dimensions () const |
Get the logical width and weight of the surface as a point. | |
Geom::Point | origin () const |
Geom::Scale | scale () const |
int | device_scale () const |
Geom::Affine | drawingTransform () const |
Get the transformation applied to the drawing context on construction. | |
void | dropContents () |
Drop contents of the surface and release the underlying Cairo object. | |
cairo_surface_t * | raw () |
cairo_t * | createRawContext () |
Create a drawing context for this surface. | |
Protected Attributes | |
cairo_region_t * | _clean_region |
Geom::IntRect | _pending_area |
Geom::Affine | _pending_transform |
![]() | |
cairo_surface_t * | _surface |
Geom::Point | _origin |
Geom::Scale | _scale |
Geom::IntPoint | _pixels |
int | _device_scale |
bool | _has_context |
Private Member Functions | |
void | _dumpCache (Geom::OptIntRect const &area) |
Additional Inherited Members | |
![]() | |
Geom::IntRect | pixelArea () const |
Definition at line 63 of file drawing-surface.h.
|
explicit |
Definition at line 137 of file drawing-surface.cpp.
|
override |
Definition at line 144 of file drawing-surface.cpp.
References _clean_region.
|
private |
Definition at line 279 of file drawing-surface.cpp.
References _clean_region, Inkscape::DrawingSurface::_origin, Inkscape::DrawingSurface::_surface, Inkscape::DrawingSurface::area(), cairo_to_geom(), Inkscape::DrawingContext::fill(), ink_cairo_surface_copy(), Inkscape::DrawingContext::rectangle(), Inkscape::DrawingContext::setSource(), and surface.
void Inkscape::DrawingCache::markClean | ( | Geom::IntRect const & | area = Geom::IntRect::infinite() | ) |
Definition at line 155 of file drawing-surface.cpp.
References _clean_region, Inkscape::DrawingSurface::area(), clean, geom_to_cairo(), and Inkscape::DrawingSurface::pixelArea().
void Inkscape::DrawingCache::markDirty | ( | Geom::IntRect const & | area = Geom::IntRect::infinite() | ) |
Definition at line 149 of file drawing-surface.cpp.
References _clean_region, Inkscape::DrawingSurface::area(), and geom_to_cairo().
void Inkscape::DrawingCache::paintFromCache | ( | DrawingContext & | dc, |
Geom::OptIntRect & | area, | ||
bool | is_filter | ||
) |
Paints the clean area from cache and modifies the area parameter to the bounds of the region that must be repainted.
Definition at line 233 of file drawing-surface.cpp.
References _clean_region, Inkscape::DrawingSurface::area(), cairo_to_geom(), Inkscape::DrawingContext::fill(), geom_to_cairo(), Inkscape::DrawingContext::rectangle(), and Inkscape::DrawingContext::setSource().
void Inkscape::DrawingCache::prepare | ( | ) |
Transforms the cache according to the transform specified during the update phase.
Call this during render phase, before painting.
Definition at line 172 of file drawing-surface.cpp.
References _clean_region, Inkscape::DrawingSurface::_origin, _pending_area, _pending_transform, Inkscape::DrawingSurface::_pixels, Inkscape::DrawingSurface::_surface, Geom::are_near(), Inkscape::DrawingSurface::createRawContext(), Geom::GenericRect< C >::dimensions(), geom_to_cairo(), ink_cairo_transform(), Geom::Affine::isIdentity(), Geom::Affine::isTranslation(), limit, Geom::GenericRect< C >::min(), Inkscape::DrawingSurface::pixelArea(), Geom::Point::round(), Geom::Affine::setIdentity(), Geom::Affine::translation(), Geom::IntPoint::x(), and Geom::IntPoint::y().
void Inkscape::DrawingCache::scheduleTransform | ( | Geom::IntRect const & | new_area, |
Geom::Affine const & | trans | ||
) |
Call this during the update phase to schedule a transformation of the cache.
Definition at line 164 of file drawing-surface.cpp.
References _pending_area, and _pending_transform.
|
protected |
Definition at line 77 of file drawing-surface.h.
Referenced by _dumpCache(), markClean(), markDirty(), paintFromCache(), prepare(), and ~DrawingCache().
|
protected |
Definition at line 78 of file drawing-surface.h.
Referenced by prepare(), and scheduleTransform().
|
protected |
Definition at line 79 of file drawing-surface.h.
Referenced by prepare(), and scheduleTransform().