Simplify FemtoVG and Skia renderer API (#3153)

Fold show() into the first time render() is invoked,
and hide() into the Drop implementation.
This commit is contained in:
Simon Hausmann 2023-07-25 17:17:40 +02:00 committed by GitHub
parent 2a56e25788
commit 507428b03e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 59 additions and 116 deletions

View file

@ -71,16 +71,11 @@ struct MyWindowAdapter : public slint_platform::WindowAdapter
return slint::PhysicalSize({ uint32_t(r.right - r.left), uint32_t(r.bottom - r.top) });
}
void show() const override
{
ShowWindow(hwnd, SW_SHOWNORMAL);
m_renderer->show();
}
void show() const override { ShowWindow(hwnd, SW_SHOWNORMAL); }
void hide() const override
{
// TODO: destroy window
m_renderer->hide();
}
void request_redraw() const override { InvalidateRect(hwnd, nullptr, false); }

View file

@ -106,13 +106,8 @@ public:
->dispatch_scale_factor_change_event(devicePixelRatio());
auto window = const_cast<QWindow *>(static_cast<const QWindow *>(this));
window->QWindow::show();
m_renderer->show();
}
void hide() const override
{
m_renderer->hide();
const_cast<MyWindow *>(this)->QWindow::hide();
}
void hide() const override { const_cast<MyWindow *>(this)->QWindow::hide(); }
slint::PhysicalSize physical_size() const override
{
auto windowSize = slint::LogicalSize({ float(width()), float(height()) });