From 1db717a63f2a3a7a07c39ad7ffb9d0717521ec8c Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 27 Jan 2026 22:09:37 +0800 Subject: [PATCH] add put_pixel_unchecked() trait in API this is for implementing checked, higher-performance loops like blits. --- libs/ux-api/src/minigfx/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/ux-api/src/minigfx/mod.rs b/libs/ux-api/src/minigfx/mod.rs index 008c6c310..e742b58f0 100644 --- a/libs/ux-api/src/minigfx/mod.rs +++ b/libs/ux-api/src/minigfx/mod.rs @@ -38,6 +38,8 @@ use crate::platform; pub trait FrameBuffer { /// Puts a pixel of ColorNative at x, y. (0, 0) is defined as the lower left corner. fn put_pixel(&mut self, p: Point, color: ColorNative); + /// For higher-performance loops that have guaranteed bounds checking in the point location. + unsafe fn put_pixel_unchecked(&mut self, p: Point, on: ColorNative); /// Retrieves a pixel value from the frame buffer; returns None if the point is out of bounds. fn get_pixel(&self, p: Point) -> Option; /// XORs a pixel to what is in the existing frame buffer. The exact definition of "XOR" is somewhat