31 lines
618 B
C++
31 lines
618 B
C++
#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;
|
|
}
|
|
}
|