Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve (local) caching of parsed ColorSpaces (PR 12001 follow-up) #12012

Merged
merged 4 commits into from
Jun 24, 2020

Commits on Jun 24, 2020

  1. Re-factor ColorSpace.parse to take a parameter object, rather than …

    …a bunch of (randomly) ordered parameters
    
    Given the number of existing parameters, this will avoid needlessly unwieldy call-sites especially with upcoming changes in later patches.
    Snuffleupagus committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    e22bc48 View commit details
    Browse the repository at this point in the history
  2. Add a proper LocalColorSpaceCache class, rather than piggybacking o…

    …n the image one (PR 12001 follow-up)
    
    This will allow caching of ColorSpaces by either `Name` *or* `Ref`, which doesn't really make sense for images, thus allowing (better) caching for ColorSpaces used with e.g. Images and Patterns.
    Snuffleupagus committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    51e87b9 View commit details
    Browse the repository at this point in the history
  3. Improve (local) caching of parsed ColorSpaces (PR 12001 follow-up)

    This patch contains the following *notable* improvements:
     - Changes the `ColorSpace.parse` call-sites to, where possible, pass in a reference rather than actual ColorSpace data (necessary for the next point).
     - Adds (local) caching of `ColorSpace`s by `Ref`, when applicable, in addition the caching by name. This (generally) improves `ColorSpace` caching for e.g. the SMask code-paths.
     - Extends the (local) `ColorSpace` caching to also apply when handling Images and Patterns, thus further reducing unneeded re-parsing.
     - Adds a new `ColorSpace.parseAsync` method, almost identical to the existing `ColorSpace.parse` one, but returning a Promise instead (this simplifies some code in the `PartialEvaluator`).
    Snuffleupagus committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    19d7976 View commit details
    Browse the repository at this point in the history
  4. Stop passing in unnecessary parameters when parsing the Alternate e…

    …ntry of `ICCBased` ColorSpaces (PR 9659 follow-up)
    
    With the changes made in PR 9659, `ColorSpace.fromIR` no longer takes a second `pdfFunctionFactory` parameter and there's thus one call-site that can be simplified.
    Snuffleupagus committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    b8e1352 View commit details
    Browse the repository at this point in the history