summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@serenityos.org>2022-01-26 10:26:52 -0700
committerLinus Groh <mail@linusgroh.de>2022-01-27 20:39:02 +0000
commitd1a87f1219a2768e5bbd120d1bae43add8bce2dc (patch)
treefa5a9740a61480ed09e0fd17f60256a7d2786262
parent229188b815beb4fe6c8d947b73840b841a7c976b (diff)
downloadserenity-d1a87f1219a2768e5bbd120d1bae43add8bce2dc.zip
LibSoftGPU: Use default construction to clear AlphaBlendFactors
Clearing the `m_alpha_blend_factors` is performed manually and in separate steps. This is error prone for future developers. The behavior is to reset the entire `struct` to the same state as default initialization, so this simplifies it to do just that.
-rw-r--r--Userland/Libraries/LibSoftGPU/Device.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/Userland/Libraries/LibSoftGPU/Device.cpp b/Userland/Libraries/LibSoftGPU/Device.cpp
index 25d44aeb86..4a34cc8146 100644
--- a/Userland/Libraries/LibSoftGPU/Device.cpp
+++ b/Userland/Libraries/LibSoftGPU/Device.cpp
@@ -97,11 +97,7 @@ Gfx::IntRect Device::window_coordinates_to_target_coordinates(Gfx::IntRect const
void Device::setup_blend_factors()
{
- m_alpha_blend_factors.src_constant = { 0.0f, 0.0f, 0.0f, 0.0f };
- m_alpha_blend_factors.src_factor_src_alpha = 0;
- m_alpha_blend_factors.src_factor_dst_alpha = 0;
- m_alpha_blend_factors.src_factor_src_color = 0;
- m_alpha_blend_factors.src_factor_dst_color = 0;
+ m_alpha_blend_factors = {};
switch (m_options.blend_source_factor) {
case BlendFactor::Zero:
@@ -142,12 +138,6 @@ void Device::setup_blend_factors()
VERIFY_NOT_REACHED();
}
- m_alpha_blend_factors.dst_constant = { 0.0f, 0.0f, 0.0f, 0.0f };
- m_alpha_blend_factors.dst_factor_src_alpha = 0;
- m_alpha_blend_factors.dst_factor_dst_alpha = 0;
- m_alpha_blend_factors.dst_factor_src_color = 0;
- m_alpha_blend_factors.dst_factor_dst_color = 0;
-
switch (m_options.blend_destination_factor) {
case BlendFactor::Zero:
break;