Simplify FemtoVG and Skia renderer APIs: remove resize()

We can convey the new physical window size from the run-time
through the private renderer API
when a window resize event is dispatched.
This commit is contained in:
Simon Hausmann 2023-07-25 17:49:04 +02:00 committed by Simon Hausmann
parent 68a255b1d2
commit f15bc6147e
13 changed files with 20 additions and 65 deletions

View file

@ -89,8 +89,6 @@ struct MyWindowAdapter : public slint_platform::WindowAdapter
void resize(uint32_t width, uint32_t height)
{
slint::PhysicalSize windowSize({ width, height });
m_renderer->resize(windowSize);
dispatch_resize_event(slint::LogicalSize({ (float)width, (float)height }));
}

View file

@ -121,9 +121,6 @@ public:
void resizeEvent(QResizeEvent *ev) override
{
auto logicalSize = ev->size();
float scale_factor = devicePixelRatio();
m_renderer->resize(slint::PhysicalSize({ uint32_t(logicalSize.width() * scale_factor),
uint32_t(logicalSize.height() * scale_factor) }));
WindowAdapter::dispatch_resize_event(
slint::LogicalSize({ float(logicalSize.width()), float(logicalSize.height()) }));
}