Add cairo interface.
This commit is contained in:
parent
a03eb9599f
commit
9bcc0ae88e
63 changed files with 1247 additions and 450 deletions
31
src/graphics/cairo/CairoDrawingSurface.cpp
Normal file
31
src/graphics/cairo/CairoDrawingSurface.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
#include "CairoDrawingSurface.h"
|
||||
|
||||
CairoDrawingSurface::CairoDrawingSurface(cairo_surface_t* surface)
|
||||
: mNativeSurface(surface)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CairoDrawingSurface::~CairoDrawingSurface()
|
||||
{
|
||||
DestroyNativeSurface();
|
||||
}
|
||||
|
||||
std::unique_ptr<CairoDrawingSurface> CairoDrawingSurface::Create(cairo_surface_t* surface)
|
||||
{
|
||||
return std::make_unique<CairoDrawingSurface>(surface);
|
||||
}
|
||||
|
||||
cairo_surface_t* CairoDrawingSurface::GetNativeSurface()
|
||||
{
|
||||
return mNativeSurface;
|
||||
}
|
||||
|
||||
void CairoDrawingSurface::DestroyNativeSurface()
|
||||
{
|
||||
if (mNativeSurface)
|
||||
{
|
||||
cairo_surface_destroy (mNativeSurface);
|
||||
mNativeSurface = nullptr;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue