diff options
author | Tomi Valkeinen | 2016-04-11 04:11:14 -0500 |
---|---|---|
committer | Tomi Valkeinen | 2016-04-11 04:11:14 -0500 |
commit | a15d72debd94398e5e4c91b84e7d86055774a187 (patch) | |
tree | 08f20a6fe6ad944009cca2cf233f65ef5ae8ef19 /kmscube | |
parent | 0ae1c917da66d0542dc8cda718e57d787266c7e2 (diff) | |
download | external-libkmsxx-a15d72debd94398e5e4c91b84e7d86055774a187.tar.gz external-libkmsxx-a15d72debd94398e5e4c91b84e7d86055774a187.tar.xz external-libkmsxx-a15d72debd94398e5e4c91b84e7d86055774a187.zip |
kmscube: check for free bufs
Diffstat (limited to 'kmscube')
-rw-r--r-- | kmscube/kmscube.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kmscube/kmscube.cpp b/kmscube/kmscube.cpp index 49592ec..2b01b6b 100644 --- a/kmscube/kmscube.cpp +++ b/kmscube/kmscube.cpp | |||
@@ -91,6 +91,11 @@ public: | |||
91 | GbmSurface(const GbmSurface& other) = delete; | 91 | GbmSurface(const GbmSurface& other) = delete; |
92 | GbmSurface& operator=(const GbmSurface& other) = delete; | 92 | GbmSurface& operator=(const GbmSurface& other) = delete; |
93 | 93 | ||
94 | bool has_free() | ||
95 | { | ||
96 | return gbm_surface_has_free_buffers(m_surface); | ||
97 | } | ||
98 | |||
94 | gbm_bo* lock_front_buffer() | 99 | gbm_bo* lock_front_buffer() |
95 | { | 100 | { |
96 | return gbm_surface_lock_front_buffer(m_surface); | 101 | return gbm_surface_lock_front_buffer(m_surface); |
@@ -381,6 +386,8 @@ public: | |||
381 | 386 | ||
382 | void make_current() | 387 | void make_current() |
383 | { | 388 | { |
389 | FAIL_IF(!gsurface->has_free(), "No free buffers"); | ||
390 | |||
384 | eglMakeCurrent(egl.display(), esurface, esurface, egl.context()); | 391 | eglMakeCurrent(egl.display(), esurface, esurface, egl.context()); |
385 | } | 392 | } |
386 | 393 | ||