Sfoglia il codice sorgente

Move glClear call out of the critical path

Johannes Hofmann 7 anni fa
parent
commit
e4e11e76cd
2 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. 5
    0
      src/main.rs
  2. 0
    2
      src/map_view_gl.rs

+ 5
- 0
src/main.rs Vedi File

@@ -292,6 +292,11 @@ fn main() {
292 292
 
293 293
             let _ = gl_window.swap_buffers();
294 294
 
295
+            // Move glClear call out of the critical path.
296
+            //TODO do not call glClear when drawing fills the whole screen anyway
297
+            cx.clear_color((0.2, 0.2, 0.2, 1.0));
298
+
299
+
295 300
             //TODO increase atlas size earlier to avoid excessive copying to the GPU
296 301
             //TODO increase max tile cache size?
297 302
             increase_atlas_size = {

+ 0
- 2
src/map_view_gl.rs Vedi File

@@ -103,8 +103,6 @@ impl<'a> MapViewGl<'a> {
103 103
             center: self.map_view.center,
104 104
         });
105 105
 
106
-        self.cx.clear_color((0.2, 0.2, 0.2, 1.0));
107
-
108 106
         let visible_tiles = self.map_view.visible_tiles(true);
109 107
         let mut remainder = visible_tiles.as_slice();
110 108
         let mut num_draws = 0;