diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-04-19 22:45:59 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-04-20 21:18:19 +0200 |
| commit | 7c2677811b0b3da7b3eb6ed1918cf55068688f96 (patch) | |
| tree | 4cc97bd8c761f96ec5ad3b6b4cb95587ed442996 | |
| parent | bcf2eed456ace5abfd28f97d36eb0ef86ec8aaf3 (diff) | |
Merge set_image_and_draw() with draw().
| -rw-r--r-- | src/wx/gl_video_view.cc | 29 | ||||
| -rw-r--r-- | src/wx/gl_video_view.h | 1 |
2 files changed, 11 insertions, 19 deletions
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc index d2a1d8c36..5d5818901 100644 --- a/src/wx/gl_video_view.cc +++ b/src/wx/gl_video_view.cc @@ -552,6 +552,11 @@ GLVideoView::set_crop_guess_colour(GLuint program) void GLVideoView::draw() { + auto pv = player_video().first; + if (pv) { + set_image(pv); + } + auto pad = pad_colour(); glClearColor(pad.Red() / 255.0, pad.Green() / 255.0, pad.Blue() / 255.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); @@ -603,6 +608,10 @@ GLVideoView::draw() check_gl_error("glFlush"); _canvas->SwapBuffers(); + + if (pv) { + _viewer->image_changed(pv); + } } @@ -821,7 +830,7 @@ GLVideoView::thread_playing() } get_next_frame(false); - set_image_and_draw(); + draw(); } while (true) { @@ -836,22 +845,6 @@ GLVideoView::thread_playing() void -GLVideoView::set_image_and_draw() -{ - auto pv = player_video().first; - if (pv) { - set_image(pv); - } - - draw(); - - if (pv) { - _viewer->image_changed(pv); - } -} - - -void GLVideoView::thread_setup() { start_of_thread("GLVideoView"); @@ -890,7 +883,7 @@ GLVideoView::thread_body() thread_playing(); } else if (_one_shot) { _one_shot = false; - set_image_and_draw(); + draw(); } boost::this_thread::interruption_point(); diff --git a/src/wx/gl_video_view.h b/src/wx/gl_video_view.h index 8d3509df3..9bf02a835 100644 --- a/src/wx/gl_video_view.h +++ b/src/wx/gl_video_view.h @@ -89,7 +89,6 @@ private: void thread_body() override; void set_image(std::shared_ptr<const PlayerVideo> pv); - void set_image_and_draw(); void draw(); void thread_playing(); void request_one_shot(); |
