struct SwCanvas::Impl : CanvasBase
{
- uint32_t* buffer = nullptr;
- int stride = 0;
- int height = 0;
-
Impl() : CanvasBase(SwRenderer::inst()) {}
};
auto impl = pImpl.get();
assert(impl);
- impl->buffer = buffer;
- impl->stride = stride;
- impl->height = height;
+ dynamic_cast<SwRenderer*>(impl->renderer)->target(buffer, stride, height);
return 0;
}
int SwCanvas::draw(bool async) noexcept
{
- return 0;
+ auto impl = pImpl.get();
+ assert(impl);
+ return impl->draw();
}
SwCanvas::~SwCanvas()
{
- cout << "SwCanvas(" << this << ") destroyed!" << endl;
}
int SwCanvas::update() noexcept
{
- return 0;
+ auto impl = pImpl.get();
+ assert(impl);
+ return impl->update();
}