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/CairoDrawingContext.cpp
Normal file
31
src/graphics/cairo/CairoDrawingContext.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
#include "CairoDrawingContext.h"
|
||||
|
||||
cairo_t* CairoDrawingContext::GetNativeContext()
|
||||
{
|
||||
return mNativeContext;
|
||||
}
|
||||
|
||||
CairoDrawingContext::CairoDrawingContext(cairo_t* context)
|
||||
: mNativeContext(context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CairoDrawingContext::~CairoDrawingContext()
|
||||
{
|
||||
DestroyNativeContext();
|
||||
}
|
||||
|
||||
std::unique_ptr<CairoDrawingContext> CairoDrawingContext::Create(cairo_t* context)
|
||||
{
|
||||
return std::make_unique<CairoDrawingContext>(context);
|
||||
}
|
||||
|
||||
void CairoDrawingContext::DestroyNativeContext()
|
||||
{
|
||||
if (mNativeContext)
|
||||
{
|
||||
cairo_destroy (mNativeContext);
|
||||
mNativeContext = nullptr;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue