Skip to content

Commit

Permalink
[agx - Rust] Define a FillMode for describing polygon renders
Browse files Browse the repository at this point in the history
  • Loading branch information
codyd51 committed Feb 7, 2024
1 parent 0a0dade commit 81dd1e0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion rust_programs/agx_definitions/src/layer.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
extern crate alloc;
use crate::{Color, Point, Rect, Size, CHAR_HEIGHT, CHAR_WIDTH, FONT8X8};
use crate::{
scanline_compute_fill_lines_from_edges, Color, Line, LineF64, Point, PointF64, Polygon,
PolygonStack, Rect, Size, CHAR_HEIGHT, CHAR_WIDTH, FONT8X8,
};
use alloc::rc::Weak;
use alloc::vec;
use alloc::{boxed::Box, rc::Rc, vec::Vec};
use core::{cell::RefCell, cmp::min, fmt::Display};
use num_traits::Float;

#[cfg(target_os = "axle")]
use axle_rt::println;
Expand All @@ -15,6 +19,13 @@ pub enum StrokeThickness {
Width(isize),
}

/// PT: Similar to StrokeThickness, but slightly different semantics that are easier to implement for arbitrary polygons
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum FillMode {
Filled,
Outline,
}

/// The protocol expected of a LayerSlice
/// Pulled out into a trait to provide a 'virtual' LayerSlice that
/// doesn't map exactly onto a backing framebuffer, to support scrollable layers.
Expand Down

0 comments on commit 81dd1e0

Please sign in to comment.