Move the IDENTITY_MATRIX constant into src/core/core_utils.js (PR 19772 follow-up)

After the changes in PR 19772 the `IDENTITY_MATRIX` constant is now only used on the worker-thread, which leads to Webpack marking the code as unused in the *built* `pdf.mjs` file; see https://phabricator.services.mozilla.com/D244533#change-8oITAexCvrlQ
This commit is contained in:
Jonas Jenwald 2025-04-07 11:40:18 +02:00
parent 72feb4c256
commit d882d0869c
5 changed files with 6 additions and 5 deletions

View File

@ -25,7 +25,6 @@ import {
BASELINE_FACTOR, BASELINE_FACTOR,
FeatureTest, FeatureTest,
getModificationDate, getModificationDate,
IDENTITY_MATRIX,
info, info,
isArrayEqual, isArrayEqual,
LINE_DESCENT_FACTOR, LINE_DESCENT_FACTOR,
@ -44,6 +43,7 @@ import {
getInheritableProperty, getInheritableProperty,
getParentToUpdate, getParentToUpdate,
getRotationMatrix, getRotationMatrix,
IDENTITY_MATRIX,
isNumberArray, isNumberArray,
lookupMatrix, lookupMatrix,
lookupNormalRect, lookupNormalRect,

View File

@ -30,6 +30,8 @@ const PDF_VERSION_REGEXP = /^[1-9]\.\d$/;
const MAX_INT_32 = 2 ** 31 - 1; const MAX_INT_32 = 2 ** 31 - 1;
const MIN_INT_32 = -(2 ** 31); const MIN_INT_32 = -(2 ** 31);
const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];
function getLookupTableFactory(initializer) { function getLookupTableFactory(initializer) {
let lookup; let lookup;
return function () { return function () {
@ -722,6 +724,7 @@ export {
getParentToUpdate, getParentToUpdate,
getRotationMatrix, getRotationMatrix,
getSizeInBytes, getSizeInBytes,
IDENTITY_MATRIX,
isAscii, isAscii,
isBooleanArray, isBooleanArray,
isNumberArray, isNumberArray,

View File

@ -19,7 +19,6 @@ import {
DrawOPS, DrawOPS,
FONT_IDENTITY_MATRIX, FONT_IDENTITY_MATRIX,
FormatError, FormatError,
IDENTITY_MATRIX,
info, info,
isArrayEqual, isArrayEqual,
normalizeUnicode, normalizeUnicode,
@ -36,6 +35,7 @@ import { compileType3Glyph, FontFlags } from "./fonts_utils.js";
import { ErrorFont, Font } from "./fonts.js"; import { ErrorFont, Font } from "./fonts.js";
import { import {
fetchBinaryData, fetchBinaryData,
IDENTITY_MATRIX,
isNumberArray, isNumberArray,
lookupMatrix, lookupMatrix,
lookupNormalRect, lookupNormalRect,

View File

@ -16,7 +16,6 @@
import { import {
assert, assert,
FormatError, FormatError,
IDENTITY_MATRIX,
info, info,
MathClamp, MathClamp,
unreachable, unreachable,
@ -24,6 +23,7 @@ import {
warn, warn,
} from "../shared/util.js"; } from "../shared/util.js";
import { import {
IDENTITY_MATRIX,
isBooleanArray, isBooleanArray,
isNumberArray, isNumberArray,
lookupMatrix, lookupMatrix,

View File

@ -25,7 +25,6 @@ const isNodeJS =
!process.versions.nw && !process.versions.nw &&
!(process.versions.electron && process.type && process.type !== "browser"); !(process.versions.electron && process.type && process.type !== "browser");
const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];
const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
// Represent the percentage of the height of a single-line field over // Represent the percentage of the height of a single-line field over
@ -1303,7 +1302,6 @@ export {
getUuid, getUuid,
getVerbosityLevel, getVerbosityLevel,
hexNumbers, hexNumbers,
IDENTITY_MATRIX,
ImageKind, ImageKind,
info, info,
InvalidPDFException, InvalidPDFException,