mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-10 22:51:58 +00:00
example: ++exception handling
This commit is contained in:
parent
0f2fe0c4d4
commit
8c11fa085f
1 changed files with 5 additions and 1 deletions
|
@ -192,7 +192,9 @@ struct Window
|
||||||
|
|
||||||
bool ready()
|
bool ready()
|
||||||
{
|
{
|
||||||
if (!example->content(Window::canvas, width, height)) return false;
|
if (!canvas) return false;
|
||||||
|
|
||||||
|
if (!example->content(canvas, width, height)) return false;
|
||||||
|
|
||||||
//initiate the first rendering before window pop-up.
|
//initiate the first rendering before window pop-up.
|
||||||
if (!verify(canvas->draw())) return false;
|
if (!verify(canvas->draw())) return false;
|
||||||
|
@ -301,6 +303,8 @@ struct SwWindow : Window
|
||||||
|
|
||||||
//Set the canvas target and draw on it.
|
//Set the canvas target and draw on it.
|
||||||
verify(canvas->target((uint32_t*)surface->pixels, surface->w, surface->pitch / 4, surface->h, tvg::SwCanvas::ARGB8888));
|
verify(canvas->target((uint32_t*)surface->pixels, surface->w, surface->pitch / 4, surface->h, tvg::SwCanvas::ARGB8888));
|
||||||
|
|
||||||
|
canvas->clear(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void refresh() override
|
void refresh() override
|
||||||
|
|
Loading…
Add table
Reference in a new issue