RFR: 8307132: Cleanup the code of sun.java2d.cmm.lcms package [v3]

Sergey Bylokhov serb at openjdk.org
Mon May 22 17:20:22 UTC 2023


> The description from big to small:
> 
> - Our code to handle the image types we support is too generic, the LCMSImageLayout class can handle, byte, short, int, and double types, and many various properties of the image layout. As a result, we pass a couple of good parameters to the LCMSImageLayout and have to use safeXX methods in it to calculate the final layout, and then validate it.
>   This patch moves the layout properties calculation to one place - the constructor of LCMSImageLayout, and from the outside of the class, we now pass only the data array and the number of components per pixel:
>  - The usage of Double type is removed, we do not use that type currently, and do not plan to support it in the future. Note that we support the float type, and I tried to implement it, but unfortunately, it is [intentionally ](https://github.com/mm2/Little-CMS/issues/356)slow. So will continue to use short type instead of float.
>  - Discussed a few times the  `do { } while (false);` block is removed.

Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:

 - Merge branch 'openjdk:master' into cms_cleanup_v3
 - split type and size
 - add a comment
 - Merge branch 'master' into cms_cleanup_v3
 - Merge branch 'master' into cms_cleanup_v3
 - 8307132: Cleanup the code of sun.java2d.cmm.lcms package

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/13732/files
  - new: https://git.openjdk.org/jdk/pull/13732/files/fcf3bcbc..d9c35f85

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=13732&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=13732&range=01-02

  Stats: 159749 lines in 2909 files changed: 119836 ins; 19918 del; 19995 mod
  Patch: https://git.openjdk.org/jdk/pull/13732.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13732/head:pull/13732

PR: https://git.openjdk.org/jdk/pull/13732



More information about the client-libs-dev mailing list