Files
ladybird/Userland/Libraries/LibWeb/Painting/BorderRadiusCornerClipper.h
Aliaksandr Kalenik 2c0f03f5b6 LibWeb: Delete BlitCornerClipping display list command
Contrary to LibGfx, where corner clipping was implemented by sampling
and blitting pixels under corners into a temporary bitmap, Skia allows
us to simply apply a mask. As a result, we no longer need the
BlitCornerClipping command, which has become a no-op.

- SampleUnderCorners is renamed to AddRoundedRectClip
- The optimization that skipped unnecessary blit and sample commands has
  been removed. However, this should not result in a performance
  regression because Skia seems to perform mask rasterization lazily.
2024-07-30 09:43:43 +02:00

32 lines
652 B
C++

/*
* Copyright (c) 2022, MacDue <macdue@dueutil.tech>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Painting/BorderPainting.h>
namespace Web::Painting {
enum class CornerClip {
Outside,
Inside
};
struct ScopedCornerRadiusClip {
ScopedCornerRadiusClip(PaintContext& context, DevicePixelRect const& border_rect, BorderRadiiData const& border_radii, CornerClip corner_clip = CornerClip::Outside);
~ScopedCornerRadiusClip();
AK_MAKE_NONMOVABLE(ScopedCornerRadiusClip);
AK_MAKE_NONCOPYABLE(ScopedCornerRadiusClip);
private:
PaintContext& m_context;
bool m_has_radius { false };
};
}