diff options
| author | 2024-04-05 01:24:34 +0200 | |
|---|---|---|
| committer | 2024-04-05 01:24:34 +0200 | |
| commit | 4a356cfc16f3b45d64826732009d9feeac016b28 (patch) | |
| tree | 6d562490507cd33c9f0660654716d848f2d7349d /wgpu | |
| parent | 394e599c3a096b036aabdd6f850c4a7c518d44fa (diff) | |
| download | iced-4a356cfc16f3b45d64826732009d9feeac016b28.tar.gz iced-4a356cfc16f3b45d64826732009d9feeac016b28.tar.bz2 iced-4a356cfc16f3b45d64826732009d9feeac016b28.zip  | |
Enable clipping and disable v-sync for now
Diffstat (limited to 'wgpu')
| -rw-r--r-- | wgpu/src/layer.rs | 35 | ||||
| -rw-r--r-- | wgpu/src/text.rs | 1 | ||||
| -rw-r--r-- | wgpu/src/window/compositor.rs | 4 | 
3 files changed, 20 insertions, 20 deletions
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs index 1c9638b0..d415da72 100644 --- a/wgpu/src/layer.rs +++ b/wgpu/src/layer.rs @@ -183,26 +183,26 @@ impl Stack {      }      pub fn push_clip(&mut self, bounds: Option<Rectangle>) { -        // self.previous.push(self.current); -        // self.order.push(Kind::Live); - -        // self.current = self.live_count; -        // self.live_count += 1; - -        // let bounds = bounds.map(|bounds| bounds * self.transformation()); - -        // if self.current == self.live.len() { -        //     self.live.push(Live { -        //         bounds, -        //         ..Live::default() -        //     }); -        // } else { -        //     self.live[self.current].bounds = bounds; -        // } +        self.previous.push(self.current); +        self.order.push(Kind::Live); + +        self.current = self.live_count; +        self.live_count += 1; + +        let bounds = bounds.map(|bounds| bounds * self.transformation()); + +        if self.current == self.live.len() { +            self.live.push(Live { +                bounds, +                ..Live::default() +            }); +        } else { +            self.live[self.current].bounds = bounds; +        }      }      pub fn pop_clip(&mut self) { -        // self.current = self.previous.pop().unwrap(); +        self.current = self.previous.pop().unwrap();      }      pub fn push_transformation(&mut self, transformation: Transformation) { @@ -219,7 +219,6 @@ impl Stack {      }      pub fn iter_mut(&mut self) -> impl Iterator<Item = LayerMut<'_>> { -        dbg!(self.order.len());          let mut live = self.live.iter_mut();          let mut cached = self.cached.iter_mut(); diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index e0a5355c..a7695b74 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -230,6 +230,7 @@ impl Pipeline {                      *transformation = new_transformation;                      *target_size = new_target_size; +                    *needs_reupload = false;                  }              }          } diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index d546a6dc..ab441fa0 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -321,12 +321,12 @@ impl graphics::Compositor for Compositor {              &wgpu::SurfaceConfiguration {                  usage: wgpu::TextureUsages::RENDER_ATTACHMENT,                  format: self.format, -                present_mode: self.settings.present_mode, +                present_mode: wgpu::PresentMode::Immediate,                  width,                  height,                  alpha_mode: self.alpha_mode,                  view_formats: vec![], -                desired_maximum_frame_latency: 1, +                desired_maximum_frame_latency: 0,              },          );      }  | 
