Commit Graph

22 Commits

Author SHA1 Message Date
Brian Osman
36703d9d36 Push much of the SkColorSpace_Base interface up to SkColorSpace
Some pieces still remain, but the next step looks less mechanical,
so I wanted to land this piece independently.

Bug: skia:
Change-Id: Ie63afcfa08af2f6e4996911fa2225c43441dbfb2
Reviewed-on: https://skia-review.googlesource.com/84120
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-12-12 19:34:29 +00:00
Hal Canary
c465d13e6f resources: orgainize directory.
Should make it easier to ask just for images.

Change-Id: If821743dc924c4bfbc6b2b2d29b14affde7b3afd
Reviewed-on: https://skia-review.googlesource.com/82684
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-12-08 17:16:00 +00:00
Leon Scroggins III
f78b55cb94 Simplify SkColorSpace::MakeICC
Rather than restricting the supported ICC types in MakeICC, create any
ICC type that we support, and make the client reject them as necessary
by querying the SkColorSpace::Type.

Remove ICCTypeFlag and replace uses of it with SkColorSpace::Type.

This depends on a change in Chromium
(https://chromium-review.googlesource.com/c/chromium/src/+/741843).
Without that, this change will start allowing non-CMYK images to use
CMYK profiles.

Bug: 727128
Change-Id: I085b4665e49bc80083264496d864cc4cd62ae914
Reviewed-on: https://skia-review.googlesource.com/64841
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-10-31 18:13:04 +00:00
Mike Klein
c2f876bb8d Replace interp() with clut_{3,4}D stages.
I tried to follow exactly the same strategy as a start.
(Though I did fix the off-by-one dimensions.)

It does rather look like we only need 3D and 4D now
that I've looked at the call sites.

Looks like about a 20% speedup.

Change-Id: I8b1af64750ad1750716ee1ab0767e64591c7206a
Reviewed-on: https://skia-review.googlesource.com/32842
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-08-10 14:34:35 +00:00
Mike Klein
c722f79b6c clang on windows support
1) Run python bin/fetch-clang-win
2) Set clang_win = "../bin/clang_win"
3) ???
4) Profit

Most changes here are to pass the right -mfoo flags to Clang
to enable advanced instruction sets, or fixed warning-as-errors.

BUG=skia:2679

Change-Id: Ieed145d35c209131c7c16fdd3ee11a3de4a1a921
Reviewed-on: https://skia-review.googlesource.com/28740
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-07-31 18:39:23 +00:00
Mike Reed
ede7bac43f use unique_ptr for codec factories
Will need guards for android (at least)

Bug: skia:
Change-Id: I2bb8e656997984489ef1f2e41cd3d301c4e7b947
Reviewed-on: https://skia-review.googlesource.com/26040
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-25 15:35:23 +00:00
Mike Klein
fd51b2ba45 add suggested decode color type to colorspaceinfo
E.g.

~/skia (decode-as|✚1…) $ ninja -C out/ colorspaceinfo; and out/colorspaceinfo --input ~/Downloads/prophoto.png
    ninja: Entering directory `out/'
    [2/2] link colorspaceinfo
    SkCodec would naturally decode as colorType=RGBA_8888
    Color Profile Description:
    "Google/Skia/215028B4833C240E0583AFE600C80A79"
    ...

Change-Id: Id36efadaa84e9ffa5d67153e074be8a8426b6c42
Reviewed-on: https://skia-review.googlesource.com/26140
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-07-24 15:57:29 +00:00
Hal Canary
a8565e502d ICC: SkICCGetColorProfileTag supports special cases
Special cases:
  - "sRGB"
  - "AdobeRGB"
  - "DCI-P3"
  - "Linear Transfer with sRGB Gamut"
  - "2.2 Transfer with sRGB Gamut"
  - "sRGB Transfer with DCI-P3 Gamut"
  - "Linear Transfer with DCI-P3 Gamut"
  - "sRGB Transfer with Rec-BT-2020 Gamut"
  - "Linear Transfer with Rec-BT-2020 Gamut"

tools/colorspaceinfo now prints out the Tag.

Also: constants representing gSRGB_TransferFn, g2Dot2_TransferFn, and
gLinear_TransferFn, gDCIP3_TransferFn.

BUG=skia:6720
Change-Id: I92a3f9db9d744d3ec366e4e59afd759ba043c235
Reviewed-on: https://skia-review.googlesource.com/20225
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-07-10 17:08:28 +00:00
Matt Sarett
687cc6c033 colorspaceinfo tool: Add flag to indicate that the input is an icc profile
Bug: skia:
Change-Id: Ieb5cff92bae1aa64df5bc7f3a398514fe5b20f77
Reviewed-on: https://skia-review.googlesource.com/14956
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-02 13:22:20 +00:00
Matt Sarett
1fa986c95a Added A2B support to colorspaceinfo tool
Tool now parses A2B images/profiles.
Tool can now display a cross-section based visualization for the color
look-up tables in A2B profiles.

BUG=skia:

Change-Id: I68abb3e947b080c533e283783d7859feea8d35d6
Reviewed-on: https://skia-review.googlesource.com/6119
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-05-01 22:10:58 +00:00
Cary Clark
2a475eae62 add drawString helper to canvas
Many tests and examples use drawText with
a guess of how long the text is in bytes,
or a call to strlen(). Add a helper to
SkCanvas to simplify these examples.

Add another helper for SkString.

R=reed@google.com

Change-Id: I0204a31e938f065606f08ee7cd9a6b36db791ee2
Reviewed-on: https://skia-review.googlesource.com/13642
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-04-28 20:41:04 +00:00
Mike Reed
3661bc9976 hide trivial helpers on canvas
BUG=skia:

Change-Id: I42d4ca92897bde5bd8e0575a0104b12b83134cef
Reviewed-on: https://skia-review.googlesource.com/8852
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-02-22 19:41:04 +00:00
Matt Sarett
77a7a1b57c SkColorSpace: remove named API, add gamut API
Reland from: https://skia-review.googlesource.com/c/8021/

BUG=skia:

Change-Id: I18985f130587b15fccbc86b76b2bb5c49ba5ba8a
Reviewed-on: https://skia-review.googlesource.com/8136
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-02-07 19:33:37 +00:00
Matt Sarett
1f2fff2544 Revert "SkColorSpace: remove named API, add gamut API"
This reverts commit ecaaf6f1c1.

Reason for revert: Breaks everything

Original change's description:
> SkColorSpace: remove named API, add gamut API
> 
> BUG=skia:
> 
> Change-Id: I01c5e1874c9a034febc64e25b3aaafb5050393a6
> Reviewed-on: https://skia-review.googlesource.com/8021
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
> 

TBR=msarett@google.com,brianosman@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Change-Id: Ief5a0a4eeabe75a21f7512e23fc15309151066c4
Reviewed-on: https://skia-review.googlesource.com/8127
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-02-07 17:06:24 +00:00
Matt Sarett
ecaaf6f1c1 SkColorSpace: remove named API, add gamut API
BUG=skia:

Change-Id: I01c5e1874c9a034febc64e25b3aaafb5050393a6
Reviewed-on: https://skia-review.googlesource.com/8021
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-02-07 17:00:58 +00:00
Matt Sarett
444c1bd38a Fix tool with swapped fC, fE (SkColorSpaceTransferFn)
I missed updating this tool.

BUG=skia:

Change-Id: If5c79f0c41dd829ce8f952106660100ce4accca0
Reviewed-on: https://skia-review.googlesource.com/6963
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-12 19:32:06 +00:00
raftias
a97a60c8ec Added gamma visualizations to colorspaceinfo tool
Visualizations for gamma curves were added.
Tool now outputs at the end following 9 ='s a list of all output images.

BUG=skia:

Change-Id: Id934c4c8cceec68291527554c2c951be08593ef5
Reviewed-on: https://skia-review.googlesource.com/6085
Commit-Queue: Robert Aftias <raftias@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2016-12-16 23:03:01 +00:00
Hal Canary
1fcc40474f SkEncodeImage: no more link-time registration
Also, no more SkImageEncoder class.

SK_SUPPORT_LEGACY_IMAGE_ENCODER_CLASS now only guards some
old API shims.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5006

Change-Id: I3797f584f3e8e12ade10d31e8733163453725f40
Reviewed-on: https://skia-review.googlesource.com/5006
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-11-30 22:48:56 +00:00
Hal Canary
db6830162e SkImageEncoder: simplify API
(re-land 248ff02 & 2cb6cb7, with changes)

  - Hide SkImageEncoder class in private header.
  - SkImageEncoder::Type becomes SkEncodedImageFormat
  - SkEncodedFormat becomes SkEncodedImageFormat
  - SkImageEncoder static functions replaced with
    single function EncodeImage()
  - utility wrappers for EncodeImage() are in
    sk_tool_utils.h

TODO: remove link-time registration mechanism.
TODO: clean up clients use of API and flip the flag.
TODO: implement EncodeImage() in chromeium/skia/ext

Change-Id: I47d451e50be4d5c6c130869c7fa7c2857243d9f0
Reviewed-on: https://skia-review.googlesource.com/4909
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-on: https://skia-review.googlesource.com/5186
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2016-11-23 16:40:32 +00:00
Hal Canary
a2b4bdce8c Revert 248ff023 & 2cb6cb72
Revert "SkImageEncoder: simplify API"
This reverts commit 248ff02331.
Revert "Fix bug: can't convert nullptr -> bool"
This reverts commit 2cb6cb7218.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5151
NOTRY=true

Change-Id: I5f6414392d6545f74db0b5bb50608d04f053a8ec
Reviewed-on: https://skia-review.googlesource.com/5151
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2016-11-22 21:23:51 +00:00
Hal Canary
248ff02331 SkImageEncoder: simplify API
- Hide SkImageEncoder class in private header.
  - SkImageEncoder::Type becomes SkEncodedImageFormat
  - SkEncodedFormat becomes SkEncodedImageFormat
  - SkImageEncoder static functions replaced with
    single function EncodeImage()
  - utility wrappers for EncodeImage() are in
    sk_tool_utils.h

TODO: remove link-time registration mechanism.
TODO: clean up clients use of API and flip the flag.
TODO: implement EncodeImage() in chromeium/skia/ext

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4909

Change-Id: Ib48b31fdc05cf23cda7f56ebfd67c841c149ce70
Reviewed-on: https://skia-review.googlesource.com/4909
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2016-11-22 18:25:55 +00:00
Matt Sarett
8740d5802b Re-purpose color space tool
(1) Compile tool with GN.
(2) Rename tool to colorspaceinfo.
(3) Support both images and icc profiles as input.
(4) Print out information on transfer fn in addition to gamut.

TODO: Output graphs of the three transfer fn curves.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4721

Change-Id: I2e75139685ea41446d3ae6f9803c8068ea05661a
Reviewed-on: https://skia-review.googlesource.com/4721
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2016-11-11 19:31:09 +00:00