Commit Graph

607 Commits

Author SHA1 Message Date
Ben Wagner
ab6eefe60e Move SkLeanWindows.h to src.
This file pulls in Windows headers in a custom way, which is somewhat
awkward for a library header. The only use in include/ has been replaced
with a single forward declaration.

Change-Id: Ibef4cf7a2d1c9957a6a5b145b95aca1a6868cb5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214689
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-05-21 13:48:00 +00:00
Mike Klein
b3c0bf6426 Revert "manually register codecs in DM"
This reverts commit 9b2633e294.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> manually register codecs in DM
> 
> We'll want to do this when we've got Google3 refactored
> to slice out each of these four codecs into its own little target.
> 
> Small tweaks to make SkPngCodec match the pattern of the rest.
> 
> Should be harmless to have both the compile-time and runtime
> registration, right?
> 
> Change-Id: Ic72394764ac267758dc1023e85f3d0c4b655d420
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213872
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,scroggo@google.com,brianosman@google.com

Change-Id: If3272ef1985757a93ada229f833408d4bf83ddfb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214108
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-05-15 22:03:02 +00:00
Mike Klein
4bf6fd68db Revert "add runtime registration for encoders"
This reverts commit 940c3f136d.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> add runtime registration for encoders
> 
> If we want to make these external dependencies mix-and-match in Google3,
> we'll need to group together the encoders and decoders, everything that
> dependends on each external library.
> 
> I was tempted to try to remove these generic encoder entrypoints and
> replace them with calls to the direct equivalents, but I'm not sure
> that's necessary.  I think we can just register encoders like decoders.
> 
> Change-Id: I41d2d1bb3ceb1daafa62c95d345eb6a70249be75
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213880
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=mtklein@google.com,scroggo@google.com,brianosman@google.com

Change-Id: I3ee9353ca6b3c6c11feba0503b672d8986a347be
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214107
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-05-15 22:02:39 +00:00
Mike Klein
c9deffaed2 Revert "skip runtime registration on iOS"
This reverts commit 017126fe1d.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> skip runtime registration on iOS
> 
> These encoders and decoders are not built and linked
> in Google3 iOS builds.  We just need to hack a bit to
> get DM to build there... we never run it.
> 
> Change-Id: I6cdfbb6df3c4fe30096b2715cad004bccec0bcaa
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214002
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=mtklein@google.com,brianosman@google.com

Change-Id: Id8e9d8ccb79f5cae6d7af4a42dfbe514f77fc417
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214103
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-05-15 22:01:45 +00:00
Mike Klein
017126fe1d skip runtime registration on iOS
These encoders and decoders are not built and linked
in Google3 iOS builds.  We just need to hack a bit to
get DM to build there... we never run it.

Change-Id: I6cdfbb6df3c4fe30096b2715cad004bccec0bcaa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214002
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-05-15 18:59:27 +00:00
Mike Klein
940c3f136d add runtime registration for encoders
If we want to make these external dependencies mix-and-match in Google3,
we'll need to group together the encoders and decoders, everything that
dependends on each external library.

I was tempted to try to remove these generic encoder entrypoints and
replace them with calls to the direct equivalents, but I'm not sure
that's necessary.  I think we can just register encoders like decoders.

Change-Id: I41d2d1bb3ceb1daafa62c95d345eb6a70249be75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213880
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-05-15 18:52:43 +00:00
Mike Klein
9b2633e294 manually register codecs in DM
We'll want to do this when we've got Google3 refactored
to slice out each of these four codecs into its own little target.

Small tweaks to make SkPngCodec match the pattern of the rest.

Should be harmless to have both the compile-time and runtime
registration, right?

Change-Id: Ic72394764ac267758dc1023e85f3d0c4b655d420
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213872
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-05-15 17:03:09 +00:00
Mike Klein
a705cb93c7 remove SkLiteDL
It's been dead code since it was inlined into Android last summer.

Change-Id: I252f6392d9436ef357f22a54bab8a33c9d1b3ea9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213625
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-05-14 18:55:44 +00:00
Herb Derby
a1b7be612c Add thread safety annotations.
Start out with spinlock. I tried to be more extensive, but some
of our abstractions confused the analysis. Will expand further
in following CLs.

Change-Id: I3e320c957d8ef427065a2b7e7d2187b7c6b0aef1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213060
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-05-10 13:40:38 +00:00
Mike Klein
c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00
Mike Klein
9816878163 extract ToolUtils::colortype_depth()
Change-Id: I55a3956ed6d0587f72ddff24a1769ab14e25131f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206981
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-04-09 20:32:15 +00:00
Mike Klein
de8362c6f2 remove DMJsonWriter::AddTestFailure
As far as I can tell, Gold doesn't do anything with this information.
The bots go red if any unit test fails... no need to log it long-term.

Change-Id: Iae9ddd61c0a7d37437bb93441e83948c2e518b42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206940
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-09 19:42:02 +00:00
Brian Osman
f71b070ffd Fix the GLSL persistent cache (and add a config to test it)
We need to store (up to) three GLSL strings in the cache entry,
along with the bookkeeping to reconstruct them. To make things
simpler, we now store the null terminators.

Change-Id: Ic4fe03cb5d774464372ceec8740da1bfe9069550
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205823
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-04-03 18:05:22 +00:00
Hal Canary
0f2f522246 SkMD5 returns digest
Change-Id: I9eb9095131adb5862d286b211501bf194ef8e91e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205822
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-04-03 17:52:22 +00:00
Mike Klein
735c7ba320 FM, a dumber new testing tool
FM's a bit like DM, and a bit like the old GM tool, maybe closer to GM.

FM always does one serial run through of a list of GM, image, or .skp
sources (-s/--sources) into one drawing configuration, set at a high
level with -b/--backend, fine-tuned by flags like --ct, --at, --gamut,
--samples, etc.

FM prints all available GMs when run with no arguments, part of
how it integrates well with external parallelization like xargs:

   out/fm | time xargs -n4 -P32 out/fm -b cpu ... -s
   out/fm | time xargs -n32 -P8 out/fm -b gl ... -s
   ls *.skp | xargs ... out/fm ... -s
   ...

TODO later:
   vector backends: --backend pdf, svg, xps, skp
   --source *.svg, *.json (Skottie)
   Create/update a dm.json file

Change-Id: Idacbd2785deaf6f1d33674c66c4d984fa91dbd85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203520
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-27 14:00:58 +00:00
Mike Klein
c6142d855c de-common the rest of the flags
Turns out lots of tools had two copies of many of these flags.

Some GN and .cpp file refactoring to make sure when flags are
present in a binary, they do something in that binary.

I think this finally finishes the flag refrag.

Change-Id: I01488e37ab73a5c4361786863ddb137a7f1095b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203420
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-25 17:39:58 +00:00
Mike Klein
19cc0f647c create a wrapper to manage --nativeFonts and --gdi
Put it in ToolUtils to avoid cyclic dependencies.

Change-Id: Ie0ad7eb5d1ba58be5ad8c668afdb7c74facd71dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203181
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-22 21:06:29 +00:00
Mike Klein
629f5fc5ec de-common another batch of flags
These are only used by DM and nanobench,
and sometimes even do substantially different things...

Change-Id: I973f3938fbae1fd1b19d876fa6a90122fc55d48c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203167
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-22 20:43:39 +00:00
Mike Klein
d0f321be72 de-common --veryVerbose
In the end only DM and skia_test really use it.

 - nanobench used --veryVerbose in a silly superficial way
 - gm/fontmgr.cpp is probably clearer using its own flag
 - the change to StrokerTest should be a near noop...
   reporter->verbose() is set by --veryVerbose in both
   DM and skia_test.cpp.  One of the checks tested
   FLAGS_verbose, but I feel like that was probably a typo.

Change-Id: I2601d243b8200b3bb7a16478dfbce14001c4a191
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203180
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-22 19:23:09 +00:00
Mike Klein
03fa5d4083 factor out SetAnalyticAAFromCommonFlags()
This wraps up the behavior for --analyticAA and --forceAnalyticAA
in one place, like we've done for the various GPU flags covered by
SetCtxOptionsFromCommonFlags().

It seems at least midly useful to have common flags centralized when
there is really a common mechanism they control.  Most of the rest
of these flags only serve analogous purposes in the various binaries
that use them, and I think it might be better for them to be split
out rather than centralized (so they don't show up confusingly in
binaries that _don't_ use them).

Change-Id: I27dbe53586363d4b262c1679ea73138015811ed1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203095
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-22 18:12:23 +00:00
Mike Klein
4932a5efa8 Fold CommonFlagsGpu into CommonFlags
This scopes a bunch of flags more tightly
to SetCtxOptionsFromCommonFlags().

Change-Id: I6090a016880c085fb5405a45081c0af984a1cd5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203094
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-22 18:01:13 +00:00
Mike Klein
e5acd7547b delete DAA
Change-Id: I1fd8cba067c0063c6621641e8196e69fd5e31cec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203080
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-22 15:44:03 +00:00
Mike Klein
19fb3971bc de-common some flags
Move flags used only in one place to that place,
and remove a couple unused flags.

Change-Id: I0504d9583d464377e84ab28ce378d6da1e99ac3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202802
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-21 18:55:34 +00:00
Mike Klein
5b3f343d25 DEFINE_int32 + DEFINE_uint32 -> DEFINE_int
There's really no big benefit to distinguishing these.

Change-Id: Ib329d32b1fc43e98ba40658cfea37261203ecdb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202801
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-21 17:20:19 +00:00
Brian Osman
f9666f5467 Remove SkColorSpaceXformCanvas, and supporting code:
- SkColorSpaceXformer
- makeColorSpace on SkShader, SkColorFilter,
  SkImageFilter, SkDrawLooper, and SkLights
- DM support and some bot configs

Bug: skia:8773
Change-Id: I16ef8f487de6c35329b3b0474c1d66d7fa0a6220
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202430
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-03-21 17:12:33 +00:00
Mike Klein
84836b799a moar static flags
Like any normal variable, flags can be made file-scoped static,
and like any normal variable, mostly they should be if they can.

This CL converts most flags to be static, if only so that the
ones that do cross files stand out more clearly, and so that
there's more examples of static flags through the codebase for
people to ape.

Change-Id: Ibb5ddd7aa09fce073d0996ac3ef0487b078b7d79
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202800
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-21 17:07:13 +00:00
Mike Klein
eb678fcc1f de-Sk tools/trace
Kept it on SkDebugfTracer, which seemed to parse as "SkDebugf, Tracer".

Change-Id: I3e43fe101798ca5ffe14324e3c29f2dd41a6bd0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202317
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:27:27 +00:00
Mike Klein
ea3f014e2b sk_tool_utils -> ToolUtils, and git clang-format
sk_tool_utils doesn't really fit the naming convention
the rest of code under tools/ tends to use.

Change-Id: I45326a174101c6eb4b6149e9c742f658f2fd23b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202313
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:05:42 +00:00
Mike Klein
0cffcbf97b de-Sk tools/font, and git clang-format
Change-Id: I0326eb9cc1e1e38b0fdc417567987a595f9021d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202310
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 17:36:52 +00:00
Mike Klein
88544fbe63 remove Sk prefix from CommandLineFlags
The command line flag package is tool-only, not part of Skia per se,
and does not need an Sk prefix to avoid naming conflicts.

And git clang-format.

Change-Id: Ida8477779e51750ed0475590ed2454841b23d6ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202307
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 17:13:22 +00:00
Kevin Lubick
805c4e8741 Make ios actually fail
Removed Test-iOS from CQ in https://skia-review.googlesource.com/c/skia/+/202130

Bug: skia:8861
Change-Id: I106425525a8149ee955740ae7ecb2eb633a3aa7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202127
Reviewed-by: Stephan Altmueller <stephana@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-20 14:59:10 +00:00
Mike Klein
ca8087f466 rework --ignoreSigInt
Send it through the main signal handler so we can see resource stats and
what was running at the time we got the SIGINT, and print an FYI note
that we're ignoring it.

Change-Id: Id3bee87d8d07c3ee74b5443198327b7b14d12ddf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201867
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-18 16:59:06 +00:00
Mike Klein
f34d0c79dc re-hash images once more artificially
Some of my early trybots from the first big re-hash CL produced .pngs
without embedded ICC profiles, and some produced .pngs with embedded
profiles, with the same hash.  These were uploaded to Gold, of course.

Where the trybot-without-profile images uploaded first, we see Rec.2020
colors uncorrected as if sRGB, typically rather dim.  Where we're still
producing the same image we see these profile-less images and it's very
confusing, downright misleading.  Makes it impossible to triage.

So, add a salt mechanism to make it easy to re-hash everything,
invalidating all the old hashes so new profile-full images get uploaded.

No-Tree-Checks: true
Change-Id: I51f2bc4612b8a4f38d162124341d27a8e94c6085
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201702
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-03-16 02:39:12 +00:00
Mike Klein
e1271700ad hash and encode rework, wip
Convert all bitmaps to a single common format before hashing.
Also, include bitmap dimensions in the hash.

There's no good format supported by Skia / SkPngEncoder to use,
so we do the converison manually to 16-bit big-endian Rec.2020
RGBA and call libpng directly.

This format is just about as far as wide as we can stretch PNG.

I've temporarily bumped PNG compression level to 9.
Expecting zillions of new images, it'll help to keep them small.
I think we can probably turn this knob back down once this settles.

No-Tree-Checks: true
Change-Id: Ia438289731ae06ac129cb2ff658b7940981c6136
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198760
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-15 22:24:22 +00:00
Brian Osman
b73e607cdd Change --checkF16 behavior to just print - it's easier to see all failures
Bug: skia:
Change-Id: I208b0202b76bcfbf31bd888e7e575ed54c6d27c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201390
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-15 14:24:47 +00:00
Brian Osman
cdf31743af Include test name in error messages for failing tests
Bug: skia:
Change-Id: Ia2da00466ba1326b109f0ff0a8d891735bdc2b4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200925
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-13 14:36:21 +00:00
Brian Osman
582f686980 Add flag to check that F16Norm pixels are clamped properly
Bug: skia:
Change-Id: Ia0d4fd8d191b59683717b179a9613dc3e53df6cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199724
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-11 16:09:31 +00:00
Mike Klein
82020c2db5 add color_depth field in DM/Gold
I think I'd expect images to look the same in Gold when sliced by

    (name, color_depth, alpha_type, gamut, transfer_fn)

And sometimes OS.

Change-Id: Ia6c08c7611d1622014a0842bf685d1b161d5ebf5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198762
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-03-07 21:32:35 +00:00
Mike Klein
612d5c2b70 encode F16Norm as rec2020
Just a debugging aid to help diffing against esrgb.

Change-Id: I5e4991f598a7b00a0d903fddcf3a05a396c0536d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198221
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-06 19:33:28 +00:00
Mike Klein
0d5d142f6e rework colorImage testing
Replace all the old modes with two that should draw the same:

  1) decode to the codec's "native" SkImageInfo, draw to dst;
  2) decode to the dst's ct/at/cs, draw to dst.

Testing against --config srgb, p3, rec2020, narrow ought to give
us the kind of destination variety we were getting from the old
modes, and --configs 8888 shows off managed vs. unmanged color.

The only difference between the two is that 1) does any conversion at
draw time, 2) at decode time.

I don't quite understand why codec won't decode to some images to 565,
nor any images to 4444.

Bug: skia:8816
Change-Id: Ie57cb57312fdf21fd8dc36a0fa4d2c3b22e77acf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198181
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-03-06 18:02:27 +00:00
Mike Klein
0abbaca9a5 also tag DM results with color and alpha type
This can be nice to slice by, and helps if you can't exactly remember
the difference between things like "glesrgb" and "glessrgb".

Change-Id: Ib54d29f4c2066e01bd7c4f0b445507f7a65f4f40
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198180
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-06 16:30:17 +00:00
Mike Klein
b70990eda4 add kRGBA_F16Norm_SkColorType
For now this is distinct from kRGBA_F16_SkColorType but treated the
same.  Next steps are to see if we can keep it clamped to [0,1].

Switched a few switches away from default to exhaustive.

Took away any explicit SW clamps for now except the one we definitely
want in append_gamut_clamp_if_normalized().

Skip F16Norm in the DDL test because we can't yet distinguish it from
F16.

Change-Id: I021a864fe078e4fa4e2b399982e6c38350e10d74
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196371
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-03-04 21:49:07 +00:00
Mike Klein
c7a0916e54 add gbr --config
If we want to compare CSXform vs. tagged drawing, we should be able to
compare gbr-8888 vs. esgbr.

The spin happens when dump_png() converts to Rec.2020.  This has the
"problem" that Gold and other naive image diff tools will think these
images are bytewise very different but once you look at them they'll
make sense to compare.

(You'd want to ideally diff esgbr with gbr-esrgb, but that config
asserts because it's SkColorSpaceXformCanvas doesn't like transforming
into tagged targets.)

(Yes, I chose "esgbr" to both make sense when you think about it but
also, more importantly, to be completely confusing.)

Bug: skia:8774
Change-Id: I25aae41f8d80c48528891b083d1dcac8dac0d88f
Reviewed-on: https://skia-review.googlesource.com/c/193175
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-19 15:23:42 +00:00
Mike Klein
66f09a7299 replace gamma_correct with gamut/transfer_fn in DM
gamma_correct as is (really meaning, linear blending) isn't super
useful, in that it doesn't distinguish gamuts or transfer functions
except between identity and non-identity.

This replaces it with fields that describe the gamut and TF.

Change-Id: Ied08c2df537be61ee1903ef6cc279991326271a2
Reviewed-on: https://skia-review.googlesource.com/c/191573
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Stephan Altmueller <stephana@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-13 00:15:38 +00:00
Brian Osman
57796b340e Revert "Remove --readPath/-r from DM"
This reverts commit c5245fcd8e.

Reason for revert: Still being used.

Original change's description:
> Remove --readPath/-r from DM
> 
> This was an (unused) feature to compare GM results against a previously
> generated set, while DM was running. It was also one of the users of
> JsonCPP, which is being evicted from Skia.
> 
> Bug: skia:
> Change-Id: I42d6204250782681e22219863e7170744d8be111
> Reviewed-on: https://skia-review.googlesource.com/c/186867
> Auto-Submit: Brian Osman <brianosman@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,brianosman@google.com

Change-Id: I05a74166a72ce106be73f3e0809e7f96e963aab5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/186868
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-01-25 18:03:11 +00:00
Brian Osman
c5245fcd8e Remove --readPath/-r from DM
This was an (unused) feature to compare GM results against a previously
generated set, while DM was running. It was also one of the users of
JsonCPP, which is being evicted from Skia.

Bug: skia:
Change-Id: I42d6204250782681e22219863e7170744d8be111
Reviewed-on: https://skia-review.googlesource.com/c/186867
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-01-25 16:51:41 +00:00
Hal Canary
2111d5fdfe SkPDF: elimate old IMAGE_STATS, de-dupe image code.
- remove SkPDFDict::emitAll()
  - all stream serialization moved into SkPDFDocument.
  - SkPDFDocument::endObject() and ::beginOject() now private.

Change-Id: I4d8a5643027f859e1c0307a379c74859faae0d06
Reviewed-on: https://skia-review.googlesource.com/c/180370
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-01-14 18:55:05 +00:00
Mike Klein
97c7cf16de remove --undefok
I think we originally added this for the bots, back in the good old days
when the bot scripts weren't versioned with Skia.  No bots use this now.

Change-Id: Icdee95d27fb928d0215601e082d056e611eb6202
Reviewed-on: https://skia-review.googlesource.com/c/181980
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2019-01-09 18:15:07 +00:00
Brian Osman
82ebe04caf Reland "Add SkColorSpace factory from 3x3 row-major gamut and transfer function"
Moved named common transfer functions and gamuts to constexpr values in
SkColorSpace.h, in SkNamedTransferFn and SkNamedGamut namespaces.

Converted nearly all SkColorSpace::MakeRGB calls within Skia to use the
new factory with the named values. Multiple clients want a way to
extract named transfer function and gamut - this still doesn't provide
that, but this may be a better path forward for honestly advertising how
SkColorSpace works internally.

Originally landed as:
https://skia.googlesource.com/skia/+/a9549ab31630fc244094e6f1692371cbaf87f666

Re-landing with a new serialization format, but maintaining ability to
load old serialized color spaces, for SKP compatibility.

Bug: skia:
Change-Id: Ib84a6e1cd5d7d9816175773fdbaff2ca32658667
Reviewed-on: https://skia-review.googlesource.com/c/181176
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-01-05 20:06:51 +00:00
Brian Osman
d4c7458f64 Revert "Add SkColorSpace factory from 3x3 row-major gamut and transfer function"
This reverts commit a9549ab316.

Reason for revert: SKPs changed?

Original change's description:
> Add SkColorSpace factory from 3x3 row-major gamut and transfer function
> 
> Moved named common transfer functions and gamuts to constexpr values in
> SkColorSpace.h, in SkNamedTransferFn and SkNamedGamut namespaces.
> 
> Converted nearly all SkColorSpace::MakeRGB calls within Skia to use the
> new factory with the named values. Multiple clients want a way to
> extract named transfer function and gamut - this still doesn't provide
> that, but this may be a better path forward for honestly advertising how
> SkColorSpace works internally.
> 
> Bug: skia:
> Change-Id: I9296d67e8f0dab5ceb49869cb3ba24e98a05f3c4
> Reviewed-on: https://skia-review.googlesource.com/c/180360
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=mtklein@google.com,brianosman@google.com,reed@google.com

Change-Id: Ie888f877b3c1dba33e1a8c0f5fa92594628de7fb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/181300
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-01-04 17:07:48 +00:00