mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
C++: make the PhysicalRegion::rectangles non-overlapping
This commit is contained in:
parent
256ff1a5f5
commit
42d7661ec6
4 changed files with 39 additions and 14 deletions
|
@ -355,10 +355,11 @@ pub unsafe extern "C" fn slint_platform_task_run(event: PlatformTaskOpaque) {
|
|||
mod software_renderer {
|
||||
use super::*;
|
||||
type SoftwareRendererOpaque = *const c_void;
|
||||
use i_slint_core::graphics::Rgb8Pixel;
|
||||
use i_slint_core::graphics::{IntRect, Rgb8Pixel};
|
||||
use i_slint_core::software_renderer::{
|
||||
PhysicalRegion, RepaintBufferType, Rgb565Pixel, SoftwareRenderer,
|
||||
};
|
||||
use i_slint_core::SharedVector;
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn slint_software_renderer_new(
|
||||
|
@ -505,6 +506,17 @@ mod software_renderer {
|
|||
let r = (r as *const SoftwareRenderer) as *const dyn Renderer;
|
||||
core::mem::transmute(r)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn slint_software_renderer_region_to_rects(
|
||||
region: &PhysicalRegion,
|
||||
out: &mut SharedVector<IntRect>,
|
||||
) {
|
||||
*out = region
|
||||
.iter()
|
||||
.map(|r| euclid::rect(r.0.x, r.0.y, r.1.width as i32, r.1.height as i32))
|
||||
.collect();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "i-slint-renderer-skia", feature = "raw-window-handle"))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue