1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00

only use simd if the region is wide enough

Refs: https://github.com/wez/wezterm/issues/40
This commit is contained in:
Wez Furlong 2019-10-07 07:41:11 -07:00
parent 0579a52f77
commit 378e7b326f

View File

@ -169,7 +169,7 @@ pub trait BitmapImage {
#[cfg(target_arch = "x86_64")]
{
if is_x86_feature_detected!("avx") {
if is_x86_feature_detected!("avx") && width >= 8 {
unsafe {
avx::fill_pixel(self.pixel_data_mut(), width * 4, width, height, color);
}
@ -192,7 +192,7 @@ pub trait BitmapImage {
#[cfg(target_arch = "x86_64")]
{
if is_x86_feature_detected!("avx") {
if is_x86_feature_detected!("avx") && (max_x - dest_x) > 8 {
unsafe {
avx::fill_pixel(
self.pixel_data_mut()