// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: MIT use plotters_backend::*; pub struct BackendWithoutText { pub backend: ForwardedBackend, } impl DrawingBackend for BackendWithoutText { type ErrorType = ForwardedBackend::ErrorType; fn get_size(&self) -> (u32, u32) { self.backend.get_size() } fn ensure_prepared(&mut self) -> Result<(), DrawingErrorKind> { self.backend.ensure_prepared() } fn present(&mut self) -> Result<(), DrawingErrorKind> { self.backend.present() } fn draw_pixel( &mut self, point: BackendCoord, color: BackendColor, ) -> Result<(), DrawingErrorKind> { self.backend.draw_pixel(point, color) } fn draw_line( &mut self, from: BackendCoord, to: BackendCoord, style: &S, ) -> Result<(), DrawingErrorKind> { self.backend.draw_line(from, to, style) } fn draw_rect( &mut self, upper_left: BackendCoord, bottom_right: BackendCoord, style: &S, fill: bool, ) -> Result<(), DrawingErrorKind> { self.backend.draw_rect(upper_left, bottom_right, style, fill) } fn draw_path>( &mut self, path: I, style: &S, ) -> Result<(), DrawingErrorKind> { self.backend.draw_path(path, style) } fn draw_circle( &mut self, center: BackendCoord, radius: u32, style: &S, fill: bool, ) -> Result<(), DrawingErrorKind> { self.backend.draw_circle(center, radius, style, fill) } fn fill_polygon>( &mut self, vert: I, style: &S, ) -> Result<(), DrawingErrorKind> { self.backend.fill_polygon(vert, style) } fn draw_text( &mut self, _text: &str, _style: &TStyle, _pos: BackendCoord, ) -> Result<(), DrawingErrorKind> { Ok(()) } fn estimate_text_size( &self, _text: &str, _style: &TStyle, ) -> Result<(u32, u32), DrawingErrorKind> { Ok((0, 0)) } fn blit_bitmap<'b>( &mut self, pos: BackendCoord, (iw, ih): (u32, u32), src: &'b [u8], ) -> Result<(), DrawingErrorKind> { self.backend.blit_bitmap(pos, (iw, ih), src) } }