xglcomp
diff src/main.cc @ 15:6726f29ebbb8
update backing texture on damage
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 08 Feb 2016 19:42:54 +0200 |
parents | db2e91f95531 |
children |
line diff
1.1 --- a/src/main.cc Sun Feb 07 11:52:56 2016 +0200 1.2 +++ b/src/main.cc Mon Feb 08 19:42:54 2016 +0200 1.3 @@ -77,7 +77,7 @@ 1.4 cwin->attr.y = ev.xconfigure.y; 1.5 cwin->attr.width = ev.xconfigure.width; 1.6 cwin->attr.height = ev.xconfigure.height; 1.7 - cwin->update_attr(); 1.8 + cwin->pixmap_valid = false; 1.9 } 1.10 break; 1.11 1.12 @@ -275,11 +275,14 @@ 1.13 1.14 static void draw_window(CompWindow *cwin) 1.15 { 1.16 + if(cwin->damaged) { 1.17 + cwin->tex_valid = false; 1.18 + } 1.19 if(!cwin->xpixmap || !cwin->pixmap_valid) { 1.20 cwin->update_pixmap(); 1.21 - if(!cwin->tex_valid) { 1.22 - cwin->update_texture(); 1.23 - } 1.24 + } 1.25 + if(!cwin->tex_valid) { 1.26 + cwin->update_texture(); 1.27 } 1.28 1.29 glBindTexture(GL_TEXTURE_2D, cwin->tex.get_id());