Skip to content

Commit

Permalink
LibWeb: Remove clipper creation error check in sample_under_corners()
Browse files Browse the repository at this point in the history
Before, this check was needed to prevent crashing when attempting to
allocate zero-size bitmap for sampled corners, which could have happened
if a corner had 0 radius in one axis.

Now, since SampleUnderCorners command is not emmited when radius is 0
in one axis, this check is no longer needed.
  • Loading branch information
kalenikaliaksandr committed May 26, 2024
1 parent edae0e3 commit f12347d
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,20 +459,13 @@ CommandResult CommandExecutorCPU::sample_under_corners(u32 id, CornerRadii const
m_corner_clippers.resize(id + 1);

auto clipper = BorderRadiusCornerClipper::create(corner_radii, border_rect.to_type<DevicePixels>(), corner_clip);
if (clipper.is_error()) {
m_corner_clippers[id] = nullptr;
return CommandResult::Continue;
}
m_corner_clippers[id] = clipper.release_value();
m_corner_clippers[id]->sample_under_corners(painter());
return CommandResult::Continue;
}

CommandResult CommandExecutorCPU::blit_corner_clipping(u32 id)
{
if (!m_corner_clippers[id])
return CommandResult::Continue;

m_corner_clippers[id]->blit_corner_clipping(painter());
m_corner_clippers[id] = nullptr;
return CommandResult::Continue;
Expand Down

0 comments on commit f12347d

Please sign in to comment.