Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] Fixes for GLES color mask setup #43225

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions impeller/renderer/backend/gles/render_pass_gles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,27 @@ void RenderPassGLES::OnSetLabel(std::string label) {

void ConfigureBlending(const ProcTableGLES& gl,
const ColorAttachmentDescriptor* color) {
if (!color->blending_enabled) {
if (color->blending_enabled) {
gl.Enable(GL_BLEND);
gl.BlendFuncSeparate(
ToBlendFactor(color->src_color_blend_factor), // src color
ToBlendFactor(color->dst_color_blend_factor), // dst color
ToBlendFactor(color->src_alpha_blend_factor), // src alpha
ToBlendFactor(color->dst_alpha_blend_factor) // dst alpha
);
gl.BlendEquationSeparate(
ToBlendOperation(color->color_blend_op), // mode color
ToBlendOperation(color->alpha_blend_op) // mode alpha
);
} else {
gl.Disable(GL_BLEND);
return;
}

gl.Enable(GL_BLEND);
gl.BlendFuncSeparate(
ToBlendFactor(color->src_color_blend_factor), // src color
ToBlendFactor(color->dst_color_blend_factor), // dst color
ToBlendFactor(color->src_alpha_blend_factor), // src alpha
ToBlendFactor(color->dst_alpha_blend_factor) // dst alpha
);
gl.BlendEquationSeparate(
ToBlendOperation(color->color_blend_op), // mode color
ToBlendOperation(color->alpha_blend_op) // mode alpha
);
{
const auto is_set = [](std::underlying_type_t<ColorWriteMask> mask,
ColorWriteMask check) -> GLboolean {
using RawType = decltype(mask);
return (static_cast<RawType>(mask) & static_cast<RawType>(mask))
return (static_cast<RawType>(mask) & static_cast<RawType>(check))
? GL_TRUE
: GL_FALSE;
};
Expand Down