sw_engine: code refactoring
Some checks are pending
Android / build_x86_64 (push) Waiting to run
Android / build_aarch64 (push) Waiting to run
iOS / build_x86_64 (push) Waiting to run
iOS / build_arm64 (push) Waiting to run
macOS / build (push) Waiting to run
macOS / compact_test (push) Waiting to run
macOS / unit_test (push) Waiting to run
Ubuntu / build (push) Waiting to run
Ubuntu / compact_test (push) Waiting to run
Ubuntu / unit_test (push) Waiting to run
Windows / build (push) Waiting to run
Windows / compact_test (push) Waiting to run
Windows / unit_test (push) Waiting to run

- removed a redundant code, sync() will take over.
- deferred the sync as possible as later
This commit is contained in:
Hermet Park 2025-06-13 15:22:32 +09:00
parent ed93570756
commit 830db9ecb7

View file

@ -383,12 +383,6 @@ bool SwRenderer::postRender()
rasterUnpremultiply(surface);
}
ARRAY_FOREACH(p, tasks) {
if ((*p)->disposed) delete(*p);
else (*p)->pushed = false;
}
tasks.clear();
return true;
}
@ -718,13 +712,6 @@ void* SwRenderer::prepareCommon(SwTask* task, const Matrix& transform, const Arr
if (flags == RenderUpdateFlag::None) return task;
if ((transform.e11 == 0.0f && transform.e12 == 0.0f) || (transform.e21 == 0.0f && transform.e22 == 0.0f)) return task; //zero size?
//TODO: Failed threading them. It would be better if it's possible.
//See: https://github.com/thorvg/thorvg/issues/1409
//Guarantee composition targets get ready.
ARRAY_FOREACH(p, clips) {
static_cast<SwTask*>(*p)->done();
}
task->surface = surface;
task->mpool = mpool;
task->bbox = RenderRegion::intersect(vport, {{0, 0}, {int32_t(surface->w), int32_t(surface->h)}});
@ -738,6 +725,13 @@ void* SwRenderer::prepareCommon(SwTask* task, const Matrix& transform, const Arr
tasks.push(task);
}
//TODO: Failed threading them. It would be better if it's possible.
//See: https://github.com/thorvg/thorvg/issues/1409
//Guarantee composition targets get ready.
ARRAY_FOREACH(p, clips) {
static_cast<SwTask*>(*p)->done();
}
TaskScheduler::request(task);
return task;