renderer/canvas: clean up code

pimpl is not used at all.
This commit is contained in:
Hermet Park 2024-06-16 18:15:39 +09:00 committed by Hermet Park
parent 4c546f843f
commit 784ff30008
3 changed files with 7 additions and 5 deletions

View file

@ -45,15 +45,14 @@ struct GlCanvas::Impl
/************************************************************************/ /************************************************************************/
#ifdef THORVG_GL_RASTER_SUPPORT #ifdef THORVG_GL_RASTER_SUPPORT
GlCanvas::GlCanvas() : Canvas(GlRenderer::gen()), pImpl(new Impl) GlCanvas::GlCanvas() : Canvas(GlRenderer::gen()), pImpl(nullptr)
#else #else
GlCanvas::GlCanvas() : Canvas(nullptr), pImpl(new Impl) GlCanvas::GlCanvas() : Canvas(nullptr), pImpl(nullptr)
#endif #endif
{ {
} }
GlCanvas::~GlCanvas() GlCanvas::~GlCanvas()
{ {
delete(pImpl); delete(pImpl);

View file

@ -46,9 +46,9 @@ struct SwCanvas::Impl
/************************************************************************/ /************************************************************************/
#ifdef THORVG_SW_RASTER_SUPPORT #ifdef THORVG_SW_RASTER_SUPPORT
SwCanvas::SwCanvas() : Canvas(SwRenderer::gen()), pImpl(new Impl) SwCanvas::SwCanvas() : Canvas(SwRenderer::gen()), pImpl(nullptr)
#else #else
SwCanvas::SwCanvas() : Canvas(nullptr), pImpl(new Impl) SwCanvas::SwCanvas() : Canvas(nullptr), pImpl(nullptr)
#endif #endif
{ {
} }

View file

@ -47,11 +47,13 @@ WgCanvas::WgCanvas() : Canvas(nullptr), pImpl(nullptr)
{ {
} }
WgCanvas::~WgCanvas() WgCanvas::~WgCanvas()
{ {
delete pImpl; delete pImpl;
} }
Result WgCanvas::target(void* instance, void* surface, uint32_t w, uint32_t h) noexcept Result WgCanvas::target(void* instance, void* surface, uint32_t w, uint32_t h) noexcept
{ {
#ifdef THORVG_WG_RASTER_SUPPORT #ifdef THORVG_WG_RASTER_SUPPORT
@ -75,6 +77,7 @@ Result WgCanvas::target(void* instance, void* surface, uint32_t w, uint32_t h) n
return Result::NonSupport; return Result::NonSupport;
} }
unique_ptr<WgCanvas> WgCanvas::gen() noexcept unique_ptr<WgCanvas> WgCanvas::gen() noexcept
{ {
#ifdef THORVG_WG_RASTER_SUPPORT #ifdef THORVG_WG_RASTER_SUPPORT