3
* @brief Cairo surface that remembers its origin
6
* Krzysztof Kosiński <tweenk.pl@gmail.com>
8
* Copyright (C) 2011 Authors
9
* Released under GNU GPL, read the file 'COPYING' for more information
12
#ifndef SEEN_INKSCAPE_DISPLAY_DRAWING_SURFACE_H
13
#define SEEN_INKSCAPE_DISPLAY_DRAWING_SURFACE_H
15
#include <boost/shared_ptr.hpp>
17
#include <gdk-pixbuf/gdk-pixbuf.h>
18
#include <2geom/affine.h>
19
#include <2geom/rect.h>
20
#include <2geom/transforms.h>
28
explicit DrawingSurface(Geom::IntRect const &area);
29
DrawingSurface(Geom::Rect const &logbox, Geom::IntPoint const &pixdims);
30
DrawingSurface(cairo_surface_t *surface, Geom::Point const &origin);
31
virtual ~DrawingSurface();
33
Geom::Rect area() const;
34
Geom::IntPoint pixels() const;
35
Geom::Point dimensions() const;
36
Geom::Point origin() const;
37
Geom::Scale scale() const;
38
Geom::Affine drawingTransform() const;
39
cairo_surface_type_t type() const;
42
cairo_surface_t *raw() { return _surface; }
43
cairo_t *createRawContext();
46
Geom::IntRect pixelArea() const;
48
cairo_surface_t *_surface;
51
Geom::IntPoint _pixels;
54
friend class DrawingContext;
58
: public DrawingSurface
61
explicit DrawingCache(Geom::IntRect const &area);
64
void markDirty(Geom::IntRect const &area = Geom::IntRect::infinite());
65
void markClean(Geom::IntRect const &area = Geom::IntRect::infinite());
66
void scheduleTransform(Geom::IntRect const &new_area, Geom::Affine const &trans);
68
void paintFromCache(DrawingContext &ct, Geom::OptIntRect &area);
71
cairo_region_t *_clean_region;
72
Geom::IntRect _pending_area;
73
Geom::Affine _pending_transform;
75
void _dumpCache(Geom::OptIntRect const &area);
76
static cairo_rectangle_int_t _convertRect(Geom::IntRect const &r);
77
static Geom::IntRect _convertRect(cairo_rectangle_int_t const &r);
80
} // end namespace Inkscape
82
#endif // !SEEN_INKSCAPE_DISPLAY_DRAWING_ITEM_H
87
c-file-style:"stroustrup"
88
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
93
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :