Explorar el Código

Move glClear call out of the critical path

Johannes Hofmann hace 8 años
padre
commit
e4e11e76cd
Se han modificado 2 ficheros con 5 adiciones y 2 borrados
  1. 5
    0
      src/main.rs
  2. 0
    2
      src/map_view_gl.rs

+ 5
- 0
src/main.rs Ver fichero

292
 
292
 
293
             let _ = gl_window.swap_buffers();
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
             //TODO increase atlas size earlier to avoid excessive copying to the GPU
300
             //TODO increase atlas size earlier to avoid excessive copying to the GPU
296
             //TODO increase max tile cache size?
301
             //TODO increase max tile cache size?
297
             increase_atlas_size = {
302
             increase_atlas_size = {

+ 0
- 2
src/map_view_gl.rs Ver fichero

103
             center: self.map_view.center,
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
         let visible_tiles = self.map_view.visible_tiles(true);
106
         let visible_tiles = self.map_view.visible_tiles(true);
109
         let mut remainder = visible_tiles.as_slice();
107
         let mut remainder = visible_tiles.as_slice();
110
         let mut num_draws = 0;
108
         let mut num_draws = 0;