mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-27 08:36:59 +00:00
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
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:
parent
da05042b53
commit
149acea6a4
2 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue