replace from Scene to Paint at the internal interface.
Picture doesn't need to know the returned Node type.
base class, Paint is enough to in the data passing.
- virtual bool open(const string& path) { /* Not supported */ return false; };
- virtual bool open(const char* data, uint32_t size, bool copy) { /* Not supported */ return false; };
- virtual bool open(const uint32_t* data, uint32_t w, uint32_t h, bool copy) { /* Not supported */ return false; };
+ virtual bool open(const string& path) { return false; };
+ virtual bool open(const char* data, uint32_t size, bool copy) { return false; };
+ virtual bool open(const uint32_t* data, uint32_t w, uint32_t h, bool copy) { return false; };
virtual bool read() = 0;
virtual bool close() = 0;
virtual const uint32_t* pixels() { return nullptr; };
virtual bool read() = 0;
virtual bool close() = 0;
virtual const uint32_t* pixels() { return nullptr; };
- virtual unique_ptr<Scene> scene() { return nullptr; };
+ virtual unique_ptr<Paint> paint() { return nullptr; };
{
if (loader) {
if (!paint) {
{
if (loader) {
if (!paint) {
- auto scene = loader->scene();
- if (scene) {
- paint = scene.release();
+ if (auto p = loader->paint()) {
+ paint = p.release();
loader->close();
if (w != loader->w && h != loader->h) resize();
if (paint) return RenderUpdateFlag::None;
loader->close();
if (w != loader->w && h != loader->h) resize();
if (paint) return RenderUpdateFlag::None;
-unique_ptr<Scene> SvgLoader::scene()
+unique_ptr<Paint> SvgLoader::paint()
{
this->done();
if (root) return move(root);
{
this->done();
if (root) return move(root);
bool close() override;
void run(unsigned tid) override;
bool close() override;
void run(unsigned tid) override;
- unique_ptr<Scene> scene() override;
+ unique_ptr<Paint> paint() override;
-unique_ptr<Scene> TvgLoader::scene()
+unique_ptr<Paint> TvgLoader::paint()
{
this->done();
if (root) return move(root);
{
this->done();
if (root) return move(root);
bool close() override;
void run(unsigned tid) override;
bool close() override;
void run(unsigned tid) override;
- unique_ptr<Scene> scene() override;
+ unique_ptr<Paint> paint() override;