Make the buffer clearing more robust

Now happens immediately after the buffer is swapped. Fixes #1104
This commit is contained in:
Kovid Goyal 2018-11-13 20:59:39 +05:30
parent 3e26f96744
commit 235bcacc7b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 7 deletions

View File

@ -816,8 +816,11 @@ is_mouse_hidden(OSWindow *w) {
void
swap_window_buffers(OSWindow *w) {
glfwSwapBuffers(w->handle);
swap_window_buffers(OSWindow *os_window) {
glfwSwapBuffers(os_window->handle);
// ensure all pixels are cleared to background color at least once in the
// new buffer
if (os_window->clear_count++ < 2) blank_os_window(os_window);
}
void

View File

@ -437,11 +437,6 @@ blank_os_window(OSWindow *os_window) {
bool
send_cell_data_to_gpu(ssize_t vao_idx, ssize_t gvao_idx, GLfloat xstart, GLfloat ystart, GLfloat dx, GLfloat dy, Screen *screen, OSWindow *os_window) {
bool changed = false;
if (os_window->clear_count < 2) {
os_window->clear_count++;
blank_os_window(os_window);
changed = true;
}
if (os_window->fonts_data) {
if (cell_prepare_to_render(vao_idx, gvao_idx, screen, xstart, ystart, dx, dy, os_window->fonts_data)) changed = true;
}