Browse Source

Move glClear call out of the critical path

Johannes Hofmann 8 years ago
parent
commit
e4e11e76cd
2 changed files with 5 additions and 2 deletions
  1. 5
    0
      src/main.rs
  2. 0
    2
      src/map_view_gl.rs

+ 5
- 0
src/main.rs View File

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 View File

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;