Array<RenderData> clips;
uint32_t opacity;
SwBBox bbox = {{0, 0}, {0, 0}}; //Whole Rendering Region
+ bool pushed = false; //Pushed into task list?
+ bool disposed = false; //Disposed task?
RenderRegion bounds() const
{
bool SwRenderer::clear()
{
- for (auto task = tasks.data; task < (tasks.data + tasks.count); ++task) (*task)->done();
+ for (auto task = tasks.data; task < (tasks.data + tasks.count); ++task) {
+ if ((*task)->disposed) {
+ delete(*task);
+ } else {
+ (*task)->done();
+ (*task)->pushed = false;
+ }
+ }
tasks.clear();
if (!sharedMpool) mpoolClear(mpool);
rasterUnpremultiply(surface);
}
+ for (auto task = tasks.data; task < (tasks.data + tasks.count); ++task) {
+ (*task)->pushed = false;
+ }
tasks.clear();
+
clearCompositors();
return true;
}
if (!task) return true;
task->done();
task->dispose();
- delete(task);
+
+ if (task->pushed) task->disposed = true;
+ else delete(task);
return true;
}
task->bbox.max.x = min(static_cast<SwCoord>(surface->w), static_cast<SwCoord>(vport.x + vport.w));
task->bbox.max.y = min(static_cast<SwCoord>(surface->h), static_cast<SwCoord>(vport.y + vport.h));
- tasks.push(task);
+ if (!task->pushed) {
+ task->pushed = true;
+ tasks.push(task);
+ }
+
TaskScheduler::request(task);
return task;