Commit Graph

3612 Commits

Author SHA1 Message Date
Robert Phillips
6ba8c83234 Fix yuv_to_rgb_effect GM
This bug was introduced in https://skia-review.googlesource.com/c/skia/+/160162 (Make GrYUVtoRGBEffect more flexible)

I don't know why I wasn't seeing this locally!

Change-Id: Ic4d9b88b70c6d691d1e30d5ee0dc592a00b9b4e7
Reviewed-on: https://skia-review.googlesource.com/c/161044
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-10-10 16:19:25 +00:00
Robert Phillips
94ade75219 Make GrYUVtoRGBEffect more flexible
This makes GL & Vulkan render the wacky_yuv_formats GM correctly (transparency and all).

Bug: skia:7903
Change-Id: I09cf872beae3fd0fc1c5109b03ca1714ed51ae85
Reviewed-on: https://skia-review.googlesource.com/c/160162
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-10-10 13:57:57 +00:00
Brian Osman
00de965d0d Remove a bunch of unused files and functions
Bug: skia:
Change-Id: I1f05014a6ab955f324e4cde4f7b7aebe8f7d72a1
Reviewed-on: https://skia-review.googlesource.com/c/160385
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-08 18:55:27 +00:00
Mike Reed
2aa6475887 modify gm to avoid creating t-junctions between degernate curves and lines
Bug: skia:8453
Change-Id: Id9d4d2d02eb9db4d9af1832e506b3b39a507fe32
Reviewed-on: https://skia-review.googlesource.com/c/160460
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-08 18:05:21 +00:00
Robert Phillips
51c89e41c0 Exercise newly exposed SkYUVIndex-based SkImage factories (take 2)
Bug: skia:7903
Change-Id: Ie7d0135f392b67085a23a59cb469429f9e2b0221
Reviewed-on: https://skia-review.googlesource.com/c/160029
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-10-05 18:04:58 +00:00
Brian Osman
bd16a1bcb3 Revert "Exercise newly exposed SkYUVIndex-based SkImage factories"
This reverts commit e1c1d4d09c.

Reason for revert: Crashing on bots that abandon the GPU context

Original change's description:
> Exercise newly exposed SkYUVIndex-based SkImage factories
> 
> Bug: skia:7903
> Change-Id: I04630ebec37b087423e8305cc1716544fa00a403
> Reviewed-on: https://skia-review.googlesource.com/c/160020
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I5cd5eca3aa55feb73737643dbe05a374a6fd7842
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7903
Reviewed-on: https://skia-review.googlesource.com/c/160026
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-05 17:10:16 +00:00
Robert Phillips
e1c1d4d09c Exercise newly exposed SkYUVIndex-based SkImage factories
Bug: skia:7903
Change-Id: I04630ebec37b087423e8305cc1716544fa00a403
Reviewed-on: https://skia-review.googlesource.com/c/160020
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-10-05 16:18:50 +00:00
Robert Phillips
1c7062db88 Update YUV GM
Change-Id: I7b35dd063c19cacd0022840d17207cbf4bb03cc7
Reviewed-on: https://skia-review.googlesource.com/c/159063
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-10-04 15:12:25 +00:00
Brian Osman
f28e55d5a1 Add SkPMColor4f support to SkSL
Convert GrConstColorProcessor to store SkPMColor4f

Bug: skia:
Change-Id: I6c505856653a02e576ae11fca59dc307545437f7
Reviewed-on: https://skia-review.googlesource.com/c/159152
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-04 14:55:04 +00:00
Robert Phillips
66a9734934 Make SkYUVAIndex publicly accessible
Change-Id: I3da7c566cdf9256e57ac7e7f30fee18b9c1a144d
Reviewed-on: https://skia-review.googlesource.com/c/159460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-10-04 14:14:23 +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
Michael Ludwig
72535fb55a Reland "Reland "Implement an explicit binary search-based analytic gradient colorizer""
This is a reland of f065907ccc

3rd time's the charm:

The new analytic gradient shader was sporadically triggering violations of the coverage as alpha
compatibility optimization. Unfortunately, even when using the same device and random seed for the
test, the bots did not always reproduce the error. However, we identified the likely cause of the
violation.

The test requires that all output channels are less than the input alpha, which it uses to validate
whether or not the shader is modulating its values by the input alpha. This test does not pass if
the RGB values are greater than 1. The original version of the analytic gradient shader used half4s
for its scale and bias values. Given the threshold limit for hardstops of 0.00024 (SkNearlyZero),
a very small interval that is not treated as a hardstop can create a scale or bias of over 4000.
This moves into the very imprecise region of 16-bit floats, making it plausible that the gradient
outputs colors greater than 1, due to rounding. The kicker is that the random test generation for
stop locations does not use a uniform distribution, but is instead biased towards the remaining
interval, which increases the likelihood of generating a small interval that is not treated as a
hard stop. We are keeping this behavior since ill-conditioned gradients are useful in testing.

Original change's description:
> Reland "Implement an explicit binary search-based analytic gradient colorizer"
>
> This reverts commit 9461dcf130.
>
> Reason for revert: Fixes for ANGLE's incorrect shader behavior
>
> Original change's description:
> > Revert "Implement an explicit binary search-based analytic gradient colorizer"
> >
> > This reverts commit dcc85fc610.
> >
> > Reason for revert: ANGLE is frequently corrupted, particularly radial_gradient4 and mixershader
> >
> > Original change's description:
> > > Implement an explicit binary search-based analytic gradient colorizer
> > >
> > > Provides a reasonably flexible fragment processor that defines another
> > > colorizer implementation for gradients. It can support up to 8
> > > interpolation intervals (which is 16 colors if every stop is a hard stop
> > > or 9 colors if every stop is a smooth transition). It
> > > supports mixtures of hard and smooth stops. It is conditionally compiled
> > > into versions specific to the interval count (so it can produce up to
> > > 8 shader variants).
> > >
> > > The GrGradientShader controller does not remove the single and dual
> > > interval colorizers, which are useful specializations of this explicit
> > > binary search colorizer. Similarly, since it can only handle up to 8
> > > intervals, the texture colorizer is still used as a fallback.
> > >
> > > Currently it does not employ capabilities detection to determine if the
> > > hardware can support the number of required uniforms, which can become
> > > substantial for the larger gradient configurations.
> > >
> > > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > > Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
> > > Reviewed-on: https://skia-review.googlesource.com/155080
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> >
> > TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
> >
> > Change-Id: I351a387f0528e4c2db2d47ab2e5d6b336991fb98
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > Reviewed-on: https://skia-review.googlesource.com/156541
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
>
> Change-Id: I2aca36307d88c26905d860ec29417ec68c6037cc
> Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> Reviewed-on: https://skia-review.googlesource.com/156542
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Change-Id: I2d050624781c77cdd160291cadbadac602b48bde
Reviewed-on: https://skia-review.googlesource.com/c/157569
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-04 13:10:29 +00:00
Robert Phillips
bfa76f20bf Add GM for less common YUV formats (take 2)
Bug: skia:7903
Change-Id: I2399e4aaae6b91914d637ff0e921e04596b52836
Reviewed-on: https://skia-review.googlesource.com/159141
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-10-03 17:22:02 +00:00
Mike Reed
964aedb5e3 play with animated gif
Bug: skia:
Change-Id: If86314cda6aa84f4824958cca30cde88a78d4b59
Reviewed-on: https://skia-review.googlesource.com/c/158562
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-10-03 14:43:18 +00:00
Mike Klein
b5ba83993b Revert "Add GM for less common YUV formats"
This reverts commit 412dd56589.

Reason for revert: serialize-8888

Original change's description:
> Add GM for less common YUV formats
> 
> Bug: skia:7903
> Change-Id: I0d6e6d6274d66a71aaf24b68b6d9ceb0f2148b68
> Reviewed-on: https://skia-review.googlesource.com/157601
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

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

Change-Id: I3c8375244ddee5d12836076793ec78a46cc04450
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7903
Reviewed-on: https://skia-review.googlesource.com/c/159043
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-02 20:36:15 +00:00
Robert Phillips
412dd56589 Add GM for less common YUV formats
Bug: skia:7903
Change-Id: I0d6e6d6274d66a71aaf24b68b6d9ceb0f2148b68
Reviewed-on: https://skia-review.googlesource.com/157601
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-10-02 18:57:58 +00:00
Mike Klein
0a44d5c728 Reland "clamp gamut if needed in SkConvertPixels"
This is a reland of b8fef7c986

readpixels is now disabled on serialize-8888.
The image encoding means it doesn't quite round trip,
though the image looks fine to the eye.

Original change's description:
> clamp gamut if needed in SkConvertPixels
>
> We need to clamp here for all the same reasons we need to clamp when
> blitting.  I've centralized the clamp's implementation to help that.
>
> I've allowed any --config to run this GM.  --config 565 was actually
> pointing out this problem by asserting, and now looks fine.
>
> Change-Id: Icc066792fc53747b161302d200abdd8dc4669f7f
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Reviewed-on: https://skia-review.googlesource.com/158721
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

Change-Id: I07601149e1d1e070bf96361f5303569b6a7b4e2a
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://skia-review.googlesource.com/c/159001
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-02 18:50:25 +00:00
Mike Klein
6a76dab257 Revert "clamp gamut if needed in SkConvertPixels"
This reverts commit b8fef7c986.

Reason for revert: serialize-8888?

Original change's description:
> clamp gamut if needed in SkConvertPixels
> 
> We need to clamp here for all the same reasons we need to clamp when
> blitting.  I've centralized the clamp's implementation to help that.
> 
> I've allowed any --config to run this GM.  --config 565 was actually
> pointing out this problem by asserting, and now looks fine.
> 
> Change-Id: Icc066792fc53747b161302d200abdd8dc4669f7f
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Reviewed-on: https://skia-review.googlesource.com/158721
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

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

Change-Id: Id888656b313619ab2652a3387bdbc5208e192ec1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://skia-review.googlesource.com/c/158980
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-02 17:52:05 +00:00
Brian Salomon
81c8a20112 Don't crash in aaflags GM if context is abandoned
Change-Id: I5683c2f7c0fb19b5e3fb7eab599651a3fe3eab3f
Reviewed-on: https://skia-review.googlesource.com/158823
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-10-02 17:31:00 +00:00
Brian Salomon
2213ee94c7 Add support for per-edge AA to GrTextureOp.
Outsetting in perspective case outsets the original homogeneous quad
points rather than the homogenized 2d points in order to avoid seaming
issues along shared edges.

Currently there is no way to trigger this from the public API and it
is tested by directly accessing GrRenderTargetContext from the added gm.

Change-Id: I24e0d53cc5821c8c8be07c23aca5bfafb4935c33
Reviewed-on: https://skia-review.googlesource.com/157600
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-10-02 16:45:07 +00:00
Mike Klein
b8fef7c986 clamp gamut if needed in SkConvertPixels
We need to clamp here for all the same reasons we need to clamp when
blitting.  I've centralized the clamp's implementation to help that.

I've allowed any --config to run this GM.  --config 565 was actually
pointing out this problem by asserting, and now looks fine.

Change-Id: Icc066792fc53747b161302d200abdd8dc4669f7f
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://skia-review.googlesource.com/158721
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-02 15:41:18 +00:00
Mike Reed
1eb9af9029 delete textonpath code -- not used anywhere
Bug: skia:
Change-Id: Ib645f7c140f87123429170a0bf6f7ed86ce53b3f
Reviewed-on: https://skia-review.googlesource.com/158224
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-01 16:52:32 +00:00
Mike Reed
66c505f6e8 expand imageinfo in C api, start on colorspace
After sk_imageinfo was initially created, we have added a colorspace to it,
and that object is a smart-pointer. In response to that, this CL upgrades
imageinfo to an "object" (like paint), so we can manage the ref-counting of
its colorspace, and to allow for future changes/expansion (like paint).

Bug: skia:
Change-Id: I629ff99c0820fdbe83f062d9fb768c15cda68e18
Reviewed-on: https://skia-review.googlesource.com/157156
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-28 17:52: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
84f8a61e41 Support encoding/decoding F16 without a color space
Change encode-srgb-* to exercise this code. The encoders
handle this just fine, so just remove those checks. The
decoders still rely on having a color space, so detect
and fix this inside SkCodec. Eventually I'd like to get
rid of the swizzler, use skcms for all format conversion,
etc... but that's a really big change, and this will let
us land other changes without breaking layout tests.

Bug: skia:8382
Change-Id: I8d85bf44ee3a287ad295515a745ded2ff5051417
Reviewed-on: https://skia-review.googlesource.com/156627
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-28 15:05:59 +00:00
Chris Dalton
d004e0b55c Cleanup resource flags
Converts GrResourceProvider::Flags and GrResourceCache::ScratchFlags
to "enum class" and fixes a case where we were accidentally using the
wrong type of flag. Makes sure to allocate GrSWMaskHelper proxies with
kNoPendingIO.

Bug: skia:8351
Change-Id: Ibcaa26314a53d0cb31ae22915ab94ab0fc07e76d
Reviewed-on: https://skia-review.googlesource.com/157280
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-09-27 23:40:23 +00:00
Brian Osman
e2a801ddaa Revert "Reland "Implement an explicit binary search-based analytic gradient colorizer""
This reverts commit f065907ccc.

Reason for revert: Processor test failing (inconsistently) on several bots.

Original change's description:
> Reland "Implement an explicit binary search-based analytic gradient colorizer"
> 
> This reverts commit 9461dcf130.
> 
> Reason for revert: Fixes for ANGLE's incorrect shader behavior
> 
> Original change's description:
> > Revert "Implement an explicit binary search-based analytic gradient colorizer"
> >
> > This reverts commit dcc85fc610.
> >
> > Reason for revert: ANGLE is frequently corrupted, particularly radial_gradient4 and mixershader
> >
> > Original change's description:
> > > Implement an explicit binary search-based analytic gradient colorizer
> > >
> > > Provides a reasonably flexible fragment processor that defines another
> > > colorizer implementation for gradients. It can support up to 8
> > > interpolation intervals (which is 16 colors if every stop is a hard stop
> > > or 9 colors if every stop is a smooth transition). It
> > > supports mixtures of hard and smooth stops. It is conditionally compiled
> > > into versions specific to the interval count (so it can produce up to
> > > 8 shader variants).
> > >
> > > The GrGradientShader controller does not remove the single and dual
> > > interval colorizers, which are useful specializations of this explicit
> > > binary search colorizer. Similarly, since it can only handle up to 8
> > > intervals, the texture colorizer is still used as a fallback.
> > >
> > > Currently it does not employ capabilities detection to determine if the
> > > hardware can support the number of required uniforms, which can become
> > > substantial for the larger gradient configurations.
> > >
> > > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > > Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
> > > Reviewed-on: https://skia-review.googlesource.com/155080
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> >
> > TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
> >
> > Change-Id: I351a387f0528e4c2db2d47ab2e5d6b336991fb98
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > Reviewed-on: https://skia-review.googlesource.com/156541
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
> 
> Change-Id: I2aca36307d88c26905d860ec29417ec68c6037cc
> Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> Reviewed-on: https://skia-review.googlesource.com/156542
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: Icd925d568d8cdffdc3020c07a9c50a4aa9cf0bb9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Reviewed-on: https://skia-review.googlesource.com/157429
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-27 16:50:52 +00:00
Michael Ludwig
f065907ccc Reland "Implement an explicit binary search-based analytic gradient colorizer"
This reverts commit 9461dcf130.

Reason for revert: Fixes for ANGLE's incorrect shader behavior

Original change's description:
> Revert "Implement an explicit binary search-based analytic gradient colorizer"
>
> This reverts commit dcc85fc610.
>
> Reason for revert: ANGLE is frequently corrupted, particularly radial_gradient4 and mixershader
>
> Original change's description:
> > Implement an explicit binary search-based analytic gradient colorizer
> >
> > Provides a reasonably flexible fragment processor that defines another
> > colorizer implementation for gradients. It can support up to 8
> > interpolation intervals (which is 16 colors if every stop is a hard stop
> > or 9 colors if every stop is a smooth transition). It
> > supports mixtures of hard and smooth stops. It is conditionally compiled
> > into versions specific to the interval count (so it can produce up to
> > 8 shader variants).
> >
> > The GrGradientShader controller does not remove the single and dual
> > interval colorizers, which are useful specializations of this explicit
> > binary search colorizer. Similarly, since it can only handle up to 8
> > intervals, the texture colorizer is still used as a fallback.
> >
> > Currently it does not employ capabilities detection to determine if the
> > hardware can support the number of required uniforms, which can become
> > substantial for the larger gradient configurations.
> >
> > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
> > Reviewed-on: https://skia-review.googlesource.com/155080
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
>
> Change-Id: I351a387f0528e4c2db2d47ab2e5d6b336991fb98
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> Reviewed-on: https://skia-review.googlesource.com/156541
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: I2aca36307d88c26905d860ec29417ec68c6037cc
Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Reviewed-on: https://skia-review.googlesource.com/156542
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-09-27 16:02:30 +00:00
Stephen White
cfe1264d74 GrTessellator: two fixes for boundary simplification artifacts.
The "pointy vertex" test was only considering the distance from the
next (outgoing) edge to the previous point. It must also consider the
distance from the previous (incoming) edge to the next point. If
either are less than a quarter pixel, the vertex is considered pointy
and should be removed. (884166)

Also (887103), when an interior region was completely removed due to
boundary simplification, it would leave a degenerate edge consisting
of the same vertex. So avoid introducing a join edge when prev == next.

Bug: 884166, 887103
Change-Id: I7f1d5b98e418d8f2a1c11643259d3cd74d08f286
Reviewed-on: https://skia-review.googlesource.com/157220
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-09-26 23:57:59 +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
Mike Klein
5ed1ea8285 refactor downsamplebitmap GM
Basically I just wanted to refactor this GM so that it drew a bitmap of
the same (ct,at,cs) as the canvas so that we could get some coverage of
drawing, say, F16.

But then I just started refactoring here and there and before I knew
it I've basically rewritten the GM.  What it draws is unchanged, but

  - I've stripped the parameters that never change from the names
  - I've removed a lot of inheritance instead using a single
    SkBitmap (*)(SkImageInfo) pointer passed to the constructor
  - formatting, header cleanup, etc.

Sadly this doesn't reproduce the crash mentioned in the attached bug.

PS 2+3 oughta stop --config serialize-8888 from asserting.

Bug: skia:8410

Change-Id: I9dd40e0dfe84b7fe315082d899bb2fc327728363
Reviewed-on: https://skia-review.googlesource.com/156980
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2018-09-26 19:02:02 +00:00
Robert Phillips
646f637f4c Add rowBytes to createTestingOnlyBackendTexture
This is pulled out of:

https://skia-review.googlesource.com/c/skia/+/151983 (Test YUV images in DDL)

The YUV images seem to like to have row padding.

Change-Id: I517d2b63678beeafef88f86148fca15862176780
Reviewed-on: https://skia-review.googlesource.com/156367
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-09-25 13:48:29 +00:00
Leon Scroggins III
0098ccbab5 Remove unnecessary sk_tool_utils::EncodeImageToData
This template is only used in practice for SkBitmaps. There is already a
public API that does the same thing, so there's no need for this one.

Change-Id: I20b10aa8bc87a56face947689e1f0eaf4c3cc4e8
Reviewed-on: https://skia-review.googlesource.com/156540
Reviewed-by: Hal Canary <halcanary@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-09-25 12:02:26 +00:00
Michael Ludwig
9461dcf130 Revert "Implement an explicit binary search-based analytic gradient colorizer"
This reverts commit dcc85fc610.

Reason for revert: ANGLE is frequently corrupted, particularly radial_gradient4 and mixershader

Original change's description:
> Implement an explicit binary search-based analytic gradient colorizer
> 
> Provides a reasonably flexible fragment processor that defines another
> colorizer implementation for gradients. It can support up to 8
> interpolation intervals (which is 16 colors if every stop is a hard stop
> or 9 colors if every stop is a smooth transition). It
> supports mixtures of hard and smooth stops. It is conditionally compiled
> into versions specific to the interval count (so it can produce up to
> 8 shader variants).
> 
> The GrGradientShader controller does not remove the single and dual
> interval colorizers, which are useful specializations of this explicit
> binary search colorizer. Similarly, since it can only handle up to 8
> intervals, the texture colorizer is still used as a fallback.
> 
> Currently it does not employ capabilities detection to determine if the
> hardware can support the number of required uniforms, which can become
> substantial for the larger gradient configurations.
> 
> Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
> Reviewed-on: https://skia-review.googlesource.com/155080
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: I351a387f0528e4c2db2d47ab2e5d6b336991fb98
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Reviewed-on: https://skia-review.googlesource.com/156541
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-09-24 19:40:54 +00:00
Michael Ludwig
dcc85fc610 Implement an explicit binary search-based analytic gradient colorizer
Provides a reasonably flexible fragment processor that defines another
colorizer implementation for gradients. It can support up to 8
interpolation intervals (which is 16 colors if every stop is a hard stop
or 9 colors if every stop is a smooth transition). It
supports mixtures of hard and smooth stops. It is conditionally compiled
into versions specific to the interval count (so it can produce up to
8 shader variants).

The GrGradientShader controller does not remove the single and dual
interval colorizers, which are useful specializations of this explicit
binary search colorizer. Similarly, since it can only handle up to 8
intervals, the texture colorizer is still used as a fallback.

Currently it does not employ capabilities detection to determine if the
hardware can support the number of required uniforms, which can become
substantial for the larger gradient configurations.

Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
Reviewed-on: https://skia-review.googlesource.com/155080
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-24 16:40:36 +00:00
Florin Malita
268707284d [skottie] GM exercising external font loading
Sets up a fake web font loader which serves a local/resource font to
the sample text animation.

Also rename resources/skotty/skotty_* -> resources/skottie/skottie_*.

Change-Id: I4af5b24fc3cc5c63c78801979f9be56744047134
Reviewed-on: https://skia-review.googlesource.com/155881
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-09-20 19:05:35 +00:00
Mike Klein
983886e573 add interp-in-premul case to GM
Change-Id: I9811c76c3db38d5ab49ba0312e433aa46744df05
Reviewed-on: https://skia-review.googlesource.com/155781
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>
2018-09-20 18:36:21 +00:00
Brian Osman
1cf418b4d0 Some SkPM4f cleanup
Bug: skia:
Change-Id: I6a06b2ff951b9a1319c40b16b33840e220fecc37
Reviewed-on: https://skia-review.googlesource.com/155900
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-20 17:47:02 +00:00
Brian Osman
9369031fde GrColor -> SkColor in one GM
Bug: skia:
Change-Id: I71ea8f4275c2eb89dd88b7abf501b71e37469785
Reviewed-on: https://skia-review.googlesource.com/155605
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-19 20:05:22 +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
Brian Salomon
279f873faa Fix image_from_yuv_textures with --preAbandonContext
Change-Id: Ibb2dfdf6eccb48fbd2c4a503e473170389e2ec2a
Reviewed-on: https://skia-review.googlesource.com/155169
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-09-18 15:42:50 +00:00
Brian Salomon
d2fcfb5813 WEBGL_video_texture : sharing texture prototype in skia
Bug: 776222

Change-Id: I84c81bdaa6dc0b5548f116a28c6319e601effb32
Reviewed-on: https://skia-review.googlesource.com/146695
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Kenneth Russell <kbr@google.com>
2018-09-18 02:22:00 +00:00
Mike Klein
62bd12f723 add a couple bitmap cases to P3 GM
This checks drawBitmap() and a few ways to create P3 bitmaps.

Change-Id: I6f891c641a44249d7562f2f5ddeed8cbaa40ad40
Reviewed-on: https://skia-review.googlesource.com/154863
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-17 17:33:23 +00:00
Brian Osman
d4c29709ca Specify CPU (buffer) and GPU (shader) types explicitly in Attribute
The CPU type is still specified using GrVertexAttribType.
The GPU type is specified directly using GrSLType.

kHalfX_GrVertexAttribType now really means half-float buffer
data, rather than float. (Caveat: The GL enum is only correct
with ES3/GL3 - ES2+extension needs a different value. Sigh.)

Bug: skia:
Change-Id: Ife101db68a5d4ea1ddc2f6c60fbec0c66d725c16
Reviewed-on: https://skia-review.googlesource.com/154628
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-14 21:54:03 +00:00
Mike Klein
be569494c4 add bitmap shaders to P3
Update SkImageShader/SkBlitter_sprite to use SkPaint::getColor4f().

Split the set_rgb into bounded and unbounded variants, just like we did
with uniform_color (the exact rgba variant).  Without this we'd try to
draw out-of-gamut colors in lowp for the non-scaled shader draw in
--config srgb, and that can't work.  SkRasterPipeline::append_set_rgb()
now checks to see if it's safe to use ::set_rgb and lowp, falling back
on ::unbounded_set_rgb and floats.

In the GM, the new "sprite" case is handled by SkImageShader, and the
old "sprite" case is handled as a uniform color draw through an A8 mask.
I'm having trouble constructing a call that reaches the A8 code in
SkBlitter_Sprite, but I have confirmed that it's definitely used by
quickly running the other GMs.  I've updated it to use the float paint
color just like SkImageShader.

Change-Id: I1ca8c08b79631165ac0c0032a1406add80e55c9f
Reviewed-on: https://skia-review.googlesource.com/154624
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-14 20:05:32 +00:00
Mike Klein
9fb5a53c8e add two more cases to P3 gm
These are a sprite and non-sprite A8 image draw,
where we pick up the color from the paint.

I'm slightly disturbed to see these working.
It turns out I had no idea how A8 draws happened.

There is probably some dead code to remove in
SkBlitter_Sprite (I think, never called for A8)
and in SkImageShader (only ever called with a black
paint color for A8), in this CL as TODOs.

Change-Id: I1d276f8d9b145b57e3ab793735fb184bdae670fb
Reviewed-on: https://skia-review.googlesource.com/154461
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-13 21:14:56 +00:00
Mike Klein
5e31ec6045 add a linear gradient to P3 gm
I've tweaked the indicators into overlays so there can be one for each
pixel sampled.  This lets me test both gradient corners.

I've dropped displaying the P3 value... not sure if it's as useful as
the other two, and I'm worried about information overload.  There's
already a lot to look at.

Change-Id: I57a41c3af0162e8132e50c47a0b967714a57e9e5
Reviewed-on: https://skia-review.googlesource.com/154220
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2018-09-13 13:30:22 +00:00
Mike Klein
fd007644c8 revise p3 GM
I've added a little auto-grader.
I think it's logic makes sense, but I'd appreciate fresh eyes on it.

Now with anti-aliased text.

Change-Id: I43a6d69251d4d93fbd70533f5c4d1cc281e4498b
Reviewed-on: https://skia-review.googlesource.com/154000
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-12 17:56:54 +00:00
Brian Osman
567f4fd019 Add F16 test-case to all_bitmap_configs
Currently, this won't draw on GPU backends that don't have F16 support.

Bug: skia:8375
Change-Id: Ie1975e7503384a8233ddfb5135452bb8cdc406f3
Reviewed-on: https://skia-review.googlesource.com/153888
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-12 17:44:25 +00:00
Brian Osman
2700abc4cb Remove raw-data version of createTextureProxy
This had poorly defined semantics in the world of DDL, and was only used
for a handful of GMs and tests. Switch those to use the SkImage version.

Bug: skia:
Change-Id: I2bec65c7547b2c904bd7f57a6296aacc0f7b4ed2
Reviewed-on: https://skia-review.googlesource.com/153886
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-12 15:00:46 +00:00