class LOTNode;
struct LOT_EXPORT LOTBuffer {
- uint32_t *buffer;
- int width;
- int height;
- int bytesPerLine;
- bool clear;
+ uint32_t *buffer = nullptr;
+ int width = 0;
+ int height = 0;
+ int bytesPerLine = 0;
+ bool clear = true;
};
class LOT_EXPORT LOTPlayer {
// TODO: Consider correct position...
void setSize(int width, int height);
void size(int &width, int &height) const;
- std::future<bool> render(float pos, LOTBuffer &buffer);
- bool renderSync(float pos, LOTBuffer &buffer);
+ std::future<bool> render(float pos, LOTBuffer buffer);
+ bool renderSync(float pos, LOTBuffer buffer);
public:
LOTPlayerPrivate *d;
}
std::future<bool> render(LOTPlayerPrivate *impl, float pos,
- LOTBuffer &buffer)
+ LOTBuffer &&buffer)
{
RenderTask *task = new RenderTask();
task->playerImpl = impl;
task->pos = pos;
- task->buffer = buffer;
+ task->buffer = std::move(buffer);
return async(task);
}
};
return d->renderList();
}
-std::future<bool> LOTPlayer::render(float pos, LOTBuffer &buffer)
+std::future<bool> LOTPlayer::render(float pos, LOTBuffer buffer)
{
- return render_scheduler.render(d, pos, buffer);
+ return render_scheduler.render(d, pos, std::move(buffer));
}
-bool LOTPlayer::renderSync(float pos, LOTBuffer &buffer)
+bool LOTPlayer::renderSync(float pos, LOTBuffer buffer)
{
return d->render(pos, buffer);
}