rename triangle SolidSingleColor enum variant to Solid
This commit is contained in:
parent
3e4b9affa0
commit
a41fca5640
|
@ -24,14 +24,14 @@ pub fn criterion_benchmark(c: &mut Criterion) {
|
||||||
let texcoord_1_1 = Vector2::new(1.0, 1.0);
|
let texcoord_1_1 = Vector2::new(1.0, 1.0);
|
||||||
|
|
||||||
c.bench_function("indexedbitmap_triangle_2d_solid_color", |b| {
|
c.bench_function("indexedbitmap_triangle_2d_solid_color", |b| {
|
||||||
let triangle = IndexedTriangle2d::SolidSingleColor { position: [big_v1, big_v2, big_v3], color: 5 };
|
let triangle = IndexedTriangle2d::Solid { position: [big_v1, big_v2, big_v3], color: 5 };
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
dest.triangle_2d(black_box(&triangle));
|
dest.triangle_2d(black_box(&triangle));
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
c.bench_function("indexedbitmap_triangle_2d_solid_color_small", |b| {
|
c.bench_function("indexedbitmap_triangle_2d_solid_color_small", |b| {
|
||||||
let triangle = IndexedTriangle2d::SolidSingleColor { position: [small_v1, small_v2, small_v3], color: 5 };
|
let triangle = IndexedTriangle2d::Solid { position: [small_v1, small_v2, small_v3], color: 5 };
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
dest.triangle_2d(black_box(&triangle));
|
dest.triangle_2d(black_box(&triangle));
|
||||||
})
|
})
|
||||||
|
|
|
@ -4,7 +4,7 @@ use crate::math::vector2::Vector2;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub enum IndexedTriangle2d<'a> {
|
pub enum IndexedTriangle2d<'a> {
|
||||||
SolidSingleColor {
|
Solid {
|
||||||
position: [Vector2; 3], //
|
position: [Vector2; 3], //
|
||||||
color: u8,
|
color: u8,
|
||||||
},
|
},
|
||||||
|
@ -19,7 +19,7 @@ impl IndexedBitmap {
|
||||||
pub fn triangle_2d(&mut self, triangle: &IndexedTriangle2d) {
|
pub fn triangle_2d(&mut self, triangle: &IndexedTriangle2d) {
|
||||||
use IndexedTriangle2d::*;
|
use IndexedTriangle2d::*;
|
||||||
match triangle {
|
match triangle {
|
||||||
SolidSingleColor { position, color } => {
|
Solid { position, color } => {
|
||||||
per_pixel_triangle_2d(
|
per_pixel_triangle_2d(
|
||||||
self, //
|
self, //
|
||||||
position[0],
|
position[0],
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::prelude::{from_rgb32, from_rgb32_normalized, to_rgb32_normalized};
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub enum RgbaTriangle2d<'a> {
|
pub enum RgbaTriangle2d<'a> {
|
||||||
SolidSingleColor {
|
Solid {
|
||||||
position: [Vector2; 3], //
|
position: [Vector2; 3], //
|
||||||
color: u32,
|
color: u32,
|
||||||
},
|
},
|
||||||
|
@ -24,7 +24,7 @@ impl RgbaBitmap {
|
||||||
pub fn triangle_2d(&mut self, triangle: &RgbaTriangle2d) {
|
pub fn triangle_2d(&mut self, triangle: &RgbaTriangle2d) {
|
||||||
use RgbaTriangle2d::*;
|
use RgbaTriangle2d::*;
|
||||||
match triangle {
|
match triangle {
|
||||||
SolidSingleColor { position, color } => {
|
Solid { position, color } => {
|
||||||
per_pixel_triangle_2d(
|
per_pixel_triangle_2d(
|
||||||
self, //
|
self, //
|
||||||
position[0],
|
position[0],
|
||||||
|
|
Loading…
Reference in a new issue