mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
renderer: precise condition check for skip compositions
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
single child picture would not also requre composition in a scene
This commit is contained in:
parent
830db9ecb7
commit
482dd0e6f8
1 changed files with 5 additions and 4 deletions
|
@ -94,10 +94,11 @@ struct SceneImpl : Scene
|
|||
//Half translucent requires intermediate composition.
|
||||
if (opacity == 255) return compFlag;
|
||||
|
||||
//If scene has several children or only scene, it may require composition.
|
||||
//OPTIMIZE: the bitmap type of the picture would not need the composition.
|
||||
//OPTIMIZE: a single paint of a scene would not need the composition.
|
||||
if (paints.size() == 1 && paints.front()->type() == Type::Shape) return compFlag;
|
||||
//Only shape or picture may not require composition.
|
||||
if (paints.size() == 1) {
|
||||
auto type = paints.front()->type();
|
||||
if (type == Type::Shape || type == Type::Picture) return compFlag;
|
||||
}
|
||||
|
||||
compFlag |= CompositionFlag::Opacity;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue