四个方向 分块渲染
This commit is contained in:
@@ -222,6 +222,24 @@ Painter::~Painter() {
|
||||
context_.end();
|
||||
}
|
||||
|
||||
void Painter::clip(RectF value) {
|
||||
value = value.normalized();
|
||||
if (!active_ || value.empty())
|
||||
return;
|
||||
context_.clip_to_rect(BLRect(value.x, value.y, value.width, value.height));
|
||||
}
|
||||
|
||||
void Painter::composite(const Blend2D_Color_Cache& source) {
|
||||
if (!active_ || source.image_.is_empty())
|
||||
return;
|
||||
const Size source_size = source.size();
|
||||
context_.blit_image(BLRect(0.0, 0.0,
|
||||
static_cast<double>(source_size.width),
|
||||
static_cast<double>(source_size.height)),
|
||||
source.image_,
|
||||
BLRectI(0, 0, source_size.width, source_size.height));
|
||||
}
|
||||
|
||||
BLRgba Painter::rgba(Color color) noexcept {
|
||||
constexpr double scale = 1.0 / 255.0;
|
||||
return BLRgba(color.r * scale, color.g * scale, color.b * scale, color.a * scale);
|
||||
|
||||
Reference in New Issue
Block a user