Bug 1684599 - Rename qcms_supports_iccv4 to SUPPORTS_ICCV4. r=aosmond
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Thu, 31 Dec 2020 23:02:29 +0000
changeset 561828 ba1c6d881ee94272aeb4aece68ce88f5a10517a2
parent 561827 54481774bbb7687f937bdc2fd9ace5c8c3131544
child 561829 d460abf3df12dbbcc49a9dec7c0287049b4c42b2
push id133421
push userjmuizelaar@mozilla.com
push dateFri, 01 Jan 2021 01:35:12 +0000
treeherderautoland@d460abf3df12 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1684599
milestone86.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1684599 - Rename qcms_supports_iccv4 to SUPPORTS_ICCV4. r=aosmond Differential Revision: https://phabricator.services.mozilla.com/D100570
gfx/qcms/src/iccread.rs
gfx/qcms/src/transform.rs
--- a/gfx/qcms/src/iccread.rs
+++ b/gfx/qcms/src/iccread.rs
@@ -24,17 +24,17 @@
 use std::{
     sync::atomic::{AtomicBool, Ordering},
     sync::Arc,
 };
 
 use crate::transform::{precache_output, set_rgb_colorants};
 use crate::{matrix::Matrix, s15Fixed16Number, s15Fixed16Number_to_float, Intent, Intent::*};
 
-pub static qcms_supports_iccv4: AtomicBool = AtomicBool::new(false);
+pub static SUPPORTS_ICCV4: AtomicBool = AtomicBool::new(false);
 
 pub type icColorSpaceSignature = u32;
 pub const icMaxEnumData: icColorSpaceSignature = 4294967295;
 pub const icSig15colorData: icColorSpaceSignature = 1178815570;
 pub const icSig14colorData: icColorSpaceSignature = 1162038354;
 pub const icSig13colorData: icColorSpaceSignature = 1145261138;
 pub const icSig12colorData: icColorSpaceSignature = 1128483922;
 pub const icSig11colorData: icColorSpaceSignature = 1111706706;
@@ -1263,30 +1263,26 @@ impl Profile {
                 if let Some(B2A0) = find_tag(&index, TAG_B2A0) {
                     let lut_type = read_u32(src, B2A0.offset as usize);
                     if lut_type == LUT8_TYPE || lut_type == LUT16_TYPE {
                         profile.B2A0 = read_tag_lutType(src, B2A0)
                     } else if lut_type == LUT_MBA_TYPE {
                         profile.mBA = read_tag_lutmABType(src, B2A0)
                     }
                 }
-                if find_tag(&index, TAG_rXYZ).is_some()
-                    || !qcms_supports_iccv4.load(Ordering::Relaxed)
-                {
+                if find_tag(&index, TAG_rXYZ).is_some() || !SUPPORTS_ICCV4.load(Ordering::Relaxed) {
                     profile.redColorant = read_tag_XYZType(src, &index, TAG_rXYZ);
                     profile.greenColorant = read_tag_XYZType(src, &index, TAG_gXYZ);
                     profile.blueColorant = read_tag_XYZType(src, &index, TAG_bXYZ)
                 }
                 if !src.valid {
                     return None;
                 }
 
-                if find_tag(&index, TAG_rTRC).is_some()
-                    || !qcms_supports_iccv4.load(Ordering::Relaxed)
-                {
+                if find_tag(&index, TAG_rTRC).is_some() || !SUPPORTS_ICCV4.load(Ordering::Relaxed) {
                     profile.redTRC = read_tag_curveType(src, &index, TAG_rTRC);
                     profile.greenTRC = read_tag_curveType(src, &index, TAG_gTRC);
                     profile.blueTRC = read_tag_curveType(src, &index, TAG_bTRC);
                     if profile.redTRC.is_none()
                         || profile.blueTRC.is_none()
                         || profile.greenTRC.is_none()
                     {
                         return None;
--- a/gfx/qcms/src/transform.rs
+++ b/gfx/qcms/src/transform.rs
@@ -24,17 +24,17 @@
 #[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
 use crate::transform_neon::{
     qcms_transform_data_bgra_out_lut_neon, qcms_transform_data_rgb_out_lut_neon,
     qcms_transform_data_rgba_out_lut_neon,
 };
 use crate::{
     chain::chain_transform,
     double_to_s15Fixed16Number,
-    iccread::qcms_supports_iccv4,
+    iccread::SUPPORTS_ICCV4,
     matrix::*,
     transform_util::{
         build_colorant_matrix, build_input_gamma_table, build_output_lut, compute_precache,
         lut_interp_linear,
     },
 };
 use crate::{
     iccread::{qcms_CIE_xyY, qcms_CIE_xyYTRIPLE, Profile, GRAY_SIGNATURE, RGB_SIGNATURE},
@@ -1049,17 +1049,17 @@ fn compute_whitepoint_adaption(X: f32, Y
     )
 }
 #[no_mangle]
 pub extern "C" fn qcms_profile_precache_output_transform(mut profile: &mut Profile) {
     /* we only support precaching on rgb profiles */
     if profile.color_space != RGB_SIGNATURE {
         return;
     }
-    if qcms_supports_iccv4.load(Ordering::Relaxed) {
+    if SUPPORTS_ICCV4.load(Ordering::Relaxed) {
         /* don't precache since we will use the B2A LUT */
         if profile.B2A0.is_some() {
             return;
         }
         /* don't precache since we will use the mBA LUT */
         if profile.mBA.is_some() {
             return;
         }
@@ -1160,17 +1160,17 @@ pub fn transform_create(
     }
     let mut transform: Box<qcms_transform> = Box::new(Default::default());
     let mut precache: bool = false;
     if out.output_table_r.is_some() && out.output_table_g.is_some() && out.output_table_b.is_some()
     {
         precache = true
     }
     // This precache assumes RGB_SIGNATURE (fails on GRAY_SIGNATURE, for instance)
-    if qcms_supports_iccv4.load(Ordering::Relaxed) as i32 != 0
+    if SUPPORTS_ICCV4.load(Ordering::Relaxed) as i32 != 0
         && (in_type == DATA_RGB_8 || in_type == DATA_RGBA_8 || in_type == DATA_BGRA_8)
         && (in_0.A2B0.is_some() || out.B2A0.is_some() || in_0.mAB.is_some() || out.mAB.is_some())
     {
         // Precache the transformation to a CLUT 33x33x33 in size.
         // 33 is used by many profiles and works well in pratice.
         // This evenly divides 256 into blocks of 8x8x8.
         // TODO For transforming small data sets of about 200x200 or less
         // precaching should be avoided.
@@ -1361,10 +1361,10 @@ impl Transform {
                 data.len() / self.ty.bytes_per_pixel(),
             );
         }
     }
 }
 
 #[no_mangle]
 pub extern "C" fn qcms_enable_iccv4() {
-    qcms_supports_iccv4.store(true, Ordering::Relaxed);
+    SUPPORTS_ICCV4.store(true, Ordering::Relaxed);
 }