浏览代码

Move glClear call out of the critical path

Johannes Hofmann 7 年前
父节点
当前提交
e4e11e76cd
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 5
    0
      src/main.rs
  2. 0
    2
      src/map_view_gl.rs

+ 5
- 0
src/main.rs 查看文件

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 查看文件

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;