wg/gl: add composition blend mode
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

Set the scene to use Composition mode so that it generates
a pre-composition image, and then normal blend with
destination.

see also: https://github.com/thorvg/thorvg/pull/3621
This commit is contained in:
Sergii Liebodkin 2025-07-25 14:35:07 +09:00 committed by Hermet Park
parent da05042b53
commit 149acea6a4
2 changed files with 3 additions and 2 deletions

View file

@ -985,7 +985,7 @@ bool GlRenderer::blend(BlendMethod method)
if (method == mBlendMethod) return true; if (method == mBlendMethod) return true;
mBlendMethod = method; mBlendMethod = (method == BlendMethod::Composition ? BlendMethod::Normal : method);
return true; return true;
} }

View file

@ -286,7 +286,8 @@ bool WgRenderer::blend(BlendMethod method)
//TODO: support //TODO: support
if (method == BlendMethod::Hue || method == BlendMethod::Saturation || method == BlendMethod::Color || method == BlendMethod::Luminosity || method == BlendMethod::HardMix) return false; if (method == BlendMethod::Hue || method == BlendMethod::Saturation || method == BlendMethod::Color || method == BlendMethod::Luminosity || method == BlendMethod::HardMix) return false;
mBlendMethod = method; mBlendMethod = (method == BlendMethod::Composition ? BlendMethod::Normal : method);
return true; return true;
} }