summaryrefslogtreecommitdiffstats
path: root/native/src/renderer/null.rs
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2023-07-12 12:23:18 -0700
committerLibravatar Bingus <shankern@protonmail.com>2023-07-12 12:23:18 -0700
commit633f405f3f78bc7f82d2b2061491b0e011137451 (patch)
tree5ebfc1f45d216a5c14a90492563599e6969eab4d /native/src/renderer/null.rs
parent41836dd80d0534608e7aedfbf2319c540a23de1a (diff)
parent21bd51426d900e271206f314e0c915dd41065521 (diff)
downloadiced-633f405f3f78bc7f82d2b2061491b0e011137451.tar.gz
iced-633f405f3f78bc7f82d2b2061491b0e011137451.tar.bz2
iced-633f405f3f78bc7f82d2b2061491b0e011137451.zip
Merge remote-tracking branch 'origin/master' into feat/multi-window-support
# Conflicts: # Cargo.toml # core/src/window/icon.rs # core/src/window/id.rs # core/src/window/position.rs # core/src/window/settings.rs # examples/integration/src/main.rs # examples/integration_opengl/src/main.rs # glutin/src/application.rs # native/src/subscription.rs # native/src/window.rs # runtime/src/window/action.rs # src/lib.rs # src/window.rs # winit/Cargo.toml # winit/src/application.rs # winit/src/icon.rs # winit/src/settings.rs # winit/src/window.rs
Diffstat (limited to 'native/src/renderer/null.rs')
-rw-r--r--native/src/renderer/null.rs74
1 files changed, 0 insertions, 74 deletions
diff --git a/native/src/renderer/null.rs b/native/src/renderer/null.rs
deleted file mode 100644
index 9376d540..00000000
--- a/native/src/renderer/null.rs
+++ /dev/null
@@ -1,74 +0,0 @@
-use crate::renderer::{self, Renderer};
-use crate::text::{self, Text};
-use crate::{Background, Font, Point, Rectangle, Size, Theme, Vector};
-
-/// A renderer that does nothing.
-///
-/// It can be useful if you are writing tests!
-#[derive(Debug, Clone, Copy, Default)]
-pub struct Null;
-
-impl Null {
- /// Creates a new [`Null`] renderer.
- pub fn new() -> Null {
- Null
- }
-}
-
-impl Renderer for Null {
- type Theme = Theme;
-
- fn with_layer(&mut self, _bounds: Rectangle, _f: impl FnOnce(&mut Self)) {}
-
- fn with_translation(
- &mut self,
- _translation: Vector,
- _f: impl FnOnce(&mut Self),
- ) {
- }
-
- fn clear(&mut self) {}
-
- fn fill_quad(
- &mut self,
- _quad: renderer::Quad,
- _background: impl Into<Background>,
- ) {
- }
-}
-
-impl text::Renderer for Null {
- type Font = Font;
-
- const ICON_FONT: Font = Font::Default;
- const CHECKMARK_ICON: char = '0';
- const ARROW_DOWN_ICON: char = '0';
-
- fn default_size(&self) -> f32 {
- 20.0
- }
-
- fn measure(
- &self,
- _content: &str,
- _size: f32,
- _font: Font,
- _bounds: Size,
- ) -> (f32, f32) {
- (0.0, 20.0)
- }
-
- fn hit_test(
- &self,
- _contents: &str,
- _size: f32,
- _font: Self::Font,
- _bounds: Size,
- _point: Point,
- _nearest_only: bool,
- ) -> Option<text::Hit> {
- None
- }
-
- fn fill_text(&mut self, _text: Text<'_, Self::Font>) {}
-}