add inline annotations to some methods where i probably forgot before

these don't really affect performance in any meaningful way, according
to the benchmarks i just added. lol
This commit is contained in:
Gered 2023-05-01 16:24:51 -04:00
parent a0ec2f4826
commit 3b159a61b8
2 changed files with 10 additions and 0 deletions

View file

@ -40,6 +40,7 @@ impl IndexedBitmap {
/// Draws a line from x1,y1 to x2,y2 by blending the drawn pixels using the given blend map,
/// or the color specified if the blend map does not include this color.
#[inline]
pub fn blended_line(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u8, blend_map: &BlendMap) {
if let Some(blend_mapping) = blend_map.get_mapping(color) {
self.line_custom(
@ -56,6 +57,7 @@ impl IndexedBitmap {
/// Draws a horizontal line from x1,y to x2,y by blending the drawn pixels using the given
/// blend map, or the color specified if the blend map does not include this color.
#[inline]
pub fn blended_horiz_line(&mut self, x1: i32, x2: i32, y: i32, color: u8, blend_map: &BlendMap) {
if let Some(blend_mapping) = blend_map.get_mapping(color) {
self.horiz_line_custom(
@ -71,6 +73,7 @@ impl IndexedBitmap {
/// Draws a vertical line from x,y1 to x,y2 by blending the drawn pixels using the given blend
/// map, or the color specified if the blend map does not include this color.
#[inline]
pub fn blended_vert_line(&mut self, x: i32, y1: i32, y2: i32, color: u8, blend_map: &BlendMap) {
if let Some(blend_mapping) = blend_map.get_mapping(color) {
self.vert_line_custom(
@ -88,6 +91,7 @@ impl IndexedBitmap {
/// drawn, assuming they are specifying the top-left and bottom-right corners respectively.
/// The box is drawn by blending the drawn pixels using the given blend map, or the color
/// specified if the blend map does not include this color.
#[inline]
pub fn blended_rect(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u8, blend_map: &BlendMap) {
if let Some(blend_mapping) = blend_map.get_mapping(color) {
self.rect_custom(
@ -106,6 +110,7 @@ impl IndexedBitmap {
/// drawn, assuming they are specifying the top-left and bottom-right corners respectively. The
/// filled box is draw by blending the drawn pixels using the given blend map, or the color
/// specified if the blend map does not include this color.
#[inline]
pub fn blended_filled_rect(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u8, blend_map: &BlendMap) {
if let Some(blend_mapping) = blend_map.get_mapping(color) {
self.filled_rect_custom(

View file

@ -25,6 +25,7 @@ impl RgbaBitmap {
}
/// Draws a line from x1,y1 to x2,y2 by blending the drawn pixels using the given blend function.
#[inline]
pub fn blended_line(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u32, blend: BlendFunction) {
self.line_custom(
x1, //
@ -37,6 +38,7 @@ impl RgbaBitmap {
/// Draws a horizontal line from x1,y to x2,y by blending the drawn pixels using the given
/// blend function.
#[inline]
pub fn blended_horiz_line(&mut self, x1: i32, x2: i32, y: i32, color: u32, blend: BlendFunction) {
self.horiz_line_custom(
x1, //
@ -48,6 +50,7 @@ impl RgbaBitmap {
/// Draws a vertical line from x,y1 to x,y2 by blending the drawn pixels using the given blend
/// function.
#[inline]
pub fn blended_vert_line(&mut self, x: i32, y1: i32, y2: i32, color: u32, blend: BlendFunction) {
self.vert_line_custom(
x, //
@ -60,6 +63,7 @@ impl RgbaBitmap {
/// Draws an empty box (rectangle) using the points x1,y1 and x2,y2 to form the box to be
/// drawn, assuming they are specifying the top-left and bottom-right corners respectively.
/// The box is drawn by blending the drawn pixels using the given blend function.
#[inline]
pub fn blended_rect(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u32, blend: BlendFunction) {
self.rect_custom(
x1, //
@ -73,6 +77,7 @@ impl RgbaBitmap {
/// Draws a filled box (rectangle) using the points x1,y1 and x2,y2 to form the box to be
/// drawn, assuming they are specifying the top-left and bottom-right corners respectively. The
/// filled box is draw by blending the drawn pixels using the given blend function.
#[inline]
pub fn blended_filled_rect(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u32, blend: BlendFunction) {
self.filled_rect_custom(
x1, //