Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::DrawingCache Class Reference

#include <drawing-surface.h>

Inheritance diagram for Inkscape::DrawingCache:
Inkscape::DrawingSurface

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.
 
- Public Member Functions inherited from Inkscape::DrawingSurface
 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_traw ()
 
cairo_tcreateRawContext ()
 Create a drawing context for this surface.
 

Protected Attributes

cairo_region_t_clean_region
 
Geom::IntRect _pending_area
 
Geom::Affine _pending_transform
 
- Protected Attributes inherited from Inkscape::DrawingSurface
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

- Protected Member Functions inherited from Inkscape::DrawingSurface
Geom::IntRect pixelArea () const
 

Detailed Description

Definition at line 63 of file drawing-surface.h.

Constructor & Destructor Documentation

◆ DrawingCache()

Inkscape::DrawingCache::DrawingCache ( Geom::IntRect const &  area,
int  device_scale = 1 
)
explicit

Definition at line 137 of file drawing-surface.cpp.

◆ ~DrawingCache()

Inkscape::DrawingCache::~DrawingCache ( )
override

Definition at line 144 of file drawing-surface.cpp.

References _clean_region.

Member Function Documentation

◆ _dumpCache()

◆ markClean()

void Inkscape::DrawingCache::markClean ( Geom::IntRect const &  area = Geom::IntRect::infinite())

◆ markDirty()

void Inkscape::DrawingCache::markDirty ( Geom::IntRect const &  area = Geom::IntRect::infinite())

◆ paintFromCache()

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().

◆ prepare()

◆ scheduleTransform()

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.

Member Data Documentation

◆ _clean_region

cairo_region_t* Inkscape::DrawingCache::_clean_region
protected

◆ _pending_area

Geom::IntRect Inkscape::DrawingCache::_pending_area
protected

Definition at line 78 of file drawing-surface.h.

Referenced by prepare(), and scheduleTransform().

◆ _pending_transform

Geom::Affine Inkscape::DrawingCache::_pending_transform
protected

Definition at line 79 of file drawing-surface.h.

Referenced by prepare(), and scheduleTransform().


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