Commit Graph

1297 Commits

Author SHA1 Message Date
Florin Malita
67ff541ac1 [skottie] Add support for embedded fonts (glyph paths)
Parse embedded fonts into SkCustomTypefaces, and pass down the text
animation pipeline.  Things seem to mostly work for Latin examples.

Most existing Lottie files come with embedded fonts (the option is
enabled by default), so to minimize disruption only use the new
feature as a fallback for typefaces which cannot be resolved otherwise.

Also introduce a builder flag to prioritize embedded fonts over native
(kPreferEmbeddedFonts), and plumb in existing tools for testing.

Change-Id: Ia2a659f76e354fea6081b0f2e0dce1d8bdf63c52
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291180
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-05-21 01:27:34 +00:00
Leon Scroggins III
87caae61cd Move SkBitmapRegionCodec into client_utils/android
Bug: skia:10154

This will make it clear that these files are for Android use and
avoid compiling them for other clients.

Update testing tools to use android::skia::BitmapRegionDecoder, but
only if SK_ENABLE_ANDROID_UTILS is defined.

Take this opportunity to clean up the class:
- The base class, which was originally designed to allow switching
  amongst different implementations, is no longer needed. Rename
  SkBitmapRegionCodec to android::skia::BitmapRegionDecoder
  (following the new convention and matching the Java API name).
  Continue to inherit from SkBitmapRegionDecoder temporarily, to
  allow Android to switch to the new API.
- Use std::unique_ptr instead of passing raw pointers.

Add a test to verify that we only create a BitmapRegionDecoder if
it is one of the supported types.

Change-Id: Ied13fc8acb105fde042553331846d95ae15d6b57
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287498
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-05-20 20:06:48 +00:00
Brian Salomon
330db4bed8 Remove outdated color type readback workaround from dm
Change-Id: Ic3d9a17674baac8d567ee6229ee2ee0716d9dca9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289980
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-05-14 22:11:35 +00:00
Greg Daniel
0a2464f51f Update internal skia uses to use flushAndSubmit and submit calls.
Bug: skia:10118
Change-Id: Ieb7c0eece56d3d9df56ecb52e00e76c01f038de8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289888
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-14 20:26:44 +00:00
Florin Malita
fbddfbb9f3 [skottie] Introduce an external layer API
Add support for external precomp Skottie layers.  This allows embedders
to seamlessly mix custom/Lottie content.

General flow:

  * embedders register a PrecompInterceptor callback with
    the animation builder
  * at build time, Skottie invokes the callback for each pre-composed
    layer
    - the returned ExternalLayer implementation is used instead of the
      Lottie layer payload
    - (a nullptr value signals Skottie to use the usual Lottie payload)
  * at render time, ExternalLayer::render() is called to defer content
    rendering to the embedder

Also implement a sample PrecompInterceptor which attempts to substitute
precmp layers matching a given pattern with external Lottie animations:

   precomp_name: "__foo.json"  -> Animation("foo.json")

This new mechanism is a generalization of (and supersedes) the old
NestedAnimation hack - so we can remove that.

Change-Id: Id80fe11881c62b8717c2476117c7c03ad5300eef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288130
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2020-05-06 20:31:14 +00:00
Greg Daniel
c1ad77cf48 Add finisehd proc to backend texture creation.
The callback lets the caller know when the data uploads to the texture
from the create call are finished. This is important since the caller
cannot delete the backend texture till the gpu is finished on vulkan
and d3d.

This change also removes the hard sync in vulkan during creation.

Change-Id: I660d142219474e22b1337d2b0c81cda66fe18a4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286517
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-05-06 16:50:33 +00:00
Robert Phillips
273f107a2d Dump out path-mask generation and caching stats
These stats would've helped block https://skia-review.googlesource.com/c/skia/+/286902 (Add path bounds to SW path mask key) from landing.

Change-Id: I684f39de53fb2678c7a679e4e4aafdbb39a154ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287499
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-05-05 18:21:49 +00:00
Robert Phillips
11c6767a17 Create DDL for final composition step in DDL test harness
Besides better matching Viz's behavior this also reduces a lot of choppiness in the composition RenderTask DAG.

In the previous approach DDL draws and compositing draws would be interleaved resulting in a lot of render target swaps.

This necessitated some reorganization bc I wanted to reuse PromiseImageCallbackContext to manage the tiles' promiseImages.

Change-Id: I513bf060a69ff2bfe0e7b82ae72f149dfede632e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285056
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-24 12:16:34 +00:00
Robert Phillips
6276819023 Allow SkThreadPool to be non-borrowing
The GPU thread has privileged access to the GPU so its work can't be easily borrowed.

Change-Id: I1eae4c86ff1c36cc1248f74fc48d76b1c243f0b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284764
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-23 16:11:28 +00:00
Robert Phillips
8472a3d01c Update DDL test harness to use backendTextures to back tiles (take 2)
This better matches Chrome's use of DDLs.

With path, image, and text draws stripped out, here is the perf impact of this change:

           before CL   after CL
w/ DDLs      7.792      1.038
w/o DDLs     0.800      0.876

This perf improvement (in the DDL case) is from backend texture wrapping SkSurfaces being created w/o initialization. The prior method of SkSurface creation was resulting in double clearing of all the surfaces.

This perf improvement won't be seen by Chrome since they've always being using wrapped backend texture SkSurfaces.

TBR=bsalomon@google.com

Bug: 1056730
Change-Id: Ic04d322cad96df845e75437211208495862c6555
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283866
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-17 14:39:44 +00:00
Robert Phillips
4e3ceb96b8 Fix up GPUDDLSink for Vulkan
Change-Id: If38afff3d07f51fd0f5a989c2f59e3c788086f8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284099
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-16 20:17:12 +00:00
Robert Phillips
9ff1d841f6 Revert "Update DDL test harness to use backendTextures to back tiles"
This reverts commit 7ae9d2fca6.

Reason for revert: Triggering Vulkan Debug layer errors

Original change's description:
> Update DDL test harness to use backendTextures to back tiles
> 
> This better matches Chrome's use of DDLs.
> 
> With path, image, and text draws stripped out, here is the perf impact of this change:
> 
>            before CL   after CL
> w/ DDLs      7.792      1.038
> w/o DDLs     0.800      0.876
> 
> This perf improvement (in the DDL case) is from backend texture wrapping SkSurfaces being created w/o initialization. The prior method of SkSurface creation was resulting in double clearing of all the surfaces.
> 
> This perf improvement won't be seen by Chrome since they've always being using wrapped backend texture SkSurfaces.
> 
> TBR=bsalomon@google.com
> Change-Id: Ice3993ca125fce37804e58c353c265cf659dbe2f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283456
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Ife023ede0774ec2cce4c0d6e7708c036347ebf54
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283648
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-15 16:22:17 +00:00
Robert Phillips
7ae9d2fca6 Update DDL test harness to use backendTextures to back tiles
This better matches Chrome's use of DDLs.

With path, image, and text draws stripped out, here is the perf impact of this change:

           before CL   after CL
w/ DDLs      7.792      1.038
w/o DDLs     0.800      0.876

This perf improvement (in the DDL case) is from backend texture wrapping SkSurfaces being created w/o initialization. The prior method of SkSurface creation was resulting in double clearing of all the surfaces.

This perf improvement won't be seen by Chrome since they've always being using wrapped backend texture SkSurfaces.

TBR=bsalomon@google.com
Change-Id: Ice3993ca125fce37804e58c353c265cf659dbe2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283456
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-15 16:07:47 +00:00
Greg Daniel
58b5a54707 More robust fix for command buffer context crash.
There apparently were other tests that had similar issues and this fix
is much better and is more future proof.

Change-Id: I4835c7e5772b9e70249a69255aae8808be172eef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282681
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-09 19:28:06 +00:00
Robert Phillips
9b00f1ff54 Make skia_use_xps option work on Windows
Some may not want to always compile XPS on Windows

Change-Id: Icd4cc993667fdce740216b9c52a0a649dcf79645
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278782
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-03-24 17:09:33 +00:00
Brian Osman
0b22f3bc53 Remove workaround for ANGLE + NVPR + Persistent Shader Cache
ANGLE no longer supports NVPR, so this isn't necessary.

Change-Id: I68e720f17238c960e6f6ca07fe108f5fefed7705
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278467
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-23 18:48:53 +00:00
Robert Phillips
6eb5cb96fc Clean up for DDL program pre-compilation
This CL:
  1) Fixes a GrTexture access in GrTextureEffect that was blocking pre-compilation

  2) Adds program pre-compilation to the DDL Via - which would've caught the GrTextureEffect problem on the bots

  3) Adds some #if'ed out code for collecting program pre-compilation stats

Bug: skia:9455
Change-Id: Ibcb07ae855b7a644e1f22c3427a928f116ab300d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275336
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-03-05 19:11:37 +00:00
Robert Phillips
ce97857f5b Add GrSimpleMeshDrawOpHelper::CreateProgramInfo
This helper method can be used by the MeshDrawOps to (pre-)create their GrProgramInfos.

Bug: skia:9455
Change-Id: I41b7c2aefc0f633a1d32996c7f0cce3d11f8fcb1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273815
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-28 19:26:56 +00:00
Robert Phillips
19f466d399 Adds gpu stats for program cache
With the addition of the DDL program pre-compilation we need to know how it is working.

This CL also fixes some threading bugs.

Bug: skia:9455
Change-Id: I20da58a7f1b19685687fae1d159d4e0db8a4964d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273001
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-26 16:11:56 +00:00
Greg Daniel
02497d4016 Update nanobench and skpbench to use flush API for gpu syncing.
This also allows us to remove all the one off Fence code that we
implemented in all the backend TestContexts

Change-Id: I9ff7ba4690cf3f19a180f51fc510991a112bb62c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272456
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-02-24 17:21:35 +00:00
Ben Wagner
828a7ef39d [infra] Switch iOS to updated libimobiledevice.
Bug: skia:9799
Change-Id: I94069d58bde1762ef19122605147bd75232b6ed8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270446
Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Weston Tracey <westont@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2020-02-21 16:21:20 +00:00
Robert Phillips
7b0ed557a9 Start precompiling DDL shaders
This is through a private API but it, at least, connects things end-to-end.

Bug: skia:9455
Change-Id: Ib34d49c5c4e4cfa5fa599afc5c967fcadc3de10e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268627
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-02-20 18:08:13 +00:00
Robert Phillips
291f3405f3 Add new gpu sink for DDLs
Having this as a sink rather than a Via allows us to do more aggressive things with threads and shared contexts.

Change-Id: I3ca1076686fa4f53387c12a9506e01910c1bc3e4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272016
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-20 13:51:07 +00:00
Mike Reed
3eaed8d009 fix clang-tidy warnings
unused declaration
passing std::move() to const&

These are triggering warnings in google3

Change-Id: I12cebd0a8fd218e7755718fed7acec7908d386a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271138
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-15 16:32:46 +00:00
Robert Phillips
923181b6e3 Improve DDLPromiseImageHelper
Split apart creation of the callback contexts and the backend textures
   This allows the texture upload to be done separately on the
   gpu-thread

Add a backendFormat member to the promise image callback context
   This allows the promise images to be created in CreatePromiseImages
   before the backend textures have been created (i.e., the backend
   textures can now be created on the gpu-thread so we have no
   guarantee they will be available when the SKP is being reinflated
   w/ promise images)

Change-Id: I1e21385e450a5ef27dd6950d9d6aee737aa7515d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270939
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-14 19:17:10 +00:00
Robert Phillips
a865a3aedb Improve DDLTileHelper
TileData now gets a pointer to the final surface
   This allows the tile to, once rendered, compose itself into
   the final surface

DDLTileHelper now stores the TileData in a dumb array
   SkTArray is overkill and, since TileData*s are being doled
   out to threads, we never want reallocation

Added DDLTileHelper::kickOffThreadedWork
   The old code only performed DDL creation in parallel. This
   entry point also replays the DDLs and composes them into the
   final surface in parallel

Change-Id: I66e02ef7f8291b4d402e22bee0ad3546e930609e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270796
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-14 18:48:50 +00:00
Robert Phillips
3c1efd4909 Carve some helper functions off of GPUSink (take 2)
I'm adding a new DDL Sink and would like to reuse this functionality.

TBR=egdaniel@google.com
Change-Id: I17ae929557400be4edd8df78ab6580872024bc15
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270799
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-14 13:55:18 +00:00
Robert Phillips
45f37c3795 Revert "Carve some helper functions off of GPUSink"
This reverts commit 7b2fcfbc5a.

Reason for revert: Need to loosen up error handling

Original change's description:
> Carve some helper functions off of GPUSink
> 
> I'm adding a new DDL Sink and would like to reuse this functionality.
> 
> Change-Id: I9f4535ca5e0f36925bf896cb0076eab73fe60fd1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270639
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,robertphillips@google.com

Change-Id: I97968834b5719c2061d53caff0dcf08a80917beb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270798
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-13 20:27:23 +00:00
Robert Phillips
7b2fcfbc5a Carve some helper functions off of GPUSink
I'm adding a new DDL Sink and would like to reuse this functionality.

Change-Id: I9f4535ca5e0f36925bf896cb0076eab73fe60fd1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270639
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-02-13 19:40:33 +00:00
Ben Wagner
ea25fcf027 Replace DM:Error with DM::Result.
Initially, Error was written with the intent that an empty string meant
Ok and anything else meant Fatal. This made things simple with implicit
constructors from strings. With the introduction of Nonfatal the state
was now tied up with an additional boolean. Now the empty string meant
Ok and causes the new boolean to be ignored, or at least that is the way
it was used since Error didn't actually enforce that itself. This leads
to GMs which return kSkip but don't set the message to not be skipped.
This could be fixed in several ways.

The first would be for the GMSrc to notice that a GM had returned kSkip
with an empty message and create the Error::Nonfatal with a non-empty
message. This has the downside of being some extra unexpected complexity
and doesn't prevent similar issues from arising in the future.

The second would be to change how DM interprets the Error, and if the
non-fatal bit is set treat that as a sign to skip, even if the message
is empty. This fixes the stated issue, but doesn't fix the issue where a
GM can return kFail but also leave the message empty. This could again
be fixed by either modifying GMSrc::draw or GM::drawContent, but this
also seems a bit brittle in not preventing this from happening again in
the future.

So this replaces Error with Result, which makes the status orthogonal to
the message. It does lose the automatic conversion from string, but by
being able to wrap the many uses of SkStringPrintf the explicit nature
doesn't add much additional noise to the more complex failure reports.

Change-Id: Ibf48b67faa09a91a4a9d792d204bd9810b441c6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270362
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-02-12 19:05:46 +00:00
Mike Klein
508fd32091 make SkBBH a public interface
I don't necessarily like this long term, but in the short term Flutter
would like to record pictures using their own type separate from
SkRTree.  This makes SkBBoxHierarchy public, and converts it to use
other public types (SkTDArray -> vector).

Change-Id: I29c5ef9da7d641d8f4ba18522b168ddf7cefe84f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270387
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-02-12 16:31:05 +00:00
Mike Klein
f7eb0544a8 basic, untested BGR 1010102 and 101010x
Updated every switch that yelled at me, and added support to dm and fm,
and then founds some more switches that shouldn't have defaults...

The tricky spots outside those were mips and dither,
since they aren't simply exhaustive switches.

_Now_ no diffs between RGB/BGR 1010102 and 101010x.

No GPU support.

Bug: skia:9893
Change-Id: I73ab3fd22bdef0519296dfe4cb84031e23ca0be3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270114
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-11 21:44:57 +00:00
Leon Scroggins III
42a604f431 Allow decoding without color conversion - part 2
Bug: b/135133301

Follow-on to 196f319b.

- Add SkCodec::getICCProfile to match the SkAndroidCodec version.
- Update comments on getPixels() regarding how the SkColorSpace on the
SkImageInfo is treated.
- Add two new images that have ICC profiles that do not map to an
SkColorSpace. Add a test to verify that they have the un-transformed
color we expect.
- Stop uploading ColorCodecSrc images decoded to a null SkColorSpace to
Gold. Though they may be correct, they do not match other images they're
compared against. The new test above verifies that we do not do color
conversion with a null SkColorSpace.

Change-Id: I08635e4262f16500fab32ef97511d305c2c06483
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269236
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-02-07 19:24:33 +00:00
Brian Osman
788b91678f Remove SkTMin and SkTMax
Use std::min and std::max everywhere.

SkTPin still exists. We can't use std::clamp yet, and even when
we can, it has undefined behavior with NaN. SkTPin is written
to ensure that we return a value in the [lo, hi] range.

Change-Id: I506852a36e024ae405358d5078a872e2c77fa71e
Docs-Preview: https://skia.org/?cl=269357
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269357
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-07 18:40:09 +00:00
Tyler Denniston
45f94f8344 Reland: Initial checkin of GM verifier framework
The goal of the verifier framework is to enable opt-in checks of the
images produced by individual GMs. The basis of verification will be
comparing the rendered output of a GM against a source-of-truth image,
such as one generated by the CPU backend.

In the short term this can enable coarse-grained sanity checks for a
subset of GMs to catch e.g. egregious rendering bugs. In the longer term
this can provide an SkQP-style suite of tests that can be run across
many/all GMs to provide a vote of confidence in the rendering
correctness of new devices.

Bug: skia:9855
Change-Id: I50f15ecd029b28b69c0f68dc4126df3a4dd61d75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268685
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-02-06 15:01:31 +00:00
Tyler Denniston
14d64afaa8 Revert "Initial checkin of GM verifier framework"
This reverts commit 7e36f0015e.

Reason for revert: breaking google3 roll

Original change's description:
> Initial checkin of GM verifier framework
> 
> The goal of the verifier framework is to enable opt-in checks of the
> images produced by individual GMs. The basis of verification will be
> comparing the rendered output of a GM against a source-of-truth image,
> such as one generated by the CPU backend.
> 
> In the short term this can enable coarse-grained sanity checks for a
> subset of GMs to catch e.g. egregious rendering bugs. In the longer term
> this can provide an SkQP-style suite of tests that can be run across
> many/all GMs to provide a vote of confidence in the rendering
> correctness of new devices.
> 
> Bug: skia:9855
> Change-Id: Id7310de8005ffa7e8eb2fd0e4008f5f8db1419ab
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267761
> Commit-Queue: Derek Sollenberger <djsollen@google.com>
> Auto-Submit: Tyler Denniston <tdenniston@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

TBR=djsollen@google.com,tdenniston@google.com

Change-Id: Ie3beff447fea406b5ad3c3ca5a98fa2bd73d20fb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9855
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268682
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-02-04 20:54:39 +00:00
Tyler Denniston
7e36f0015e Initial checkin of GM verifier framework
The goal of the verifier framework is to enable opt-in checks of the
images produced by individual GMs. The basis of verification will be
comparing the rendered output of a GM against a source-of-truth image,
such as one generated by the CPU backend.

In the short term this can enable coarse-grained sanity checks for a
subset of GMs to catch e.g. egregious rendering bugs. In the longer term
this can provide an SkQP-style suite of tests that can be run across
many/all GMs to provide a vote of confidence in the rendering
correctness of new devices.

Bug: skia:9855
Change-Id: Id7310de8005ffa7e8eb2fd0e4008f5f8db1419ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267761
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-02-04 20:11:24 +00:00
Mike Klein
055f5355d5 pdf rasterization
- add Mac PDF rasterizer
- create a mac pdf bot
- blacklist some GMs that CG takes forever to rasterize
- remove obsolete --dont_write pdf feature

This new Mac -PDF bot is now the _only_ bot running PDF code.
Obviously we can expand from here.

pdfium was looking like a pain to build and/or integrate
into our own build.  pdftocairo looked promising, and is
already installed on the bots, but it is very slow and
prone to error.  CG was the next thing I tried.

Change-Id: I82b04121f484e7dd78f60a648485a09218dd5279
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267810
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-01-30 21:21:28 +00:00
Mike Klein
9ae06637d0 add --skvm to DM
Change-Id: I54038b34cb10322ec688f24e3869a7481d2e2c66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267070
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-01-28 19:07:54 +00:00
Mike Klein
b147aceed7 DCI-P3 -> Display P3 in Skia
This keeps an alias so code keeps building.

Bug: skia:9792
Change-Id: If8575468d929d2ca28bc2f9e82de27291fb19aa1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264691
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-01-16 21:24:16 +00:00
Nathaniel Nifong
a072b7b275 Remove an uncessary and unused parameter for partially generating the JSON command list
All caller were passing the maxium value, those that weren't still function if they are made to.

Change-Id: Id9b5d8dbbbdf10a02ea0f3b21d500059ec383e3a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259808
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-12-13 19:30:03 +00:00
Mike Klein
f46d5ca492 use std::make_unique
Change-Id: I7c672ff6b8eb95ec8c1123a5bfdb202e1644f494
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259281
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-12-12 22:32:45 +00:00
Brian Salomon
4e1066f248 Remove SkSize& SkSize::operator=(const SkISize&)
Having it means you cannot write:

SkSize size;
float x, y;
size = {x , y};

clang allows it but GCC does not, claiming it is ambiguous between the
implicitly generated
SkSize& SkSize::operator=(const SkSize&)
  and
SkSize& SkSize::operator=(const SkISize&)

clang gives the same error if the former is explicitly declared default.

Change-Id: I3b64436ef6aa669b3d87e7f37057c5dcb4add987
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257880
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-12-04 17:36:06 +00:00
Brian Osman
849f4d6571 Copy SkottieUtils' classes into skresources
For now, we'll have two copies. Once clients are using the skresources
versions exclusively, we can remove the originals from skottie.

Change-Id: I3152f526b0505b8374bdd9b4513a80bddc702ccc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256416
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-11-26 14:25:44 +00:00
Mike Reed
2319b803c2 remove unused (by clients) SkMultiPictureDraw
More cleaning to do if we like this idea...

Change-Id: I608143db085911565dd5f5426f7ee6436ec58cdf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254680
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-11-15 18:18:36 +00:00
Brian Osman
09ee112bdb Reland "Fully embrace skcms types in SkColorSpace API"
This reverts commit 6af9b1c673.

Change-Id: I7954951497e57475ab6f1c7f946b47aa17f1ac8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252817
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-11-05 18:36:26 +00:00
Robert Phillips
6af9b1c673 Revert "Fully embrace skcms types in SkColorSpace API"
This reverts commit 701522798a.

Reason for revert: Maybe blocking the Android roll

Original change's description:
> Fully embrace skcms types in SkColorSpace API
> 
> Remove the SkMatrix44 getter entirely.
> 
> Change-Id: I25bfe68a7a9b21d8a8696415b517cb79fc2d7a94
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252596
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: Ic277d54d4ac8c84f00405946c927a3aee4e33068
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252801
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-05 15:03:49 +00:00
Brian Osman
701522798a Fully embrace skcms types in SkColorSpace API
Remove the SkMatrix44 getter entirely.

Change-Id: I25bfe68a7a9b21d8a8696415b517cb79fc2d7a94
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252596
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-11-04 21:22:38 +00:00
Brian Salomon
28a8f28b3e Rename functions in TestUtils.h
Change-Id: Iaa8a4ac57e967c6429473fb3a738d377a47fc2c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250799
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-10-25 00:36:28 +00:00
Jim Van Verth
5a8f3e4aac Reland "Enable Programs (formerly GLPrograms) test for other APIs"
This is a reland of 598741667a

Original change's description:
> Enable Programs (formerly GLPrograms) test for other APIs
> 
> Bug: skia:9365
> Change-Id: I2eeac4e628425411b0a8f9ffa94ad61d58254b77
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249806
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Eric Boren <borenet@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

Bug: skia:9365
Change-Id: I94db6cb2b1465edbb2e6d32708b835a76e12cbc6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250016
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-10-24 19:53:25 +00:00
Florin Malita
cfbc4d496d [skottie] Add DataURI image support in utils/tools
BodyMovin can export inline (dataURI) images.

Change-Id: I821a2e225359f8ac37d4d2c9479d4ff5d78f924e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249516
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-10-21 18:02:39 +00:00
Brian Osman
11e6aa823d Starting to hack up HDR transfer function support
Brings over skcms' encoding scheme, etc.

Change-Id: Ib8abec911acd1c50df3b201b4a9bde01b1cb123b
Bug: chromium:960620
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249000
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-10-16 18:40:16 +00:00
Brian Salomon
9241a6d394 Reland "Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime""
This is a reland of 6fc04f88a8

Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
> 
> This is a reland of ce240cc6fd
> 
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> > 
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> > 
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> > 
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> > 
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> > 
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> > 
> > Bug: chromium:973403
> > Bug: skia:8962
> > 
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: chromium:973403, skia:8962
Change-Id: Ie584c1c3ef8021c976f71b708e53871c693cc450
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246057
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-03 19:14:22 +00:00
Ravi Mistry
cb55010652 Revert "Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime""
This reverts commit 6fc04f88a8.

Reason for revert: Chrome roll failure suspect because of:
* https://chromium-review.googlesource.com/c/chromium/src/+/1837131 (22 commits)
* https://chromium-review.googlesource.com/c/chromium/src/+/1837214 (24 commits)

Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
>
> This is a reland of ce240cc6fd
>
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> >
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> >
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> >
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> >
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> >
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> >
> > Bug: chromium:973403
> > Bug: skia:8962
> >
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I9e01d1b82fb399b94292441d91da51176bb161d9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973403, skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245956
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2019-10-03 09:19:24 +00:00
Brian Salomon
6fc04f88a8 Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
This is a reland of ce240cc6fd

Original change's description:
> SkSurface asynchronous read APIs allow client to extend pixel lifetime
> 
> Previously the pixel data passed to the client was only valid during
> the client's callback. This meant if the client wanted to defer
> processing of the data a copy was necessary.
> 
> Now we pass an object to the callback and the pixel lifetime is tied
> to the lifetime of that object.
> 
> The object may be holding a GPU transfer buffer mapped. We don't assume
> that the object will be released on the direct GrContext thread. So
> when the object is destroyed it posts a message to a new type,
> GrClientMappedBufferManager, hanging off the direct context. The direct
> context will periodically check for messages and unmap and then unref
> buffers so that they can be reused. Currently this is done in
> GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> 
> The old API is kept around for backwards compatibility but it is
> reimplemented as a bridge on top of the new mechanism.
> 
> Also a utility function to SkImageInfo is added to directly make a new
> info with a specified dimensions rather than passing the width and
> height separately to makeWH().
> 
> Bug: chromium:973403
> Bug: skia:8962
> 
> Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: chromium:973403, skia:8962
Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-03 01:41:35 +00:00
Brian Salomon
9c219785a8 Revert "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
This reverts commit ce240cc6fd.

Reason for revert: crashing in chrome unit test, abandoned context related?

Original change's description:
> SkSurface asynchronous read APIs allow client to extend pixel lifetime
> 
> Previously the pixel data passed to the client was only valid during
> the client's callback. This meant if the client wanted to defer
> processing of the data a copy was necessary.
> 
> Now we pass an object to the callback and the pixel lifetime is tied
> to the lifetime of that object.
> 
> The object may be holding a GPU transfer buffer mapped. We don't assume
> that the object will be released on the direct GrContext thread. So
> when the object is destroyed it posts a message to a new type,
> GrClientMappedBufferManager, hanging off the direct context. The direct
> context will periodically check for messages and unmap and then unref
> buffers so that they can be reused. Currently this is done in
> GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> 
> The old API is kept around for backwards compatibility but it is
> reimplemented as a bridge on top of the new mechanism.
> 
> Also a utility function to SkImageInfo is added to directly make a new
> info with a specified dimensions rather than passing the width and
> height separately to makeWH().
> 
> Bug: chromium:973403
> Bug: skia:8962
> 
> Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ic14cf07a7629b167c9f34a651aa87a0326e74207
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973403, skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245721
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-02 22:51:15 +00:00
Brian Salomon
ce240cc6fd SkSurface asynchronous read APIs allow client to extend pixel lifetime
Previously the pixel data passed to the client was only valid during
the client's callback. This meant if the client wanted to defer
processing of the data a copy was necessary.

Now we pass an object to the callback and the pixel lifetime is tied
to the lifetime of that object.

The object may be holding a GPU transfer buffer mapped. We don't assume
that the object will be released on the direct GrContext thread. So
when the object is destroyed it posts a message to a new type,
GrClientMappedBufferManager, hanging off the direct context. The direct
context will periodically check for messages and unmap and then unref
buffers so that they can be reused. Currently this is done in
GrContext::performDeferredCleanup() and GrDrawingManager::flush().

The old API is kept around for backwards compatibility but it is
reimplemented as a bridge on top of the new mechanism.

Also a utility function to SkImageInfo is added to directly make a new
info with a specified dimensions rather than passing the width and
height separately to makeWH().

Bug: chromium:973403
Bug: skia:8962

Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-02 19:20:08 +00:00
Brian Salomon
4bc0c1fc4b Rename GrColorSpaceInfo -> GrColorInfo
Add version SkImageInfo::Make() that takes SkISize instead of separate
width and height.

Change-Id: I42aa79d23b19e22f5405631728c245b04bce0559
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245172
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-09-30 21:53:24 +00:00
Brian Osman
3fdfe28238 Simplify GPUSink constructors by just passing the config object
Also, remove the never-used gpu_threading flag. In limited
testing, it makes things slower.

Change-Id: I40ae0c8e5b79992c90845035a06536ed9d6626b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240202
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-09 18:12:18 +00:00
Brian Osman
ed58e004e0 Add support for pre-compiling cached SkSL shaders
The client can do a test run of their application with
a persistent cache set to SkSL mode. They store the key
and data blobs that are produced.

Ship those blobs with the application. At startup, call
GrContext::precompileShader for each key/data pair. This
compiles the shaders, and stores the GL program ID, plus
a small amount of metadata in our runtime program cache.

Caveats:
* Currently only implemented for the GL backend. Other
  backends will require more metadata to do any useful
  amount of work. Metal may need a more drastic workflow
  change, involving offline compilation of the shaders.
* Currently only implemented for cached SkSL (not GLSL
  or program binaries). Supporting other formats again
  requires more metadata, and the cached shaders become
  increasingly specialized to GPU and driver versions.
* Reusing the cached SkSL on different hardware is not
  supported. Many driver workarounds are implemented in
  the SkSL -> GLSL transformation, but some are higher
  level. Limiting device variance by artificially hiding
  extensions may help, but there are no guarantees.

* The 'gltestprecompile' DM config exercises this code
  similarly to 'gltestpersistentcache', ensuring that
  results are visually identical when precompiling, and
  that no cache misses occur after precompiling.

Change-Id: Id314c5d5f5a58fe503a0505a613bd4a540cc3589
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239438
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-06 19:45:09 +00:00
Brian Osman
a66081d943 Move SkSL caching out of GR_TEST_UTILS, trim persistent cache options
Combines the two boolean options into a single tri-state enum. Old GLSL
option is still present (temporarily) until Chrome is switched over.

Also add a type tag for cached program binaries, so we can safely
detect cache entries of the wrong type.

Change-Id: I0ddeefa9180b27bc2c46e2e7b77e6c9cdf4a730a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238856
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-03 20:18:48 +00:00
Hal Canary
edda5653e1 gm: GMFactory returns a unique_ptr<>
Change-Id: If8a4d3cfdeaef58dd9924af430cfed834519b096
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232496
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-08-12 19:02:40 +00:00
Robert Phillips
da2e67a357 Add GrProtected parameter to all createBackendTexture variants
Change-Id: I667bc730e321b579bef98f3d6003f7a7b29c9890
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224957
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-01 19:46:18 +00:00
Brian Osman
9c310473c6 Reland "DM: Add a per-sink MemoryCache to all GPU sinks"
Once https://skia-review.googlesource.com/c/skia/+/224258 lands, this
should be safe.

This reverts commit 1958fbbcff.

Change-Id: I2fca1e60a2d945d440b7cd5f60e4b4dec211decd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224278
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-28 16:30:24 +00:00
Brian Osman
e4c88bb1f8 Prevent caching path-rendering programs
As described in the comments, this is a workaround for a rare situation
when trying to use cached program binaries in conjunction with ANGLE and
path rendering.

Change-Id: Ief5bb0042f5ec13cbea2242ff9c4f0b9f9e65641
Bug: angle:3619
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224258
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-28 16:25:54 +00:00
Brian Osman
1958fbbcff Revert "DM: Add a per-sink MemoryCache to all GPU sinks"
This reverts commit a7b224d3a3.

Reason for revert: Failures on some ANGLE bots

Original change's description:
> DM: Add a per-sink MemoryCache to all GPU sinks
> 
> This isolates the caches per config, so we don't try to reuse cached
> binaries across different GL versions (or different D3D backend versions
> on ANGLE bots, etc).
> 
> Locally, this sped up ANGLE significantly Looking at a sample bot
> (NUC6i5SYK), it dropped DM from 36m to 31m.
> 
> Change-Id: I95db18c6ea85041e6adbc972f0118233c82818fb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223985
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: I8c9af65d89fddb28e5f1395a6c946312f27ba48a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224186
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-27 14:39:09 +00:00
Brian Osman
a7b224d3a3 DM: Add a per-sink MemoryCache to all GPU sinks
This isolates the caches per config, so we don't try to reuse cached
binaries across different GL versions (or different D3D backend versions
on ANGLE bots, etc).

Locally, this sped up ANGLE significantly Looking at a sample bot
(NUC6i5SYK), it dropped DM from 36m to 31m.

Change-Id: I95db18c6ea85041e6adbc972f0118233c82818fb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223985
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-27 13:21:13 +00:00
Chris Dalton
b3c9745911 Remove "nvpr" configs
The majority of our gm testing has been disabling nvpr, which doesn't
match our real-world behavior where we use nvpr whenever available.
This CL fixes the issue by completely removing the explicit nvpr
configs. Now if we have nvpr, you get it.

This CL also lowers the nvpr priority in the path renderer chain and
adds a "NonNVPR" job on Quadro where we can continue to test our
non-nvpr codepaths on NVIDIA.

Bug: skia:
Change-Id: I6a36f1101c8218adcaaf10cab25d2c28e70371f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223828
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-06-26 16:53:50 +00:00
Brian Osman
1c1208e6c3 Install runtime check error handler in RTC builds
From local testing, this does get invoked and supply a useful error
number to know which rule we broke. It doesn't have any useful location
information (linenumber is always 0, filename is always empty).

Change-Id: I297e5b1d4aac0ba00d9c231550df3ab29e983628
Bug: skia:9197
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223189
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-24 18:08:08 +00:00
Herb Derby
9c71e7be10 Remove all global mutexes
Remove the SkBaseMutex (and SkBaseSemaphore). This allows all the thread
annotation machinery to work.

Change-Id: I2da420ec3165ccbcd90c474c0b62bfef42df2a53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221340
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-18 00:39:15 +00:00
Robert Phillips
4bdd36f625 Make color initialization version of createBackendTexture public
Mechanical.

Change-Id: I48be78a12684fc5243ee509e391984daa190fb7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218182
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-04 20:12:22 +00:00
Robert Phillips
806267973f Switch all internel uses of GrContext::createBackendTexture over to initialized versions
For Skia's testing we always want an initialized backend texture. Except for the
BackendAllocationTests of course.

Change-Id: I47b5e4c9845b3f58ebad5ba052780a69d6cd6954
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216348
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-04 14:42:27 +00:00
Jim Van Verth
8a9a371182 Reland "Added AutoreleasePool for managing pool memory in testing apps."
This is a reland of a36e089065

This is only active when Metal is enabled.

Original change's description:
> Added AutoreleasePool for managing pool memory in testing apps.
>
> This is only active on MacOS and iOS -- on other platforms it
> will do nothing as they have no need for autorelease pools.
>
> Bug: skia:8243
> Change-Id: Ib74968dab6e3455a72e726429832101d0d410076
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217126
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: skia:8243
Change-Id: I743a3dcc93b46387a6a330e855c2e8810b482544
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217379
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-05-31 15:40:01 +00:00
Kevin Lubick
c4fec06e5a Revert "Added AutoreleasePool for managing pool memory in testing apps."
This reverts commit a36e089065.

Reason for revert: Primary suspect in breaking G3

Original change's description:
> Added AutoreleasePool for managing pool memory in testing apps.
> 
> This is only active on MacOS and iOS -- on other platforms it
> will do nothing as they have no need for autorelease pools.
> 
> Bug: skia:8243
> Change-Id: Ib74968dab6e3455a72e726429832101d0d410076
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217126
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,brianosman@google.com

Change-Id: I64f6e0baba21a9d35682ab53bdf418180be8579b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8243
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217377
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-05-31 12:31:14 +00:00
Jim Van Verth
a36e089065 Added AutoreleasePool for managing pool memory in testing apps.
This is only active on MacOS and iOS -- on other platforms it
will do nothing as they have no need for autorelease pools.

Bug: skia:8243
Change-Id: Ib74968dab6e3455a72e726429832101d0d410076
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217126
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-05-30 19:13:34 +00:00
Hal Canary
be67a17c77 add SkNamedTransferFn::kRec2020
Change-Id: I674ab82845f5e6db56412d36e2d146d1208032af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215824
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-05-24 16:03:03 +00:00
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
Robert Phillips
5c7a25bd2f Move explicit backend object allocation API to GrContext
This initial portion of the API should be ready to go. Follow on CLs will add the other entry points.

Change-Id: Ia9c708046ba08b16f9a71558e2bf2c38279abe5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-20 15:31:56 +00:00
Robert Phillips
9b16f81858 Switch over to using new direct allocation API in our tests (as much as possible at least)
To fully switch over we need the entry point that uploads data but most of the old call
sites can be switched over now.

Change-Id: I362b1dfde7d88bf8d3f8f90155f53d9ac442a329
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214300
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-17 15:41:50 +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
Robert Phillips
9dbcdcc8ba Alter createTestingOnlyBackendTexture methods
This intended to bring this API more into line with the proposed GrBackendObject API with an eye towards replacing the former with the latter.

TBR=bsalomon@google.com
Change-Id: I4367f03fb10fff788749f21c4843060111a6df1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213220
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-13 15:39:33 +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
Brian Osman
ea236bf818 Move skcms.h to include/third_party/skcms
Add a shim to redirect until clients are updated

Change-Id: Ib43614e5620b1a24ca18187c1646a8ed1a9ee7a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211003
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-29 15:02:45 +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
Brian Osman
c3186302bd Add skcms directory to public includes
skcms is part of Skia's public API now. This attempts to recognize that,
and pave the way for moving the header to another location more easily
in a follow up CL, or - at a minimum - for clients that redistribute
Skia as a library + includes to relocate the skcms.h header as part of
that.

Change-Id: I15da63b0d4ab8916a71fb7e6ab3656db87252707
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209640
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-22 20:32:23 +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
Brian Osman
fbe2406693 Reland "Remove the NullGL interface (and associated test context)"
This reverts commit 215da624d1.

Reason for revert: Blink issues ironed out.

Original change's description:
> Revert "Remove the NullGL interface (and associated test context)"
> 
> This reverts commit de206c75c2.
> 
> Reason for revert: Chrome is having issues with the switch to Mock in blink tests.
> 
> Original change's description:
> > Remove the NullGL interface (and associated test context)
> > 
> > Bug: skia:
> > Change-Id: Ie3c9ee39fc1e0a4406de085c60d8433ffb4419df
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203708
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com
> 
> Change-Id: Iff0cbf29dcea26957efc800a8c33d0ad8285de0a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205343
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:
Change-Id: I1f4fbbcb00f302c5d830cb1392badd6ec7a33c69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205832
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-03 16:38:10 +00:00
Mike Klein
16b1efb871 allow GMs to fail in DM
And mark atlastext as GPU-only, so it's skipped instead
of running and failing on non-GPU --configs.

Change-Id: I9b41873bed14e20f2e086a04f57b247994e9266e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205347
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-04-02 17:46:26 +00:00
Brian Osman
215da624d1 Revert "Remove the NullGL interface (and associated test context)"
This reverts commit de206c75c2.

Reason for revert: Chrome is having issues with the switch to Mock in blink tests.

Original change's description:
> Remove the NullGL interface (and associated test context)
> 
> Bug: skia:
> Change-Id: Ie3c9ee39fc1e0a4406de085c60d8433ffb4419df
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203708
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com

Change-Id: Iff0cbf29dcea26957efc800a8c33d0ad8285de0a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205343
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-02 12:48:37 +00:00
Brian Osman
de206c75c2 Remove the NullGL interface (and associated test context)
Bug: skia:
Change-Id: Ie3c9ee39fc1e0a4406de085c60d8433ffb4419df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203708
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-01 14:56:23 +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
Brian Osman
7c59774d4f Convert some unit tests from NullGL to Mock context
Bug: skia:
Change-Id: I6ecfed3f7ee096f85ea4cb4920e1029227d36169
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203703
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-26 15:43:23 +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
8f4e224541 de-Sk tools/debugger
Change-Id: I489a54860139d1820471aa0330b29a8ae9eca31e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202316
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:27:01 +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
Robert Phillips
9882dae24d Reduce usage of SkCanvas::flush
SkCanvas::flush is problematic and we wish to deprecate it. As a first step, this CL begins to remove Skia's internal usage of it.

Ideally clients would use SkSurface::flush and/or GrContext::flush.

Change-Id: I39bb0702f8230134a97961a4ee70833fd5bd0dcc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196641
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-03-04 22:09:39 +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
Brian Salomon
7d88f310a9 Remove support for SkDeferredDisplayListRecorder::DelayReleaseCallback::kNo.
Bug: skia:8800
Change-Id: I39d1ac62ab9a0d4f987c23de96c644aa9b2fa70e
Reviewed-on: https://skia-review.googlesource.com/c/196161
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-28 19:02:20 +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
Florin Malita
562017b086 [SVGCanvas] Clean up public factories
Remove the internal-only/XMLWriter-based factory.

Update SkSVGDevice to always own the xml writer.

The only internal client passing an interesting XMLWriter is
SVGDeviceTest - update to use the device factory directly.

While at it, update the SkSVGDevice factory to return smart pointers
(Create -> Make).

Change-Id: Ibda1ca86ef9fb81ab512822000835ace1af67978
Reviewed-on: https://skia-review.googlesource.com/c/192580
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-14 19:17:35 +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
Chris Dalton
50e24d7d5f Add a mechanism for GMs to silently exclude themselves from Gold
This is useful, for example, when trying to test a hardware feature
that isn't supported in the current context.

Bug: skia:8731
Change-Id: I9a363159300c92e4039bfd05400238c27002efb1
Reviewed-on: https://skia-review.googlesource.com/c/189133
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-08 00:05:15 +00:00
Robert Phillips
9da87e0e98 Rename GrContext::contextPriv to priv
Mechanical. This makes the priv() accessor the same for all the context types.

Change-Id: I40850eb05a33b8d7cc3eabdd42226d24b2ba58aa
Reviewed-on: https://skia-review.googlesource.com/c/189164
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-04 22:13:14 +00:00
Brian Salomon
f55e8d5232 Add option to skip intermediate release/fulfill calls for promise images.
SkiaRenderer does not delete promise image textures when they are released
but not done. Refulfilling promise image textures takes a significant amount
of CPU time. This allows us to fulfill each promise image once.

Bug: skia:8736
Change-Id: I7ad7fa9678ed0ec4bb714b71fbf920ab4a845409
Reviewed-on: https://skia-review.googlesource.com/c/188039
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-31 16:24:52 +00:00
Brian Osman
d8a90f9be1 Converting more debug code to SkJSONWriter
All of SkDrawCommand / SkDebugCanvas now uses SkJSONWriter.
Also removed the bespoke json generator and pretty-printer
in GrAuditTrail. This was the largest volume of code still
using JsonCPP. (There are other stragglers).

Bug: skia:
Change-Id: I3aee554764689ce50c8e707caf26c76093b9bb8f
Reviewed-on: https://skia-review.googlesource.com/c/187040
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-28 19:06:06 +00:00
Brian Osman
fad5c773f7 Convert DM's -r JSON parsing to SkJSON
Bug: skia:
Change-Id: I987f527dbd742453422073f8e2b28d824f8a62eb
Reviewed-on: https://skia-review.googlesource.com/c/186879
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-25 22:35:45 +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
Brian Osman
aae638807c Switch DM JSON output to use SkJSONWriter
Bug: skia:
Change-Id: I3ceccd050a294260da54ff8a01a4837eb0cfb369
Reviewed-on: https://skia-review.googlesource.com/c/186866
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-01-25 15:39:13 +00:00
Hal Canary
3026d4b1b8 SkDocument: use auto for MakeDocument().
A later CL will make this return a unique_ptr<SkDocument>.

Bug: skia:5972
Change-Id: Ie10d6c07d5f2524ecb71d906db0d37427827225d
Reviewed-on: https://skia-review.googlesource.com/c/181660
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-01-17 19:16:28 +00:00
Brian Salomon
1bf0ed8584 Make GrTexture caching for SkPromiseImageTexture work when same texture
fulfills a different SkImage.

Bug: skia:8613
Change-Id: I7ee14112c69f8aaef223a37dda455259b501a2bf
Reviewed-on: https://skia-review.googlesource.com/c/184440
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-16 22:06:53 +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
Hal Canary
72b91cbcc0 DM: distinguish between reading and parsing in error messages
Change-Id: Ia79101dfc874f767d72014666943724e05ee8483
Reviewed-on: https://skia-review.googlesource.com/c/183803
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2019-01-14 18:28:03 +00:00
Brian Salomon
cdd8a0a0e8 Revert "Revert "Reuse GrTexture instances when the same GrBackendTexture is used to""
This reverts commit 426ba463d5.

Bug: skia:8613
Change-Id: Iacaf40549369110aa95015e8d4579ec41db22d13
Reviewed-on: https://skia-review.googlesource.com/c/182963
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-10 17:51:21 +00:00
Brian Salomon
426ba463d5 Revert "Reuse GrTexture instances when the same GrBackendTexture is used to"
This reverts commit 559c617137.

Reason for revert: breaking things

Original change's description:
> Reuse GrTexture instances when the same GrBackendTexture is used to
> repeatedly fulfill a promise SkImage.
> 
> Bug: skia:8613
> 
> Change-Id: I35c76435d630d2daa034e0c3efb59666bfd6882a
> Reviewed-on: https://skia-review.googlesource.com/c/175820
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I7548809945d0a875fdb9387398bbc45e733c0846
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8613
Reviewed-on: https://skia-review.googlesource.com/c/182960
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-10 16:33:11 +00:00
Brian Salomon
559c617137 Reuse GrTexture instances when the same GrBackendTexture is used to
repeatedly fulfill a promise SkImage.

Bug: skia:8613

Change-Id: I35c76435d630d2daa034e0c3efb59666bfd6882a
Reviewed-on: https://skia-review.googlesource.com/c/175820
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-10 16:10:59 +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
Greg Daniel
a870b46c79 Add ability to write out VkPipelineCache to gpu PersistentCache.
Bug: skia:
Change-Id: Id13d680401f69a074ae0c85f9ceaf3308fccb129
Reviewed-on: https://skia-review.googlesource.com/c/181403
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2019-01-08 21:18:51 +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
Brian Osman
a9549ab316 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>
2019-01-04 14:32:06 +00:00
Brian Salomon
8d23a584fc In ddl2 via clear to transparent between runs.
Change-Id: I0cc904a76b30212a66b1cc00abdf2fff7686acc4
Reviewed-on: https://skia-review.googlesource.com/c/179240
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-12-19 17:46:44 +00:00
Hal Canary
f34131ae9b SkPDF: even more PDFIndirectRefs
* SkPDFUnion.h hidden.
  * SkPDFObjectSerializer::serializeObject gone.
  * SkPDFDocument::serialize gone
  * SkPDFMetadata::MakeXMPObject return PDFIndirectRef
  * SkPDFTag rewritten from scratch.
  * SkPDFObject::addResources virtual gone.
  * SkPDFObject::drop virtual gone.
  * SkPDFArray::appendObjRef gone.
  * SkPDFDict::insertObjRef gone.
  * SkPDFDict::Record becomes std::pair
  * SkPDFObjNumMap gone;
  * SkPDFObject::fIndirectReference gone;

Bug: skia:8630
Change-Id: I7425eef30548b54f10fbfe96dd502800cb150caf
Reviewed-on: https://skia-review.googlesource.com/c/178935
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-12-19 03:20:42 +00:00
Hal Canary
9a3f554154 SkPDF: refactor streams, experimental threading
All PDF Streams are immediatly serialized, and are never long-lived
    in memory.

    if EXPERIMENTAL fExecutor is set on the Document, streams are
    compressed in parallel.

    Results for PDFBigDocBench:

        without patch                    1807885.01 μs
        with    patch without executor   1802808.35 μs
        with    patch with    executor    246313.72 μs

    SkPDFStreamOut() function replaces SkPDFStream classes.

    Page resources are all serialized early.

    Several Document-level objects are serialzied early.

    SkUUID introduced as top-level object.

    Many {insert|append}ObjRef() converted to memory efficient
    {insert|append}Ref().

Bug: skia:8630
Change-Id: Ic336917d0c8b9ac1c2423b43bfe9b49a3533fbff
Reviewed-on: https://skia-review.googlesource.com/c/176588
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-12-18 20:48:25 +00:00
Brian Salomon
5790420ccc Add new DM via, "ddl2" which records/draws DDLs for each test twice.
Clears between the two DDL runs.

Also, fix up proxy unique key checks in GrSurfaceProxy.

Change-Id: I492e791ebc57a42063f3b828c10d8bf5fee70b1b
Reviewed-on: https://skia-review.googlesource.com/c/178262
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-12-17 20:22:15 +00:00
Brian Salomon
2335644771 Fix occurrences of "-Wextra-semi-stmt"
Docs-Preview: https://skia.org/?cl=173761
Change-Id: Iefdb91cd28eabb4b01b7b42a4f300b0b4caf05d9
Reviewed-on: https://skia-review.googlesource.com/c/173761
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-11-30 23:23:09 +00:00
Florin Malita
a8316554cb [skottie] Make animated image support generally available
Consolidate some helpers under skottie_utils, and update all related
tools to support animated images.

TBR=
Change-Id: If08e97143a11d9a414f3230a49ab4284c508b9d0
Reviewed-on: https://skia-review.googlesource.com/c/169342
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-11-10 19:52:19 +00:00
Mike Klein
b11ab578ad remove src/jumper
The distinction between SkJumper and SkRasterPipeline used
to be important, but it's no longer.  This CL moves everything
under src/jumper to the appropriate SkRasterPipeline file.

Change-Id: I1181fffafccb3dc4c4eb5f33b442c719ee370462
Reviewed-on: https://skia-review.googlesource.com/c/164627
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-24 11:15:58 +00:00
Mike Klein
36528e91c2 clean up SkPipe
One less SkCanvas subclass to deal with...

Change-Id: I21e81648026be5d732e8d9a28baed55015492a04
Reviewed-on: https://skia-review.googlesource.com/c/161584
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-12 16:50:21 +00:00
Greg Daniel
bdf12ad8d5 Move GrBackend enum to enum class.
Bug: skia:
Change-Id: I8add2470313549723be6720b543091c444d2eb4f
Reviewed-on: https://skia-review.googlesource.com/c/161680
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-12 14:01:58 +00:00
Mike Klein
d295dff5c6 remove SkColorSpaceTransferFn::invert()
Looks like DM may be its only user?
That was me and just for convenience... I can fold it through.

Change-Id: I4ed6ee659df4192e3d6db7ce5b055c4c923673bd
Reviewed-on: https://skia-review.googlesource.com/c/159761
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-04 20:33:20 +00:00
Mike Klein
4429a4f82c re-precate SkMatrix44::SkMatrix44()
It's been driving me nuts that I can't just write `SkMatrix44 m;`,
and I often don't care whether it's initialized or not.  The default
identity constructor would be nice to use, but it's deprecated.

By tagging this constructor deprecated, we're only hurting ourselves;
our big clients disable warnings about deprecated routines and use it
freely.

A quick tally in Skia shows we mostly use the uninitialized constructor,
but sometimes the identity constructor, and there is a spread of all
three in Chromium.  So I've left the two explicit calls available.

I switched a bunch of calls in Skia to use the less verbose constructor
where it was clear that it didn't matter if the matrix was initialized.
Literally zero of the kUninitialized constructor calls looked important
for performance, so the only place I've kept is its lone unit test.

A few places read clearer with an explicit "identity" to read.

Change-Id: I0573cb6201f5a36f3b43070fb111f7d9af92736f
Reviewed-on: https://skia-review.googlesource.com/c/159480
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-04 14:01:11 +00:00
Mike Klein
21ba77273d remove DM timestamps
The bot logs record and display their own now,
and they're slightly nicer (color coded!).

Change-Id: I4626f62ed0a12bbd0dd837bcc83d7809e4ae347d
Reviewed-on: https://skia-review.googlesource.com/158663
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-02 14:49:23 +00:00
Michael Ludwig
e8e1075a9e Add input/output image logging to processor tests
Moves SkBitmap to base64 uri code into test utils

Bug: skia:
Change-Id: I4f92761fd2e643c38ed00a200b1cb62778a85948
Reviewed-on: https://skia-review.googlesource.com/158340
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-10-01 18:30:06 +00:00
Chris Dalton
184c37e61a Add a "bisect" mode to dm for debugging path drawing
Bug: skia:
Change-Id: Idc841545dfe3d33f43c1c8a3cf23199c322f7b11
Reviewed-on: https://skia-review.googlesource.com/156929
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-09-28 17:45:59 +00:00
Brian Osman
87311c6e56 Remove SkPM4fPriv.h includes, then IWYU
Bug: skia:
Change-Id: Ie59aace6ba7ca3685d481fcb3af508629c56f0c3
Reviewed-on: https://skia-review.googlesource.com/157742
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>
2018-09-28 15:17:04 +00:00
Brian Osman
5ea41fc89b Remove more SkColorSpaceXform (and friends)
- gammaencodedpremul GM was just demonstrating something that we
  understand well (and have much better testing for).
- readpixels GM was filled with workarounds for things that are no
  longer true (unpremul images, clamped F16).
- Other uses can be switched to SkConvertPixels trivially.
- Remove SkColorSpaceXformPriv and SkColorLookUpTable, all unused.
- Remove SkColorSpaceXform_skcms.cpp, no longer referenced by clients.

Bug: skia:
Change-Id: I7298bb53aa61b49ad1398ebc504d35c119fd5cf4
Reviewed-on: https://skia-review.googlesource.com/157153
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-26 22:30:05 +00:00
Hal Canary
23564b9249 SkDocument: Factories now located in SkPDFDocument.h and SkXPSDocument.h
Change-Id: I48e73b27e52511292c2c0bd51ef0168766f53a80
Reviewed-on: https://skia-review.googlesource.com/152780
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-09-20 18:21:07 +00:00
Brian Osman
133823d9a7 Load SVGs into memory before parsing
On my Z840, Windows-Clang-Debug, this cuts the total time to construct
(parse) the 72 SVG sources from 66 seconds to 40 seconds. That's still
awful, but all the time is now spent in expat, so further improvements
will require higher level changes.

Bug: skia:
Change-Id: I0dca67ee18652f6fb8647fe8706716d9a01f7cdf
Reviewed-on: https://skia-review.googlesource.com/155603
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>
2018-09-19 18:35:59 +00:00
Hal Canary
8a00144035 test,tools: whitespace changes for clang-format
Change-Id: I67529f6c0ac26da603f60af22c620f8f603d8a19
Reviewed-on: https://skia-review.googlesource.com/155564
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2018-09-19 17:50:51 +00:00
Mike Klein
ae4b1f484c encode F16/F32 .pngs as Rec2020
This lets us see more of the range of configs like esrgb.

Change-Id: Id8fe3d6d7545b139d905e4a0e587228c85159043
Reviewed-on: https://skia-review.googlesource.com/154380
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-13 15:43:02 +00:00
Cary Clark
a24712e4dc Revert "makeSurface defaults to raster"
This reverts commit 29a4a684af.

Reason for revert: some configs fail

Original change's description:
> makeSurface defaults to raster
> 
> Rather that returning nullptr for a recording
> canvas, return a raster canvas instead.
> 
> R=​reed@google.com,robertphillips@google.com
> 
> Bug: skia:
> Change-Id: I211d8ef368b9aec6d14cc72d1652ac6a03f3fa7b
> Reviewed-on: https://skia-review.googlesource.com/151666
> Commit-Queue: Cary Clark <caryclark@skia.org>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,reed@google.com,caryclark@skia.org

Change-Id: I82d2c3e4589a2ca8523bbf86884ed68b1431631d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/151824
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-09-05 18:41:45 +00:00
Cary Clark
29a4a684af makeSurface defaults to raster
Rather that returning nullptr for a recording
canvas, return a raster canvas instead.

R=reed@google.com,robertphillips@google.com

Bug: skia:
Change-Id: I211d8ef368b9aec6d14cc72d1652ac6a03f3fa7b
Reviewed-on: https://skia-review.googlesource.com/151666
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-09-05 17:36:49 +00:00
Brian Osman
cca8c6fa47 SkColorSpace cleanup
Remove SkColorSpace_XYZ, no need for an interface with one
implementation.

Change-Id: I47a23293334b5e02a6e5af8356b3df0262f86d5a
Reviewed-on: https://skia-review.googlesource.com/150138
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-04 15:48:02 +00:00
Leon Scroggins III
d6832d047c Remove some references to defunct kIndex_8
Bug: skia:6828
Bug: skia:3338
Bug: skia:3339

The comment for five_reference_pixels seems to suggest removing
the default case, but we already have new SkColorTypes, leaving
the default seems like the right approach for now.

Remove premultiply_if_necessary. We can now draw unpremultiplied
bitmaps, so it's never necessary.

Remove a TODO related to kIndex8

Change-Id: Iafdab22bb6453e4b5bba7278b12d27788cc7d037
Reviewed-on: https://skia-review.googlesource.com/151362
Commit-Queue: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-04 15:32:34 +00:00
Kevin Lubick
c5fe15dd4d Correct LottieWeb drawing params
The tiles are now centered in a 200 x 200 box.
Additionally, the frames drawn should now
match how the seeking happens (before, we would
try to draw frame *index* 300 when there were only
300 frames)

I renamed a variable in DmSrcSink because it initially
confused me as the purpose of it.

Bug: skia:
Change-Id: I8552a24727326cd8714dfd1c7794a0c4b0a418cb
Reviewed-on: https://skia-review.googlesource.com/150126
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2018-08-29 14:24:04 +00:00
Brian Osman
6b622963a0 Reland "Stop conflating F16 with linear gamma"
This reverts commit 5f7b5e3624.

Reason for revert: Codec CL has re-landed.

Original change's description:
> Revert "Stop conflating F16 with linear gamma"
> 
> This reverts commit d1589c7213.
> 
> Reason for revert: Depends on skcms CL that's been reverted.
> 
> Original change's description:
> > Stop conflating F16 with linear gamma
> > 
> > Note to self: I debugged this, realized that the codecs
> > need to handle A2B -> XYZ, then realized that I just need
> > to wait for https://skia-review.googlesource.com/c/skia/+/136062
> > 
> > Bug: skia:
> > Change-Id: I594c22076feb3700b8a40c471a541fef5ff4e13e
> > Reviewed-on: https://skia-review.googlesource.com/137587
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > Reviewed-by: Mike Klein <mtklein@google.com>
> 
> TBR=mtklein@google.com,brianosman@google.com
> 
> Change-Id: I6dca583697c8efd2563d30cb7ab9ef505b6903ae
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/148860
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:
Change-Id: Iee66531049843758e7ed4130b99d8df6a553d805
Reviewed-on: https://skia-review.googlesource.com/149700
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-08-28 14:23:27 +00:00
Brian Osman
5f7b5e3624 Revert "Stop conflating F16 with linear gamma"
This reverts commit d1589c7213.

Reason for revert: Depends on skcms CL that's been reverted.

Original change's description:
> Stop conflating F16 with linear gamma
> 
> Note to self: I debugged this, realized that the codecs
> need to handle A2B -> XYZ, then realized that I just need
> to wait for https://skia-review.googlesource.com/c/skia/+/136062
> 
> Bug: skia:
> Change-Id: I594c22076feb3700b8a40c471a541fef5ff4e13e
> Reviewed-on: https://skia-review.googlesource.com/137587
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: I6dca583697c8efd2563d30cb7ab9ef505b6903ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/148860
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-08-23 01:57:13 +00:00
Brian Osman
d1589c7213 Stop conflating F16 with linear gamma
Note to self: I debugged this, realized that the codecs
need to handle A2B -> XYZ, then realized that I just need
to wait for https://skia-review.googlesource.com/c/skia/+/136062

Bug: skia:
Change-Id: I594c22076feb3700b8a40c471a541fef5ff4e13e
Reviewed-on: https://skia-review.googlesource.com/137587
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-08-22 19:54:57 +00:00
Nigel Tao
66bc524d34 Rename SkCodec::kNone to SkCodec::kNoFrame
Add a SK_LEGACY_SKCODEC_NONE_ENUM #define'able to ease transition.

Also rename another internal "kNone" enum in SkWebpCodec.cpp.

The "kNone" name is overloaded:
- include/core/SkImageGenerator.h defines its own kNone.
- include/encode/SkPngEncoder.h defines its own kNone.
- include/private/GrTypesPriv.h defines multiple kNone's.

Bug: skia:
Change-Id: I18c03a74f2f1b0237016e0eef53dcd4478b82609
Reviewed-on: https://skia-review.googlesource.com/146020
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-08-22 14:49:56 +00:00
Mike Klein
ff6a73cc08 add rec2020 configs to DM
Change-Id: Ibbfb69610e8821ff3a7f0c01875c34132ee4d718
Reviewed-on: https://skia-review.googlesource.com/147962
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-08-17 20:46:12 +00:00
Mike Klein
4de0507235 add p3 and ep3 configs to DM
Change-Id: I90ef93b34149750316f4053a65a324894218b984
Reviewed-on: https://skia-review.googlesource.com/147423
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-08-16 18:35:12 +00:00
Brian Osman
2d010b66a6 Remove old sRGB config support from backend render target tool utilities
Bug: skia:
Change-Id: Ie88c16ddb2b072d8bdd7efc3acabc1d9ad89012f
Reviewed-on: https://skia-review.googlesource.com/146526
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-08-09 15:27:24 +00:00
Brian Osman
e581aaad4d Remove picture_utils
More pointless hoop-jumping

Change-Id: I0123e0a1e27140a82ffe08ad88e0d115c060436d
Reviewed-on: https://skia-review.googlesource.com/146449
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>
2018-08-09 14:14:17 +00:00
Mike Reed
5edcd31f2c migrating SkTDArray towards std::vector api
fix for https://skia-review.googlesource.com/c/skia/+/146140

Change from original was to include <initializer_list>

Bug: skia:
Change-Id: Ie36426fcf7ce778a95e2b656ce80a9a394a8307c
Reviewed-on: https://skia-review.googlesource.com/146160
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-08-08 15:51:44 +00:00
Mike Reed
f9ecb4e67e Revert "migrating SkTDArray towards std::vector api"
This reverts commit 79884be809.

Reason for revert: broke flutter build -- initializer_list?

Original change's description:
> migrating SkTDArray towards std::vector api
> 
> push -> push_back
> add some aliases to match std::vector: count, reserve, ...
> 
> Bug: skia:
> Change-Id: I1921c31d0d6e5ed3d622a0def6054c697be2d02f
> Reviewed-on: https://skia-review.googlesource.com/145884
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com

Change-Id: Ib6132b725aaed7c01287e3e8c2b5a14da3d3d7e9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/146140
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-08-08 15:14:37 +00:00
Mike Reed
79884be809 migrating SkTDArray towards std::vector api
push -> push_back
add some aliases to match std::vector: count, reserve, ...

Bug: skia:
Change-Id: I1921c31d0d6e5ed3d622a0def6054c697be2d02f
Reviewed-on: https://skia-review.googlesource.com/145884
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-08-08 14:43:28 +00:00
Hal Canary
f4abda5877 Revert "Test: New GMs should be nicely named"
This reverts commit 73ec9a09f3.

Reason for revert:
  broke Test-Win7-Clang-Golo-CPU-AVX-x86_64-Debug-All-NativeFonts
    ERROR: 'fontmgr_bounds_1_-0.25Win7' is a bad name.
    ERROR: 'fontmgr_bounds_0.75_0Win7' is a bad name.


Original change's description:
> Test: New GMs should be nicely named
> 
> Motivation:
> 
>     An issue came up a while back with SkQP where some the JUnit testing
>     framework dislikes test names that aren't valid Java identifiers.  I am
>     currently replacing invalid characters with underscores before giving
>     them to JUnit, but that leads to some confusion when trying to grep for
>     the name of a failing test.
> 
>     I propose that going forward, all *new* Skia unit tests and GM names be
>     in the form [A-Za-z][A-Za-z0-9_]* to prevent this sort of confusion.  We
>     won't change 63 existing "bad" tests names.
> 
> This Cl encorces that rule with an assertion in DM.
> 
> Change-Id: Icedce023cd3127d499fbcdcaea485f1ec9e9196b
> Reviewed-on: https://skia-review.googlesource.com/145365
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

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

Change-Id: I28c619ca767dac221a73594c9e7be412ba2c242c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/145560
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-08-06 19:29:55 +00:00
Hal Canary
73ec9a09f3 Test: New GMs should be nicely named
Motivation:

    An issue came up a while back with SkQP where some the JUnit testing
    framework dislikes test names that aren't valid Java identifiers.  I am
    currently replacing invalid characters with underscores before giving
    them to JUnit, but that leads to some confusion when trying to grep for
    the name of a failing test.

    I propose that going forward, all *new* Skia unit tests and GM names be
    in the form [A-Za-z][A-Za-z0-9_]* to prevent this sort of confusion.  We
    won't change 63 existing "bad" tests names.

This Cl encorces that rule with an assertion in DM.

Change-Id: Icedce023cd3127d499fbcdcaea485f1ec9e9196b
Reviewed-on: https://skia-review.googlesource.com/145365
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-08-06 19:17:24 +00:00
Hal Canary
972eba3c5c sk_tool::Registry: make an iterator.
Change-Id: Icf4e31b50bbd91b7ea330a1300f736d6dfd0a41c
Reviewed-on: https://skia-review.googlesource.com/144500
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2018-08-01 16:59:19 +00:00
Florin Malita
9f7d4cd62a [skottie] Parse animations on the fly in SkottieSrc::draw
This allows DM to use the same source in multiple threads.

Change-Id: Ia0d7c4c673a92ccddab263a67f01afaa2d68b606
Reviewed-on: https://skia-review.googlesource.com/144420
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-30 20:21:21 +00:00
Mike Klein
48b649060c remove SkThreadedBMPDevice and friends
It is unused, is becoming a maintainence burden and source of bugs,
and takes up a lot of time on the *SAN bots.

Change-Id: If383eb6e4838ca23140f9e16d518b1bfc655fa12
Reviewed-on: https://skia-review.googlesource.com/143307
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-07-25 18:17:26 +00:00
Brian Osman
a76b7a9ded More color space improvements to DM
Added P3 configs (tagged surface and SkColorSpaceXformCanvas)

Added logic to tag the output PNGs when using a xform canvas,
so the images look correct in Chrome (and work correctly with
skdiff).

We don't use the gamma_correct tag for much in gold, but only
set it for outputs with a linear transfer function.

Change-Id: Iee713682e5010b0bd3212538a6dcb201ae4e8592
Reviewed-on: https://skia-review.googlesource.com/142170
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-07-19 21:04:56 +00:00
Florin Malita
f1ba3ae6f7 [skottie] Update DM src name to "lottie"
Change-Id: I82ec9cace172ed254b7325ff315ac82f2ae30a35
Reviewed-on: https://skia-review.googlesource.com/142581
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-19 19:43:25 +00:00
Eric Boren
8c172ba397 [infra] Add infra support for Lottie
Bug: skia:8136
Change-Id: I18c4ad549c52346ebfe23d172597d5da205e5c4d
Reviewed-on: https://skia-review.googlesource.com/142105
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
2018-07-19 17:53:25 +00:00
Timothy Liang
760dbc4b53 Reland "implemented metal gpu backend texture upload testing"
This reverts commit a80a012456.

Reason for revert: Fix bot failure.

Original change's description:
> Revert "implemented metal gpu backend texture upload testing"
>
> This reverts commit 36848f6b30.
>
> Reason for revert: Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR failing.
>
> Original change's description:
> > implemented metal gpu backend texture upload testing
> >
> > Bug: skia:
> > Change-Id: Ia3af58a0710f7f9792b37682a3cc45dd14282b71
> > Reviewed-on: https://skia-review.googlesource.com/140248
> > Commit-Queue: Timothy Liang <timliang@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,ethannicholas@google.com,timliang@google.com
>
> Change-Id: Idf40fc78b82aec1efbcc64221b6d2bbf63353960
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/141182
> Reviewed-by: Timothy Liang <timliang@google.com>
> Commit-Queue: Timothy Liang <timliang@google.com>

Bug: skia:
Change-Id: Ib8c5b2e0cf9de25c11c14741a32846bcc874d712
Reviewed-on: https://skia-review.googlesource.com/141183
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Timothy Liang <timliang@google.com>
2018-07-18 18:17:32 +00:00
Brian Salomon
7fc52996c6 Test GrContextOptions persistent cache on linux/quadrop400 bots.
Change-Id: I181ed6d294774a9c6886fde8252bfdde99adc572
Reviewed-on: https://skia-review.googlesource.com/140982
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-07-16 19:09:19 +00:00