Skip to content

Commit 46f6e91

Browse files
committed
* Added frame skipping if surface is not ready for rendering. This may be useful when we don't want to make the main UI thread to wait for a long time.
1 parent 4134ba3 commit 46f6e91

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
*******************************************************************************
44

55
=== 1.0.32 ===
6-
6+
* Added frame skipping if surface is not ready for rendering. This may be useful
7+
when we don't want to make the main UI thread to wait for a long time.
78

89
=== 1.0.31 ===
910
* Updated module versions in dependencies.

src/main/widgets/containers/Window.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,13 +387,17 @@ namespace lsp
387387
if (!redraw_pending())
388388
return STATUS_OK;
389389

390-
// call rendering
390+
// Get surface for rendering
391391
ws::ISurface *s = pWindow->get_surface();
392392
if (s == NULL)
393393
return STATUS_OK;
394394

395395
enSurfaceType = s->type();
396396

397+
// Skip this frame if surface is still not ready for rendering
398+
if (!s->ready())
399+
return STATUS_OK;
400+
397401
// #ifdef LSP_TRACE
398402
// const system::time_millis_t start = system::get_time_millis();
399403
// #endif /* LSP_TRACE */

0 commit comments

Comments
 (0)