blob: f8391670f8daa050e31892f737fb58db6bf9119e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#pragma once
#include "CairoResource.h"
#include "cru/platform/graphics/Geometry.h"
#include <cairo/cairo.h>
namespace cru::platform::graphics::cairo {
class CRU_PLATFORM_GRAPHICS_CAIRO_API CairoGeometry : public CairoResource,
public virtual IGeometry {
public:
CairoGeometry(CairoGraphicsFactory* factory, cairo_path_t* cairo_path,
const Matrix& transform = Matrix::Identity(),
bool auto_destroy = true);
~CairoGeometry();
bool FillContains(const Point& point) override;
Rect GetBounds() override;
std::unique_ptr<IGeometry> Transform(const Matrix& matrix) override;
std::unique_ptr<IGeometry> CreateStrokeGeometry(float width) override;
cairo_path_t* GetCairoPath() const { return cairo_path_; }
private:
cairo_path_t* cairo_path_;
Matrix transform_;
bool auto_destroy_;
};
class CRU_PLATFORM_GRAPHICS_CAIRO_API CairoGeometryBuilder
: public CairoResource,
public virtual IGeometryBuilder {};
} // namespace cru::platform::graphics::cairo
|