Граф коммитов

379 Коммитов

Автор SHA1 Сообщение Дата
Jeff Muizelaar 89be52d2fd Bug 1684176 - Add a test of transforming sRGB to sRGB. r=aosmond
This uses the new safe Rust api

Differential Revision: https://phabricator.services.mozilla.com/D100449
2020-12-24 19:01:07 +00:00
Jeff Muizelaar 61d3b2f82d Bug 1684174 - Make qcms_intent an enum. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D100448
2020-12-24 18:29:04 +00:00
Jeff Muizelaar 73d5996c9d Bug 1684168 - Run cargo fmt on qcms. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D100444
2020-12-24 16:53:44 +00:00
Jeff Muizelaar dfe3699511 Bug 1684137 - Expose a more Rust like API to qcms. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D100434
2020-12-24 13:33:51 +00:00
Jeff Muizelaar 2578d1b239 Bug 1684095 - More safety in profile writing. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D100410
2020-12-24 00:22:42 +00:00
Andrew Osmond 583dd6ec47 Bug 1683779 - Use only rust constructs to detect SSE2/AVX/NEON support. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D100293
2020-12-22 01:37:03 +00:00
Jeff Muizelaar 085b64338d Bug 1683682 - Stop exporting qcms_profile_create(). r=aosmond
It's not used externally

Differential Revision: https://phabricator.services.mozilla.com/D100273
2020-12-21 19:43:02 +00:00
Jeff Muizelaar 7ec698fd1c Bug 1683574 - Remove some unconditional conditionals. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D100214
2020-12-20 23:00:11 +00:00
Jeff Muizelaar 958b255448 Bug 1683564 - Make the configuration functions safe. r=aosmond
Changes the visiblity of get/set_rgb_colorants as well.

Differential Revision: https://phabricator.services.mozilla.com/D100213
2020-12-20 20:42:22 +00:00
Jeff Muizelaar e2b781a1d6 Bug 1683524 - Drop unneeded #![allow(mutable_transmutes)]. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D100203
2020-12-20 15:37:51 +00:00
Jeff Muizelaar 6638e1db57 Bug 1683461 - Remove the final unsafety from chain.rs. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D100177
2020-12-19 15:03:24 +00:00
Jeff Muizelaar cc3e2058c2 Bug 1683353 - Remove some now unneeded unsafe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D100143
2020-12-18 18:40:35 +00:00
Jeff Muizelaar d66dc758c8 Bug 1683154 - Make chain transform functions safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D100033
2020-12-17 18:33:28 +00:00
Jeff Muizelaar 75d6c38d0d Bug 1683029 - Reintroduce f() and f_1(). r=aosmond
This fixes a subtle bug in the original c code where the results of f_1()
were not properly bracketed causing only the second part of the ternary
to be multiplied by the whitepoint.

I tried but was not able to create a test that showed the difference.

Differential Revision: https://phabricator.services.mozilla.com/D99970
2020-12-17 14:44:24 +00:00
Jeff Muizelaar cc1dae05ef Bug 1682969 - Remove a bunch of manual dereferences. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D99944
2020-12-16 21:46:47 +00:00
Jeff Muizelaar 4a8d704237 Bug 1682734 - Use a match statment to check matching instead of ifs. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D99859
2020-12-16 16:04:45 +00:00
Jeff Muizelaar 9ec8e5f6a4 Bug 1682305 - Change qcms_data_type to an enum. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D99682
2020-12-14 15:27:41 +00:00
Jeff Muizelaar 1d3a4b64fb Bug 1682064 - Separate out the safe part of qcms_transform_create. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D99563
2020-12-14 01:02:28 +00:00
Jeff Muizelaar 1ef16511cc Bug 1682034 - Make transform_precacheLUT_float return Option<Box<qcms_transform>>. r=aosmond
This lets the caller use it more safely.

Differential Revision: https://phabricator.services.mozilla.com/D99507
2020-12-11 20:26:27 +00:00
Jeff Muizelaar 770d4ae760 Bug 1681945 - Remove some unneeded derives and reduce visibility. r=aosmond
Some comments also get put back in the proper places.

Differential Revision: https://phabricator.services.mozilla.com/D99454
2020-12-11 14:40:30 +00:00
Jeff Muizelaar 942dba0566 Bug 1681726 - Move c bindings to a separate file. r=aosmond
This will isolate the unsafe and make building without them easier.

Differential Revision: https://phabricator.services.mozilla.com/D99350
2020-12-10 14:34:39 +00:00
Jeff Muizelaar a9a4649bd7 Bug 1681723 - Drop 'qcms_' prefix from chain functions. r=aosmond
These functions aren't part of the public api so don't need the prefix.

Differential Revision: https://phabricator.services.mozilla.com/D99348
2020-12-10 13:59:12 +00:00
Jeff Muizelaar 419b002c14 Bug 1681312 - Drop 'extern "C"' from transform module functions. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D99081
2020-12-08 18:37:35 +00:00
Jeff Muizelaar bc3cc1e2bc Bug 1681227 - Run cargo fmt. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D98996
2020-12-08 02:14:18 +00:00
Jeff Muizelaar 8b9b9258af Bug 1681078 - Add proper limits for input tables. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D98926
2020-12-07 15:58:34 +00:00
Jeff Muizelaar c14733e74e Bug 1680938 - Remove unused libc imports. r=aosmond
Get rid of some unsafety too.

Differential Revision: https://phabricator.services.mozilla.com/D98846
2020-12-06 01:14:51 +00:00
Jeff Muizelaar 5636d0ee07 Bug 1680921 - More control flow fixing. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D98842
2020-12-05 20:10:56 +00:00
Jeff Muizelaar 52f656f24a Bug 1680408 - Redo control flow in qcms_modular_transform_create. r=aosmond
This gets rid of current_block and makes the control more like
the original C code.

Differential Revision: https://phabricator.services.mozilla.com/D98552
2020-12-03 01:42:22 +00:00
Jeff Muizelaar 949306149a Bug 1680401 - Fix up some of the unstructured control flow. r=aosmond
Now that we have a working destructor for qcms_modular_transform
we don't have to worry about calling qcms_modular_transform_release
and can just return None.

Differential Revision: https://phabricator.services.mozilla.com/D98549
2020-12-03 00:16:58 +00:00
Jeff Muizelaar c949054c94 Bug 1680257 - Use default initialization for qcms_modular_transform. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D98467
2020-12-02 16:01:00 +00:00
Jeff Muizelaar c0cc28dc85 Bug 1680119 - Cleanup qcms_modular_transform_release. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D98380
2020-12-02 02:07:59 +00:00
Jeff Muizelaar 6464b0b4fe Bug 1680016 - Fix leak in v4_output test. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D98320
2020-12-01 19:52:50 +00:00
Jeff Muizelaar ad44f7baf9 Bug 1679915 - Convert output_clut_table's to Vecs. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D98263
2020-12-01 02:56:52 +00:00
Jeff Muizelaar b50abe998a Bug 1679914 - Use a vec for clut. r=aosmond
Instead of storing the offseted buffers in qcms_modular_transform
we just offset them at transform time.

Differential Revision: https://phabricator.services.mozilla.com/D98262
2020-12-01 02:56:39 +00:00
Jeff Muizelaar 4ff091fbba Bug 1679621. Add a test for v4 output. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D98245
2020-11-30 22:50:40 +00:00
Jeff Muizelaar 7e81bae011 Bug 1679621. Add back accidentally dropped append_transform. r=aosmond
I'll try to add a test in a follow up.

Differential Revision: https://phabricator.services.mozilla.com/D98130
2020-11-30 13:49:48 +00:00
Jeff Muizelaar 692b11db89 Bug 1679568. Cleanup profile creation. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D98084
2020-11-27 19:09:24 +00:00
Jeff Muizelaar ba25e09021 Bug 1679568. Reduce the visibility of the qcms_profile members. r=aosmond
And make profile_sRGB() public.

Differential Revision: https://phabricator.services.mozilla.com/D98083
2020-11-27 19:08:26 +00:00
Jeff Muizelaar 7ae91b7238 Bug 1679411 - Make qcms_profile_sRGB() safer. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D98056
2020-11-27 18:26:33 +00:00
Jeff Muizelaar 3fb4d899ee Bug 1679345 - Make transform_module_fn_t take a *const. r=aosmond
We don't need the mutability

Differential Revision: https://phabricator.services.mozilla.com/D97975
2020-11-26 13:34:54 +00:00
Jeff Muizelaar 6d5ceb5eb5 Bug 1679202 - Make next_transform into a Option<Box<_>>. r=aosmond
Not beautiful but it will at least make things safer.

Differential Revision: https://phabricator.services.mozilla.com/D97935
2020-11-25 12:46:59 +00:00
Jeff Muizelaar ad47fe9775 Bug 1679202. Append the transform after construction instead of before. r=aosmond
This will make it easier to use safe versions of this functions
because we can transfer ownership into the append_transform function.

Differential Revision: https://phabricator.services.mozilla.com/D97934
2020-11-25 12:48:37 +00:00
Jeff Muizelaar e8d0ea1988 Bug 1679180 - qcms: Remove some unneeded unsafe and extern "C". r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D97928
2020-11-24 19:42:35 +00:00
Jeff Muizelaar 06f27a67a4 Bug 1678966 - Remove unused fields from qcms_transform and derive Default. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D97867
2020-11-23 14:55:56 +00:00
Butkovits Atila d3beb62a99 Backed out changeset d38c84c21e76 (bug 1678966) for causing build bustages. CLOSED TREE 2020-11-23 16:27:01 +02:00
Jeff Muizelaar 65652df547 Bug 1678966 - Remove unused fields from qcms_transform and derive Default. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D97867
2020-11-23 13:51:02 +00:00
Jeff Muizelaar f3f4ba58d5 Bug 1678019 - Re-add handling of lut creation failure. r=aosmond
This was found by oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27601
and caused by 1f9a32185f4c1d2abfe1e32d773505d865541ad7

Differential Revision: https://phabricator.services.mozilla.com/D97446
2020-11-18 15:02:52 +00:00
Jeff Muizelaar 072eb124b3 Bug 1677385 - Make qcms_transform_precacheLUT_float safe. r=aosmond
This replaces r/g/b_clut pointers with a single
vec and creates the separate pointers as needed in
qcms_transform_data_tetra_clut_template.

Differential Revision: https://phabricator.services.mozilla.com/D97099
2020-11-17 14:33:53 +00:00
Jeff Muizelaar e34aa778ff Bug 1677384 - Drop the unused transform_alloc and transform_free. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D97098
2020-11-15 14:09:38 +00:00
Jeff Muizelaar 6e6d1d327a Bug 1677382 - Make qcms_transform_create safe. r=aosmond
Tack on a little clean up in compute_whitepoint_adaption

Differential Revision: https://phabricator.services.mozilla.com/D97097
2020-11-15 14:04:42 +00:00
Jeff Muizelaar 8ece49dbf8 Bug 1677381 - Turn AVX and Neon features into atomic bools. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D97096
2020-11-15 14:01:58 +00:00
Jeff Muizelaar daf018a6cb Bug 1677352 - Use RGB_SIGNATURE. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D97090
2020-11-15 12:27:44 +00:00
Jeff Muizelaar 398666fb8d Bug 1677326 - Make lut_interp_linear_float safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D97085
2020-11-14 21:02:45 +00:00
Jeff Muizelaar 6e93fa82c2 Bug 1677309 - Make qcms_profile_precache_output_transform safe. r=aosmond
There's a couple of formatting cleanups too.

Differential Revision: https://phabricator.services.mozilla.com/D97080
2020-11-14 16:35:58 +00:00
Jeff Muizelaar c0c278d532 Bug 1677006 - Make compute_precache safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D96955
2020-11-13 02:10:39 +00:00
Jeff Muizelaar f616e5a1e9 Bug 1677004 - More propagating of [u8; 8192]. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D96954
2020-11-13 01:54:16 +00:00
Jeff Muizelaar d392268136 Bug 1676871 - Propagate [8; 8192] type to compute_precache. r=aosmond
Have compute_precache take &mut to an array of the right size.

Differential Revision: https://phabricator.services.mozilla.com/D96829
2020-11-12 16:26:34 +00:00
Jeff Muizelaar cd031ba211 Bug 1676649 - Remove an unneeded cast and make build_colorant_matrix safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D96717
2020-11-12 14:42:41 +00:00
Jeff Muizelaar 32c8aeeb94 Bug 1676555 - Use PRECACHE_OUTPUT_* in more places. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D96670
2020-11-11 14:10:07 +00:00
Jeff Muizelaar 1bc4554792 Bug 1675759 - Flesh out qcms/Cargo.toml. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D96181
2020-11-06 13:57:45 +00:00
Jeff Muizelaar 8084874c09 Bug 1675524 - Use symbolic PRECACHE constants. r=aosmond
This restores the use of PRECACHE constants that got replaced
during conversion to Rust.

Differential Revision: https://phabricator.services.mozilla.com/D96183
2020-11-06 13:56:02 +00:00
Jeff Muizelaar 5d4c355232 Bug 1675425 - Make build_output_lut safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D95959
2020-11-05 14:27:59 +00:00
Jeff Muizelaar c3b95f0135 Bug 1675080 - Make build_input_gamma_table safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D95763
2020-11-05 14:49:01 +00:00
Butkovits Atila a458bf18ff Backed out changeset 0cb7e54c81fd (bug 1675425) for bustages complaining about
calling unsafe function. CLOSED TREE
2020-11-05 16:22:51 +02:00
Jeff Muizelaar 5142f9112d Bug 1675425 - Make build_output_lut safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D95959
2020-11-05 13:54:09 +00:00
Jeff Muizelaar ff58e7d381 Bug 1674956 - Make lut_interp_linear safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D95653
2020-11-03 11:37:16 +00:00
Jeff Muizelaar 109c8f450a Bug 1674672 - qcms: Change input gamma table to a Option<Vec<f32>>. r=aosmond
All of the code that produces these tables is updated to operate
on Vecs.

Differential Revision: https://phabricator.services.mozilla.com/D95463
2020-11-02 13:32:07 +00:00
Jeff Muizelaar 0f61683211 Bug 1674656 - qcms: make lut_inverse_interp16 safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D95460
2020-11-01 20:06:06 +00:00
Jeff Muizelaar 7d71ab63f7 Bug 1674621 - qcms: change some *mut to *const. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D95459
2020-11-01 20:05:01 +00:00
Jeff Muizelaar 7b07725fe9 Bug 1672547 - qcms: Change some raw ptrs to references. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D94397
2020-11-01 01:54:48 +00:00
Jeff Muizelaar edcb500aaa Bug 1672309 - Port remaning gtests to Rust. r=aosmond
I've left the C++ ones for now.

Differential Revision: https://phabricator.services.mozilla.com/D94246
2020-10-31 21:55:20 +00:00
Razvan Maries 90372fb9cf Backed out changeset cef722eb6583 (bug 1672309) for Windows 2012 debug BR bustages. CLOSED TREE 2020-10-22 09:01:29 +03:00
Jeff Muizelaar 6df3bcb6d8 Bug 1672309 - Port remaning gtests to Rust. r=aosmond
I've left the C++ ones for now.

Differential Revision: https://phabricator.services.mozilla.com/D94246
2020-10-22 01:30:48 +00:00
Dorel Luca 03c2fad3dc Backed out changeset 02f6caf121bb (bug 1672309) for Backout conflicts with Bug 1654103. CLOSED TREE 2020-10-22 03:50:06 +03:00
Jeff Muizelaar 577c167863 Bug 1672309 - Port remaning gtests to Rust. r=aosmond
I've left the C++ ones for now.

Differential Revision: https://phabricator.services.mozilla.com/D94246
2020-10-22 00:05:08 +00:00
Jeff Muizelaar cc1de268e5 Bug 1671311 - qcms: Make a couple of functions safe. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D93625
2020-10-15 13:02:01 +00:00
Jeff Muizelaar 3fd8898736 Bug 1670404 - Cleanup profile_create_rgb_with_table. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D93156
2020-10-14 20:46:29 +00:00
Jeff Muizelaar 253ba9aba0 Bug 1668912 - Implement Default for qcms_transform. r=aosmond
Using Default::default() to initialize qcms_tranform
instead of zero will avoid us having to rely on the particular
representation of the members which makes things more
sane once the pointer members become Option<Vec<_>>s

Once all the members use Default::default() we can switch
to deriving Default instead of implementing it manually.

Differential Revision: https://phabricator.services.mozilla.com/D92285
2020-10-03 19:16:32 +00:00
Jeff Muizelaar c78d8d9811 Bug 1668967 - qcms: Make sure we read the entire output table. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D92315
2020-10-03 13:59:28 +00:00
Jeff Muizelaar 06840cd992 Bug 1668859 - Separate out the safe part of profile_create_rgb_with_table. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D92251
2020-10-02 19:00:59 +00:00
Jeff Muizelaar e53f994944 Bug 1668708 - Make build_sRGB_gamma_table safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D92169
2020-10-02 15:59:39 +00:00
Jeff Muizelaar 803305dab6 Bug 1668526 - qcms: Fix v4 profiles. r=aosmond
Using floor() instead of ceil() was a typo that was introduced while
converting from the libm functions to rust builtins.

This adds a test to prevent us from breaking it in the future.

Differential Revision: https://phabricator.services.mozilla.com/D92131
2020-10-01 19:09:37 +00:00
Jeff Muizelaar 62fa39d35f Bug 1668419 - Make icc profile parsing safe. r=aosmond
This makes qcms_profile_from_memory() a wrapper
around a safe profile_from_slice() function.

Differential Revision: https://phabricator.services.mozilla.com/D92012
2020-10-01 13:18:41 +00:00
Jeff Muizelaar 079948dafe Bug 1668418 - Rustify precache. r=aosmond
Change the *mut precache_output pointers to Option<Arc<precache_output>>
These are the last fields in qcms_profile that we interact with
unsafely.

Differential Revision: https://phabricator.services.mozilla.com/D92011
2020-10-01 12:48:23 +00:00
Jeff Muizelaar f82318cd6e Bug 1667921 - qcms: Make read_tag_lutmABType safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D91676
2020-09-29 02:38:02 +00:00
Jeff Muizelaar 6f690d3efc Bug 1667875. Make sure that we enable the instruction set that we're using. r=aosmond
Without this the intrinsics end up as calls instead of inline

Differential Revision: https://phabricator.services.mozilla.com/D91639
2020-09-28 21:04:30 +00:00
Jeff Muizelaar 8d848ca717 Bug 1667691 - qcms: Make lutType safe. r=aosmond
Instead of using a common buffer for all lookup tables
we just use individual Vecs for each.

Differential Revision: https://phabricator.services.mozilla.com/D91534
2020-09-28 00:34:15 +00:00
Jeff Muizelaar ac8e8a021c Bug 1667689 - Make set_rgb_colorants safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D91533
2020-09-27 22:56:03 +00:00
Jeff Muizelaar a6bc0ef436 Bug 1667689 - Make build_RGB_to_XYZ_transfer_matrix safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D91532
2020-09-27 22:55:56 +00:00
Jeff Muizelaar 8f56d5e521 Bug 1667689 - Make curve_from_table safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D91531
2020-09-27 22:54:37 +00:00
Jeff Muizelaar 23b9ed74a2 Bug 1667687 - qcms: Make read_nested safe. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D91530
2020-09-27 22:53:13 +00:00
Jeff Muizelaar 8daf0bd825 Bug 1667686 - Use ptr::write_unaligned to properly handle unaligned accesses. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D91529
2020-09-27 22:52:55 +00:00
Jeff Muizelaar b5a1244a00 Bug 1667374 - Make curveType more Rust like. r=aosmond
Turns curveType into a enum. The change is mostly mechanical fixing of
the the code to the new structure except that for Parametrics curves
we now store the result of COUNT_TO_LENGTH as the len.
This mostly affects compute_curve_gamma_table_type_parametric where we
use the post COUNT_TO_LENGTH instead of the pre COUNT_TO_LENGTH.

Differential Revision: https://phabricator.services.mozilla.com/D91421
2020-09-27 18:57:50 +00:00
Jeff Muizelaar 70cb4bccd7 Bug 1666811. Make tag finding safe. r=aosmond
Change find_tag() to return an Option<&tag> instead of *const tag
and clean up all of the users.

Differential Revision: https://phabricator.services.mozilla.com/D91150
2020-09-25 11:45:04 +00:00
Jeff Muizelaar d679fe609a Bug 1666784. Fix qcms fuzz target. r=aosmond
qcms_profile_is_bogus() got changed to take a &mut instead of *mut
and the fuzz target never got updated

Differential Revision: https://phabricator.services.mozilla.com/D91141
2020-09-23 14:57:03 +00:00
Jeff Muizelaar a9b12a7d10 Bug 1666782. Fix GrayAlpha color conversion. r=aosmond
GrayAlpha::has_alpha was accidentally set to false.

Differential Revision: https://phabricator.services.mozilla.com/D91147
2020-09-23 14:52:19 +00:00
Jeff Muizelaar 0f0c9a9a0c Bug 1666057. Convert qcms to rust. r=aosmond
The conversion was done with c2rust and then manually cleaned up some.
There's still lots of unsafe code remaining but I'd rather do the rest
of the cleanup in-tree so that it's easier to catch and revert
regressions.

I've dropped support for SSE1 (Firefox requires SSE2) and Altivec
(not wanting to deal with fixing Rust's Altivec support).

transform_neon.rs manually implements a bunch of intrinsics, this
can be fixed when we can depend on Rust 1.48.

The fuzz target is changed to a cargo-fuzz target.

Some of the gtests are moved to Rust.

Differential Revision: https://phabricator.services.mozilla.com/D90782
2020-09-21 18:40:51 +00:00
Andrew Osmond 5ee82cb26c Bug 1615394 - Add color management support to the BMP decoder. r=tnikkel
This patch adds support for color management in BMPs added in
BITMAPV4HEADER and BITMAPV5HEADER. While display of BMPs is relatively
rare this comes in handy when interacting with the Windows clipboard.

Differential Revision: https://phabricator.services.mozilla.com/D64880

--HG--
extra : moz-landing-system : lando
2020-03-03 14:16:00 +00:00
Dorel Luca 284433eb29 Backed out changeset 388ac5609ceb (bug 1615394) for MinGW build bustage. CLOSED TREE
--HG--
extra : amend_source : cf3cec59ae1efd99b9de0d19b7a09c135138daf5
2020-03-03 13:02:04 +02:00
Andrew Osmond 97a2bca5b9 Bug 1615394 - Add color management support to the BMP decoder. r=tnikkel
This patch adds support for color management in BMPs added in
BITMAPV4HEADER and BITMAPV5HEADER. While display of BMPs is relatively
rare this comes in handy when interacting with the Windows clipboard.

Differential Revision: https://phabricator.services.mozilla.com/D64880

--HG--
extra : moz-landing-system : lando
2020-03-02 23:49:37 +00:00
Andrew Osmond bb4bf3f608 Bug 1600911 - Implement AVX variant of QCMS ICCv2 algorithm. r=jrmuizel
Our performance gtests indicate anywhere from 10-20% reduction in
execution time based on the SSE2 version. Where it fell in the range
depended on the platform, but presumably that is related to the hardware
selected by treeherder. llvm-mca suggested it should be closer to 20%
on modern hardware (skylake).

Differential Revision: https://phabricator.services.mozilla.com/D55642

--HG--
extra : moz-landing-system : lando
2019-12-17 19:22:36 +00:00
Csoregi Natalia c6abd544c4 Backed out changeset 5483da347be3 (bug 1600911) for bustage on transform-avx.cpp. CLOSED TREE 2019-12-13 21:39:14 +02:00
Andrew Osmond 9e59ec2b0d Bug 1600911 - Implement AVX variant of QCMS ICCv2 algorithm. r=jrmuizel
Our performance gtests indicate anywhere from 10-20% reduction in
execution time based on the SSE2 version. Where it fell in the range
depended on the platform, but presumably that is related to the hardware
selected by treeherder. llvm-mca suggested it should be closer to 20%
on modern hardware (skylake).

Differential Revision: https://phabricator.services.mozilla.com/D55642

--HG--
extra : moz-landing-system : lando
2019-12-13 18:26:22 +00:00
Andrew Osmond e6fe246634 Bug 1558883 - Add QCMS transform correctness and performance tests. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D34765
2019-06-25 09:45:56 -04:00
Andrew Osmond 3c03c2b472 Bug 1551844 - Implement NEON variations of QCMS ICCv2 transforms. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D34582
2019-06-14 08:46:20 -04:00
Bogdan Tara e05c286c5f Backed out changeset 331846de4391 (bug 1551844) for ccwn2c08.html and ccwn3p08.html failures a=backout 2019-06-14 12:48:16 +03:00
Andrew Osmond 3334a54347 Bug 1551844 - Implement NEON variations of QCMS ICCv2 transforms. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D34582
2019-06-13 07:55:21 -04:00
Andrew Osmond d8f7e96b8d Bug 1555329 - Fix BGRA support with ICCv4 QCMS profiles. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D33004
2019-05-30 13:21:21 -04:00
Andrew Osmond dbcc53ff29 Bug 1551084 - Part 5. Allow QCMS gray transforms to expand to add alpha. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D30822
2019-05-27 15:44:48 -04:00
Andrew Osmond 1871421d78 Bug 1551084 - Part 4. Add support for BGRA to QCMS. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D30821
2019-05-27 15:44:42 -04:00
Andrew Osmond 811c958f2b Bug 1551084 - Part 3. Use templates to reduce code duplication in QCMS. r=miko
No functional change. This allows us to support both alpha and non-alpha
variants with the same implementation, in addition to laying the ground
work for QCMS to support BGRA as an input and output.

Differential Revision: https://phabricator.services.mozilla.com/D30820
2019-05-27 15:44:32 -04:00
Andrew Osmond e4f8bc1035 Bug 1551084 - Part 2. Make QCMS transform files use C++. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D30819


--HG--
rename : gfx/qcms/transform-altivec.c => gfx/qcms/transform-altivec.cpp
rename : gfx/qcms/transform-sse1.c => gfx/qcms/transform-sse1.cpp
rename : gfx/qcms/transform-sse2.c => gfx/qcms/transform-sse2.cpp
rename : gfx/qcms/transform.c => gfx/qcms/transform.cpp
2019-05-27 15:43:59 -04:00
Andrew Osmond 244d1f67b8 Bug 1551084 - Part 1. Minor reworking of QCMS to allow C files to compile as C++. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D30818
2019-05-27 15:43:59 -04:00
Narcis Beleuzu 5b11cf9cb8 Backed out 5 changesets (bug 1551084) for build bustages on transform.cpp . CLOSED TREE
Backed out changeset af04f8907fab (bug 1551084)
Backed out changeset 2a5ae3eb40ce (bug 1551084)
Backed out changeset 99874bf89419 (bug 1551084)
Backed out changeset d73949bd98e9 (bug 1551084)
Backed out changeset cd1bb23b475a (bug 1551084)

--HG--
rename : gfx/qcms/transform-altivec.cpp => gfx/qcms/transform-altivec.c
rename : gfx/qcms/transform-sse1.cpp => gfx/qcms/transform-sse1.c
rename : gfx/qcms/transform-sse2.cpp => gfx/qcms/transform-sse2.c
rename : gfx/qcms/transform.cpp => gfx/qcms/transform.c
2019-05-27 18:52:34 +03:00
Andrew Osmond 5c3360e51e Bug 1551084 - Part 5. Allow QCMS gray transforms to expand to add alpha. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D30822
2019-05-27 11:16:46 -04:00
Andrew Osmond 8f51499c6d Bug 1551084 - Part 4. Add support for BGRA to QCMS. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D30821
2019-05-27 11:16:46 -04:00
Andrew Osmond b5eed66d2b Bug 1551084 - Part 3. Use templates to reduce code duplication in QCMS. r=miko
No functional change. This allows us to support both alpha and non-alpha
variants with the same implementation, in addition to laying the ground
work for QCMS to support BGRA as an input and output.

Differential Revision: https://phabricator.services.mozilla.com/D30820
2019-05-27 11:16:46 -04:00
Andrew Osmond 803f797714 Bug 1551084 - Part 2. Make QCMS transform files use C++. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D30819


--HG--
rename : gfx/qcms/transform-altivec.c => gfx/qcms/transform-altivec.cpp
rename : gfx/qcms/transform-sse1.c => gfx/qcms/transform-sse1.cpp
rename : gfx/qcms/transform-sse2.c => gfx/qcms/transform-sse2.cpp
rename : gfx/qcms/transform.c => gfx/qcms/transform.cpp
2019-05-27 11:16:46 -04:00
Andrew Osmond 086ae9c208 Bug 1551084 - Part 1. Minor reworking of QCMS to allow C files to compile as C++. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D30818
2019-05-27 11:16:46 -04:00
Mike Hommey ef3ad686ee Bug 1512504 - Remove support for MSVC. r=froydnj
Consequently, this removes:
- MOZ_LIBPRIO, which is now always enabled.
- non_msvc_compiler, which is now always true.
- The cl.py wrapper, since it's not used anymore.
- CL_INCLUDES_PREFIX, which was only used for the cl.py wrapper.
- NONASCII, which was only there to ensure CL_INCLUDES_PREFIX still
  worked in non-ASCII cases.

This however keeps a large part of detecting and configuring for MSVC,
because we still do need it for at least headers, libraries, and midl.

Depends on D19614

Differential Revision: https://phabricator.services.mozilla.com/D19615

--HG--
extra : moz-landing-system : lando
2019-02-14 21:45:27 +00:00
Thomas P. f33c95e66c Bug 1494222: Add source bytes to fix qcms_fuzzer coverage. r=agaynor 2018-10-07 21:21:34 +00:00
Thomas P. bf5942616e Bug 1494222: add combined mAB/mBA profile to qcms_fuzzer samples. r=agaynor
--HG--
extra : histedit_source : 5e64af56ed5284b2b1e70ea94f250356b68ad193
2018-09-28 02:59:39 +00:00
Thomas P. 150e193f2f Bug 1494222: fix qcms_fuzzer coverage by enabling all path combinations. r=agaynor
--HG--
extra : histedit_source : f9144b08a11cef50c336cad1dbe8599f1c612b7b
2018-09-27 21:59:12 +00:00
Thomas P. 7d42fc9019 Bug 1494222: set XYZ PCS on internal RGB profiles. r=nical
--HG--
extra : histedit_source : b53b8c299be35db04ca199d0798daa208e447150
2018-09-26 08:38:24 +00:00
Thomas P. 7b759af801 Bug 1494222: don't check bogosity of profiles with LUT-types mAB/mBA. r=nical
--HG--
extra : histedit_source : d269029c707e6feac4a618ccba62e5cb7f35ae71
2018-09-26 08:43:33 +00:00
Thomas P. 4b1be4ef6a Bug 1484556: add Qcms fuzzer seed profiles. r=decoder 2018-08-24 04:31:37 +00:00
Thomas P. cd613a5787 Bug 1477858 - add Qcms fuzzing target dictionary. r=decoder 2018-07-23 22:34:16 +00:00
Nathan Froyd 309ddc0be2 Bug 1477048 - part 2 - remove non-ipc/chromium moz.build uses of OS_TEST; r=gps
The deletions in xptcall are when we don't even have support for the CPU
in moz.configure, so I assume that people haven't been compiling on
those architectures for quite some time.
2018-07-24 16:08:56 -04:00
Nathan Froyd 5158597854 Bug 1477048 - part 1 - remove `'86' in CONFIG['OS_TEST']` stanzas from moz.build files; r=gps
The current code is somewhat non-obvious to a first-time reader, and
OS_TEST is a bizarre thing anyway, since it's actually the name of the
CPU we're running on.  We'd do well to minimize the use of OS_TEST.

Note that the complete nuking of the xptcall/md/unix/moz.build lines are
because we don't support OS X/x86 anymore.
2018-07-24 16:08:56 -04:00
Thomas P. 5f96c00e81 Bug 1464257: fix lut8Type tag implementation. r=bas 2018-06-26 02:20:22 +00:00
Thomas P. 9e3d57b831 Bug 1459425: add fuzzing target for qcms. r=bas sr=decoder
hybrid target that works with both the native interface and oss-fuzz
2018-06-26 02:40:45 +00:00
Nicolas Silva 5070dbcceb Bug 1444734 - Bail out of read_nested_curveType when encountering an invalid source. r=Bas 2018-06-20 10:37:22 +02:00
Nicolas Silva 7b8229b86b Bug 1464039 - Only reject qcms transform with invalid grid size if the transform function uses the grid size. r=Bas 2018-06-19 15:32:29 +02:00
Nicolas Silva fdf1d9bbb2 Bug 1464039 - Reject some invalid transforms in qcms. r=mwoodrow 2018-06-15 14:01:07 -07:00
Nicolas Silva b2c558ac48 Bug 1463424 - Fix divide by zeroes in qcms. r=Bas 2018-05-28 11:34:03 +02:00
Ryan VanderMeulen cc37a66c1c Backed out changeset 94b228e67f4c (bug 1432067) because it causes valid profiles to be rejected. 2018-05-16 19:29:59 -04:00
Milan Sreckovic b1115c2c28 Bug 1432067 - Ignore zero sized tables. r=jrmuizel 2018-05-07 16:33:33 -04:00
Lee Salzman a843f0909e Bug 1431637 - free qcms_transform r_clut. r=jrmuizel
MozReview-Commit-ID: DwbIhtuGvcA
2018-02-08 21:41:03 -05:00
Sylvestre Ledru 5de63ef061 Bug 1394734 - Replace CONFIG['MSVC'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 5orfnoude7h

--HG--
extra : rebase_source : 1ed9a6b56e1d27221a07624767a7fb0e6147117f
2017-12-08 13:46:13 +01:00
Sylvestre Ledru 9bfe27d903 Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 7duJk2gSd4m

--HG--
extra : rebase_source : 7312fe276e561e8c034a5f6749774ae812727f9c
2017-12-07 22:09:15 +01:00
Jeff Muizelaar d057c6f505 Bug 1250461. Don't reject profiles with negative colorant tristiumlus value on macOS. r=mstange
This is basically just this: https://bugs.chromium.org/p/chromium/issues/detail?id=562951
The original profile that caused us to add this check has bigger problems than negative
colorant tristiumlus values. We should reject it using a better metric. In the mean time
let's not reject these things on macOS.
2017-10-12 11:46:08 -04:00
John Paul Adrian Glaubitz c6b39f0f90 Bug 972945 - Add autoconf test to enable AltiVec on supported targets only. r=glandium
Currently, the build scripts enable AltiVec unconditionally on all ppc*
targets. However, there some ppc* targets which do not support AltiVec
instruction set extensions, these are often embedded systems like the
PowerPC e500 or similar which have their own type of instruction set
extensions like SPE. Trying to enable Altivec support on these targets
results in a compiler error, hence we need to add an autoconf test for
AltiVec support before trying to enable it on ppc* targets.

Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

--HG--
extra : rebase_source : 6c4df813d97d95046fd2269c876313ce7591c5cf
2016-08-16 05:17:00 -04:00
Miko Mynttinen 9ea7cd8eb6 Bug 1291490 - File gfx/qcms/transform_util.h is missing a header. r=bgirard
Include the missing math.h header.

MozReview-Commit-ID: BozHU59BGkF

--HG--
extra : transplant_source : %02%95%3F-k%FF%BA_%C7%1CU%CBU%29c%D7%82%9F%04J
2016-08-02 15:41:56 -07:00
Tom Tromey 5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Mike Hommey d464f29e5f Bug 1255813 - Remove build system support for Solaris, HPUX and AIX. r=ted 2016-03-15 07:34:50 +09:00
Nicholas Nethercote af6751ef10 Bug 1205533 - Fix and disallow warnings in gfx/qcms/. r=jrmuizel.
This patch fixes various warnings from MSVC.

- Several "truncation from 'double' to 'float'" warnings, easily fixed by
  appending 'f' to literals.

- Some "signed/unsigned mismatch" warnings. In read_tag_lutType(), MSVC is
  apparently promoting the multiplication of a uint8_t and a uint16_t to an
  int32_t, oddly enough. A uint32_t cast fixes the warning.

- |offset| was unused in qcms_data_create_rbg_with_gamma().

- A couple of "overflow in floating-point constant arithmetic" warnings
  involving INFINITY in transform_util.c. There is some type confusion here --
  in C99 HUGE_VAL is a double and INFINITY is a float. So the HUGE_VAL here
  should actualy be HUGE_VALF. But, strangely enough, that isn't enough to
  avoid the warning, I don't know why. However, it turns out that any
  non-positive value for |interval| will have the same effect, so I just
  removed all the INFINITY/HUGE_VAL stuff and used -1 instead.

It also fixes an ARM-only GCC warning.

- "'__force_align_arg_pointer__' attribute directive ignored". This is an
  x86-only attribute. Instead of disabling it on x86-64, instead enable it on
  i386 (which avoids enabling it uselessly on ARM).

--HG--
extra : rebase_source : 61015b7e48aebd58035fc222abf076e79a99a972
2015-09-17 17:11:27 -07:00
Nicholas Nethercote f44287005f Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.

--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973
2015-08-27 20:44:53 -07:00
Benoit Girard 58bb8fc72f Bug 1166252 - Reject lut8/16Type with empty CLUT grid. r=jrmuizel
--HG--
extra : commitid : KiU2IKstYSk
2015-08-25 15:48:55 -04:00
Benoit Girard 509337a1a0 Bug 1132467 - Adjust qcms lut inverse binary search of non monotonic TRC. r=jrmuizel
--HG--
extra : commitid : KdtckZDOAZH
2015-06-04 19:30:52 -04:00
Benoit Girard 9b363da3c3 Bug 1176551 - Don't reject valid profiles with no CLUT offset. r=jrmuizel
--HG--
extra : commitid : FPpGSvD0Xkd
2015-06-23 17:49:39 -07:00