Commit Graph

1384 Commits

Author SHA1 Message Date
Brian Salomon
0a0304c426 Add experimental API to draw a set of SkImages in one SkCanvas call.
The client provides a src and dst rect for each image as well as
a bitfield that indicates whether each edge of the image should be
antialiased. This per-edge AA is useful for tiled compositors.

Rather than take a full SkPaint this API only takes an alpha, a filter
quality (which is pinned to kLow), and a blend mode. This is a likely
point of future evolution.

Currently the API is only fully implemented for kSrcOver on the GPU
backend. With other blend modes or on other backends AA will be ignored
for images that do not have all four edge AA flags set.

BUG: skia:8444

Change-Id: I143998dda8ad6a25f64e18cd600392ba553030ac
Reviewed-on: https://skia-review.googlesource.com/c/159062
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-12 13:14:24 +00:00
Mike Klein
05caa69a3f Reland "disable DAA and AAA in flutter"
This is a reland of 1421120316

PS2 rescopes a variable tighter, and reindents to make the #if-#else
logic stand out a little more clearly.

Original change's description:
> disable DAA and AAA in flutter
>
> If we're looking to cut out unnecessary code in Flutter,
> SkScan_AAA always jumps out to me as a bunch of code that
> is not logically required for GPU rendering.
>
> Looking at a treemap[1], SkScan_AAA is the biggest chunk of
> code under src/core.  I don't see DAA... maybe it's small,
> or somehow already trimmed?  Anyway, I cut it out too.
>
> [1] https://storage.googleapis.com/flutter_infra/flutter/c8755d74c17e949ee7c19cd114f084b465dac632/android-arm-release/sizes/index.html
>
> Change-Id: I4acf4aec365504c90e6b66393fd265a399f0f525
> Reviewed-on: https://skia-review.googlesource.com/c/159760
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

Change-Id: I6770781c26a0a581ed0df33c404386415472bed5
Reviewed-on: https://skia-review.googlesource.com/c/161581
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-12 02:22:16 +00:00
Mike Klein
e7588323d5 Revert "disable DAA and AAA in flutter"
This reverts commit 1421120316.

Reason for revert

Unused variable in Google3:

   constexpr SkScalar kSmallCubicThreshold = 16;

Huh.

Original change's description:
> disable DAA and AAA in flutter
> 
> If we're looking to cut out unnecessary code in Flutter,
> SkScan_AAA always jumps out to me as a bunch of code that
> is not logically required for GPU rendering.
> 
> Looking at a treemap[1], SkScan_AAA is the biggest chunk of
> code under src/core.  I don't see DAA... maybe it's small,
> or somehow already trimmed?  Anyway, I cut it out too.
> 
> [1] https://storage.googleapis.com/flutter_infra/flutter/c8755d74c17e949ee7c19cd114f084b465dac632/android-arm-release/sizes/index.html
> 
> Change-Id: I4acf4aec365504c90e6b66393fd265a399f0f525
> Reviewed-on: https://skia-review.googlesource.com/c/159760
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,csmartdalton@google.com,liyuqian@google.com,reed@google.com

Change-Id: I40c912aeed656d21455ca983b9001b1c1e1558a1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/161720
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-11 22:22:30 +00:00
Mike Klein
1421120316 disable DAA and AAA in flutter
If we're looking to cut out unnecessary code in Flutter,
SkScan_AAA always jumps out to me as a bunch of code that
is not logically required for GPU rendering.

Looking at a treemap[1], SkScan_AAA is the biggest chunk of
code under src/core.  I don't see DAA... maybe it's small,
or somehow already trimmed?  Anyway, I cut it out too.

[1] https://storage.googleapis.com/flutter_infra/flutter/c8755d74c17e949ee7c19cd114f084b465dac632/android-arm-release/sizes/index.html

Change-Id: I4acf4aec365504c90e6b66393fd265a399f0f525
Reviewed-on: https://skia-review.googlesource.com/c/159760
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-11 20:16:32 +00:00
Kevin Lubick
93faa6795b Make CCPR optional
This can reduce code size where CCPR is not supported (e.g. WebGL 1.0)

Drops 130k uncompressed, 50k compressed.

Bug: skia:
Change-Id: I8af7e681e1f3520a18e0c0d55e318dcf88206584
Reviewed-on: https://skia-review.googlesource.com/c/161041
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-10 20:20:01 +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
Hal Canary
42137de2b2 SkPDF: stop using linked list of dynamic memory streams.
also:
     delete src/core/SkSinglyLinkedList.h
     add prependToAndReset() to SkDynamicMemoryWStream.

All test PDFs are identical.

Change-Id: I528873f2f5061f07dd416a71f39d97ee97ef3c7d
Reviewed-on: https://skia-review.googlesource.com/c/159323
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2018-10-09 19:01:49 +00:00
Ben Wagner
230a71b77f Work around FreeType type change.
FreeType is moving their memory APIs from 'long' to 'size_t'. This
generally uses the same number of bits, but these are usually different
types (signed vs. unsigned). Detect the actual type in use where needed.

Change-Id: Id85b9b874f7418fbe308739d23eb3d22ecd765a8
Reviewed-on: https://skia-review.googlesource.com/c/159840
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-10-09 14:56:19 +00:00
Ethan Nicholas
010635190d Metal stencil support
Bug: skia:
Change-Id: I697a39bc756bb8f18ea2c6a1f8151dbc103bf9fe
Reviewed-on: https://skia-review.googlesource.com/c/157567
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2018-10-09 13:13:19 +00:00
Michael Ludwig
076238f306 Add clear benchmark
Bug: skia:
Change-Id: I2cfc365e41942ad7cc3fbdf9b815df6e25b1f36f
Reviewed-on: https://skia-review.googlesource.com/c/160601
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-10-08 21:13:26 +00:00
Mike Reed
d109503b69 split out SkDraw_text functions
Bug: skia:
Change-Id: I1cbce64fe137011e664133a1ec51feaa87898529
Reviewed-on: https://skia-review.googlesource.com/c/160023
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-05 16:30:52 +00:00
Mike Reed
dee25ccb67 split SkPaint into separate impl files
Bug: skia:
Change-Id: If82d39be1f85f9c9487e232b56c72dde175243ab
Reviewed-on: https://skia-review.googlesource.com/c/160022
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-05 16:17:20 +00:00
Hal Canary
d18d7bd294 SK_SUPPORT_LEGACY_DOCUMENT_FACTORY: clean up part 2/2
Change-Id: Ibab2f420c779e0307f4df214f229609b377acf29
Reviewed-on: https://skia-review.googlesource.com/c/156369
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-10-04 20:00:24 +00:00
Jim Van Verth
8026ccc46e Implement more SkImage_GpuYUVA functionality
Bug: skia:7901
Change-Id: I78a947edb924e0a1240537a83aa0bc111239e567
Reviewed-on: https://skia-review.googlesource.com/c/159320
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-10-04 19:01:07 +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
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
Mike Klein
9e0efe3189 remove SkColorSpaceXform
Change-Id: I08181d2f5a81a4f0781304dd7fab2cb1452b2c30
Reviewed-on: https://skia-review.googlesource.com/c/159300
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-03 20:08:48 +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
Jim Van Verth
49fdd7ad18 Bundle shared SkImage_Gpu methods.
Also adds an enum to make YUV index more explicit.

Bug: skia:7903
Change-Id: I21ae4cac126275fa7fd257235910fd3be155d293
Reviewed-on: https://skia-review.googlesource.com/c/159160
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-10-03 15:13:00 +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
Brian Osman
5ea96bf76e Remove unused premul/unpremul FP code
Bug: skia:
Change-Id: I911ee066ce4d0175cee3ee3868a86955d486687c
Reviewed-on: https://skia-review.googlesource.com/159060
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
2018-10-02 19:46:37 +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
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
Jim Van Verth
f49262d3bc Add SkImage_GpuYUVA
Bug: skia:7903
Change-Id: I06edc155b0a0a0697dc0d0aab74b6876d631ca0d
Reviewed-on: https://skia-review.googlesource.com/156942
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-10-02 16:40:01 +00:00
Kevin Lubick
cbcff385c1 Have pathkit use libpathkit.a for faster builds
Of note, it is very important for the -DSK_RELEASE/-DSK_DEBUG
to match between libskia.a and the WASM bindings, otherwise
things like SKDEBUGCODE are sometimes compiled in and sometimes
not, which can cause headaches like sizeof() mismatching between
.cpp files and .h files.

Bug: skia:
Change-Id: Id6ef58c44a7c10014a243b36708e0891514f6008
Reviewed-on: https://skia-review.googlesource.com/158341
Reviewed-by: Mike Klein <mtklein@google.com>
2018-10-02 13:27:29 +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
Robert Phillips
e8e2bb1384 Test YUV images in DDL
The main two CLs calved off (and landed independently) from this CL are:

https://skia-review.googlesource.com/c/skia/+/156761 (Add SkImage_Gpu::MakePromiseYUVATexture)
  -- adds internal place holder for YUVA promise images (only returns Y channel)

https://skia-review.googlesource.com/c/skia/+/156140 (Add SkImage_Base API to access planar data)
  -- adds ability to grab planes for testing purposes (not externally visible)

Bug: skia:7903
Bug: skia:8424
Change-Id: Id0f2f84851dacc66c2c266a30cafa0b628b12eb4
Reviewed-on: https://skia-review.googlesource.com/151983
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-10-01 12:12:29 +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
Dominic Mazzoni
656cefe65d Add initial support for generating tagged PDFs.
Adds an interface for the document creator to pass in a tree
of tags indicating the structure of the document, each with a type
(from a predetermined enum of possible types) and a node ID.
It also adds a setNodeId function to SkCanvas so that page content
can be associated with a particular tag. If both the tag tree and
marked content are present, Skia can now output a properly tagged
PDF.

An example program is included. When used properly, the PDF generated
by this patch is valid and the tags are parsed properly by Adobe
Acrobat. It handles many corner cases like content that spans more
than one page, or tags that don't correspond to any marked content, or
marked content that doesn't correspond to any tags.

However, it doesn't implement all of the features of PDF accessibility
yet, there are some additional attributes that can be associated with
some tags that need to be supported, too, in order to properly tag
things like figures and tables.

Bug: skia:8148
Change-Id: I2e448eca8ded8e1b29ba685663b557ae7ad7e23e
Reviewed-on: https://skia-review.googlesource.com/141138
Reviewed-by: Hal Canary <halcanary@google.com>
2018-09-27 19:35:40 +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
Ben Wagner
41e404746d Filter TextBlob paints in Viewer.
In particular this allows subpixel positioning to be forced for
drawing.

Change-Id: I2c88311f075944fef66fe5ba0237804aa5755800
Reviewed-on: https://skia-review.googlesource.com/156370
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-09-24 20:04:24 +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
Hal Canary
00529a1771 SK_SUPPORT_LEGACY_DOCUMENT_FACTORY: clean up part 1/2
part 2 can follow after android patch lands.

Change-Id: If2a8135ac7384d84fd97d68933684ad8486d7471
Reviewed-on: https://skia-review.googlesource.com/156189
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-09-21 19:50:40 +00:00
Mike Klein
60900b55f9 move skpipe to experimental
Nothing's using it except test tools.
I'd like to make that a bit clearer by getting it out of src.

Disabled the fuzzer.

Removed the bench so Android's building nanobench doesn't block this.

Bug: chromium:886713

Change-Id: I761f52c40171c27ff4b699409b32647e84684ec3
Reviewed-on: https://skia-review.googlesource.com/156240
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-09-21 17:20:25 +00:00
Ben Wagner
7b562291a7 Use SkUniqueCFRef in SkImage*CG.
This clarifies ownership and makes the code more readable.

It is safe to use unique_ptr directly for UniqueCFRef, since
unique_ptr does not call the deleter with nullptr.

Change-Id: I4326a86059fb31488d1e163faca95a6c29960039
Reviewed-on: https://skia-review.googlesource.com/155612
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2018-09-21 15:35:29 +00:00
Brian Osman
82e0e444a5 Remove a largue quantity of 4444 and/or dithering code
Most of this was entirely unused. Some was only used by the dithering
sample (which is now also deleted).

Bug: skia:
Change-Id: Ibafe61e9b19cae8738fd8df2c94dca182722e2e6
Reviewed-on: https://skia-review.googlesource.com/155921
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-21 00:50:06 +00:00
Mike Klein
7ea977bc5e Reland "always optimize third_party code"
This is a reland of c766370d86

Original change's description:
> always optimize third_party code
> 
> Change-Id: I5b2244460a4760e9336640f597d0f74c374a0d04
> Reviewed-on: https://skia-review.googlesource.com/155641
> 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>

Change-Id: I63e7f9ca852fc99728d7a01d9987b3506115d266
Reviewed-on: https://skia-review.googlesource.com/155760
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-20 23:21:01 +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
653c6b5b8e Remove (unused) GrBlend.cpp, and some GrColor helpers
Bug: skia:
Change-Id: I9a99cb28fd239371ca21b4a918e802606afe9da0
Reviewed-on: https://skia-review.googlesource.com/155840
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>
2018-09-20 15:25:17 +00:00
Mike Reed
5d032ecb8f Revert "always optimize third_party code"
This reverts commit c766370d86.

Reason for revert: speculative -- trying to fix Debian breaks (pdf?)

Original change's description:
> always optimize third_party code
> 
> Change-Id: I5b2244460a4760e9336640f597d0f74c374a0d04
> Reviewed-on: https://skia-review.googlesource.com/155641
> 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>

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

Change-Id: I5467c95f9487c31e6f538f13579e490cdaeeee2e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/155607
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-19 19:55:58 +00:00
Mike Klein
c766370d86 always optimize third_party code
Change-Id: I5b2244460a4760e9336640f597d0f74c374a0d04
Reviewed-on: https://skia-review.googlesource.com/155641
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-19 18:09:55 +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
Michael Ludwig
afebe1614e Remove all old gpu gradient code
At this point, all gradient configurations should be handled by the new
FP gradient code path so this removes all of the dead code.

Bug: skia:
Change-Id: If6041edcd8417d8f345e17000ccb27d9efea0bb3
Reviewed-on: https://skia-review.googlesource.com/152383
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-09-14 22:21:56 +00:00
Michael Ludwig
a7914d3a8e Implement textured gradients
Also clones SkGradientBitmapCache into GrGradientBitmapCache in the
gpu/gradients folder. But after cleaning up the old gradient code,
SkGradientBitmapCache will go away and SkGradientShader will have no
reference to the bitmap cache or support for building bitmaps.

The "new" GrGradientBitmapCache has been updated to hide the thread
safety responsibilities and gradient bitmap generation code that had
originally been a part of SkGradientShader.

Bug: skia:
Change-Id: Ida134c6437c866439fac44fa453d09a6a11549e7
Reviewed-on: https://skia-review.googlesource.com/150917
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-09-14 17:31:53 +00:00
Michael Ludwig
0495f7aec3 Implement dual interval gradients
Adds a new colorizer implementation that supports gradients with two
interpolation intervals. The two intervals can share a middle color
to represent the usual 3-color gradient, or can have different colors
to represent a hard stop at an arbitrary point.

Bug: skia:
Change-Id: I8c73705e83b99e28ad5c834230ced4e3b7b9d1c4
Reviewed-on: https://skia-review.googlesource.com/150700
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-09-14 13:12:52 +00:00
Brian Osman
0ab568463b For Windows-Clang-Debug, use -fstandalone-debug to get better debug info
Without this, debug clang builds on windows have very little debug info.
Fix is based on Chromium's handling of this (they have several tactics,
depending on linker, etc...)

https://cs.chromium.org/chromium/src/build/config/compiler/BUILD.gn?l=2194

Change-Id: Ib1b3aa4cdf4e2daa762d994bea94dc3c691cf359
Reviewed-on: https://skia-review.googlesource.com/154540
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-13 20:07:58 +00:00
Michael Ludwig
8f685085af Implement 2-pt conical gradient layout
Add an FP that provides the two-point conical gradient effect. The
majority of the new FP's shader code is a straight forward port from
SkTwoPointConicalGradient_gpu.cpp. This FP is bulkier because of the
extensive calculations that go on in its overridden Make function.

To support 2-pt conical gradient's behavior of writing transparent
black in invalid areas of the conical interpolation, the contract of
gradient layout FPs has been updated to provide a flag in the y
component as to whether or not the fragment should be rejected.

A separate channel was used since negative values and large values are
perfectly reasonable for the untiled gradient layout to return (before
the value is then constrained into [0, 1]). It also seemed better to
avoid returning a problematic value like infinity or NaN.

Bug: skia:
Change-Id: I37373bb5aebd89cac8905602e699ad19f0f5ac82
Reviewed-on: https://skia-review.googlesource.com/148988
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-09-13 20:04:16 +00:00
Michael Ludwig
24d438b393 Implement sweep gradient layout
Add an FP that implements the sweep gradient effect and updates
SkSweepGradient to use the new system if possible.

Bug: skia:
Change-Id: I3f65da01afafae54c45848a6a78fd758f65eb4a6
Reviewed-on: https://skia-review.googlesource.com/148806
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-09-13 18:45:26 +00:00
Michael Ludwig
4089df8690 Implement radial gradient layout
Adds a radial gradient FP in the same vein as the prior linear gradient
FP. It updates SkRadialGradient to try and use the new system before
falling back to the original GPU gradient code.

Bug: skia:
Change-Id: I0739832beeae18d0a7178ada44014d7885478031
Reviewed-on: https://skia-review.googlesource.com/148803
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-09-13 16:58:25 +00:00
Mike Reed
5152c4acfb Reland "remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM"
This reverts commit b8e125281d.

Reason for revert: flutter has landed in fuchsia

Original change's description:
> Revert "remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM"
> 
> This reverts commit 558fabb31c.
> 
> Reason for revert: flutter hasnt rolled into fuschia so this breaks fuschia
> 
> Original change's description:
> > remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM
> > 
> > ... now that Brian updated Flutter's callsites
> > 
> > Bug: skia:8350
> > Change-Id: I5ae72700125e09d84392eee8045c9602f718909a
> > Reviewed-on: https://skia-review.googlesource.com/153901
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > Auto-Submit: Mike Reed <reed@google.com>
> 
> TBR=brianosman@google.com,reed@google.com
> 
> Change-Id: I263e3c7694895ac85dc71a785832e7fb89dc81de
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8350
> Reviewed-on: https://skia-review.googlesource.com/154081
> Reviewed-by: Cary Clark <caryclark@skia.org>
> Commit-Queue: Cary Clark <caryclark@skia.org>

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

Change-Id: Iabf3c78c883275c0256b31bcde87d4cdc8eecbec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8350
Reviewed-on: https://skia-review.googlesource.com/154302
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-13 15:19:09 +00:00
Michael Ludwig
4f94ef6cbd Reland "Base Gradient FP Refactor"
This reverts commit 1ea5656a28.

Reason for revert: Fixed google3 build failure

Original change's description:
> Revert "Base Gradient FP Refactor"
> 
> This reverts commit 10f7a1e075.
> 
> Reason for revert: broke google3 roll
> Original change's description:
> > Base Gradient FP Refactor
> > 
> > --
> > 
> > Redefines how gradients will be written in the GPU back-end:
> > 
> > They are split into three fragment processor components: master, layout, and colorizer.
> > The layout FP is responsible for converting the fragment position into an interpolant value, t.
> > Each high-level gradient--such as linear, radial, etc.--are implemented solely in a layout FP.
> > The colorizer FP is responsible for converting t into a color.
> > The master FP invokes the layout, clamps t into the proper domain, and then invokes the colorizer.
> > GrGradientShader provides factory functions to create FP graphs from SkGradientShader instances.
> > This pattern is documented in gpu/gradients/README.md.
> > 
> > Goals for current CL
> > ====================
> > 
> > Outline the FP components by providing .fp implementations for the simplest gradients.
> > Defines a two-color single interval colorizer and a linear gradient layout, and the master effect.
> > A MakeLinear() factory function is provided that can convert SkGradientShaders that fit these constraints.
> > SkLinearGradient first attempts to use the new system, falling back to the original GrGradientEffect.
> > 
> > Future CLs
> > ==========
> > 
> > To keep the CL reviews manageable, additional dependent CLs will be added that gradually replace past functionality.
> > A CL for each layout will be defined.
> > CLs for the different analytic colorizer cases and the textured gradient case will be defined.
> > Once the new system supports all current layouts and colorizer capabilities, all old GPU gradient code will be removed.
> > After this clean-up, analytic colorization can hopefully be expanded to reduce the usage of textured gradients.
> > 
> > Bug: skia:
> > Change-Id: Iafe7b8b4071491a71c473babcd7bedda659150c1
> > Reviewed-on: https://skia-review.googlesource.com/148120
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,michaelludwig@google.com
> 
> Change-Id: Ib735e323795ac8874cb00b007a915786b50517a6
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/153600
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Cary Clark <caryclark@google.com>

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

Change-Id: Ibf6ffbcb1af0dfbdac7317151aeb08f18f84c7fd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/153887
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2018-09-12 20:20:32 +00:00
Cary Clark
b8e125281d Revert "remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM"
This reverts commit 558fabb31c.

Reason for revert: flutter hasnt rolled into fuschia so this breaks fuschia

Original change's description:
> remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM
> 
> ... now that Brian updated Flutter's callsites
> 
> Bug: skia:8350
> Change-Id: I5ae72700125e09d84392eee8045c9602f718909a
> Reviewed-on: https://skia-review.googlesource.com/153901
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

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

Change-Id: I263e3c7694895ac85dc71a785832e7fb89dc81de
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8350
Reviewed-on: https://skia-review.googlesource.com/154081
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-09-12 18:55:00 +00:00
Mike Reed
558fabb31c remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM
... now that Brian updated Flutter's callsites

Bug: skia:8350
Change-Id: I5ae72700125e09d84392eee8045c9602f718909a
Reviewed-on: https://skia-review.googlesource.com/153901
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-09-12 15:23:48 +00:00
Greg Daniel
b2acf0a939 Add unit test to test basic importing and drawing of AHardwareBuffers.
Bug: skia:
Change-Id: If601693109148a7d5c6e6855443a3401c36e5f01
Reviewed-on: https://skia-review.googlesource.com/153545
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-09-12 13:40:54 +00:00
Derek Sollenberger
1821a5becd Supress warnings about implicit fallthrough in Android.
Change-Id: I3e55c2641b53f284f16658370a18d165b678cc36
Reviewed-on: https://skia-review.googlesource.com/153667
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Chih-hung Hsieh <chh@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Derek Sollenberger <djsollen@google.com>
2018-09-11 19:49:29 +00:00
Mike Klein
8f5a7a6f50 first start on a P3 GM
We don't have anything drawing colors outside sRGB,
but now that we've got SkPaint::setColor4f(), that's easy.

Looks like we have lots of work to do.

Pin GrColor4f floats before converting to unsigned.
Underflowing floats would get pinned to 255 spuriously
instead of to 0.  I think this fixes the failing CQ
bot, and the white square problem.

Change-Id: I866963ff026e6ab891b4c7d57decc43538000099
Reviewed-on: https://skia-review.googlesource.com/153640
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-11 19:17:06 +00:00
Cary Clark
1ea5656a28 Revert "Base Gradient FP Refactor"
This reverts commit 10f7a1e075.

Reason for revert: broke google3 roll
Original change's description:
> Base Gradient FP Refactor
> 
> --
> 
> Redefines how gradients will be written in the GPU back-end:
> 
> They are split into three fragment processor components: master, layout, and colorizer.
> The layout FP is responsible for converting the fragment position into an interpolant value, t.
> Each high-level gradient--such as linear, radial, etc.--are implemented solely in a layout FP.
> The colorizer FP is responsible for converting t into a color.
> The master FP invokes the layout, clamps t into the proper domain, and then invokes the colorizer.
> GrGradientShader provides factory functions to create FP graphs from SkGradientShader instances.
> This pattern is documented in gpu/gradients/README.md.
> 
> Goals for current CL
> ====================
> 
> Outline the FP components by providing .fp implementations for the simplest gradients.
> Defines a two-color single interval colorizer and a linear gradient layout, and the master effect.
> A MakeLinear() factory function is provided that can convert SkGradientShaders that fit these constraints.
> SkLinearGradient first attempts to use the new system, falling back to the original GrGradientEffect.
> 
> Future CLs
> ==========
> 
> To keep the CL reviews manageable, additional dependent CLs will be added that gradually replace past functionality.
> A CL for each layout will be defined.
> CLs for the different analytic colorizer cases and the textured gradient case will be defined.
> Once the new system supports all current layouts and colorizer capabilities, all old GPU gradient code will be removed.
> After this clean-up, analytic colorization can hopefully be expanded to reduce the usage of textured gradients.
> 
> Bug: skia:
> Change-Id: Iafe7b8b4071491a71c473babcd7bedda659150c1
> Reviewed-on: https://skia-review.googlesource.com/148120
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ib735e323795ac8874cb00b007a915786b50517a6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/153600
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-09-11 15:51:56 +00:00
Michael Ludwig
10f7a1e075 Base Gradient FP Refactor
--

Redefines how gradients will be written in the GPU back-end:

They are split into three fragment processor components: master, layout, and colorizer.
The layout FP is responsible for converting the fragment position into an interpolant value, t.
Each high-level gradient--such as linear, radial, etc.--are implemented solely in a layout FP.
The colorizer FP is responsible for converting t into a color.
The master FP invokes the layout, clamps t into the proper domain, and then invokes the colorizer.
GrGradientShader provides factory functions to create FP graphs from SkGradientShader instances.
This pattern is documented in gpu/gradients/README.md.

Goals for current CL
====================

Outline the FP components by providing .fp implementations for the simplest gradients.
Defines a two-color single interval colorizer and a linear gradient layout, and the master effect.
A MakeLinear() factory function is provided that can convert SkGradientShaders that fit these constraints.
SkLinearGradient first attempts to use the new system, falling back to the original GrGradientEffect.

Future CLs
==========

To keep the CL reviews manageable, additional dependent CLs will be added that gradually replace past functionality.
A CL for each layout will be defined.
CLs for the different analytic colorizer cases and the textured gradient case will be defined.
Once the new system supports all current layouts and colorizer capabilities, all old GPU gradient code will be removed.
After this clean-up, analytic colorization can hopefully be expanded to reduce the usage of textured gradients.

Bug: skia:
Change-Id: Iafe7b8b4071491a71c473babcd7bedda659150c1
Reviewed-on: https://skia-review.googlesource.com/148120
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-09-11 14:52:55 +00:00
Brian Osman
bd65955441 Remove SkImageCacherator entirely
It was just the slice of SkImage_Lazy's API that we needed to expose to
GrImageTextureMaker. Instead, give SkImage_Lazy a header, so that the
maker can use it directly.

Change-Id: Iea6198f63e8065b8c987f7c07f3222409cdda439
Reviewed-on: https://skia-review.googlesource.com/153546
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-11 14:24:32 +00:00
Mike Reed
87ce0690b7 Revert "Revert "add flag to soften the blow of removing a legacy api for flutter""
Remember to delete the define from SkTypeface.h

This reverts commit b5f23f398d.

Bug: skia:
Change-Id: I63b2e395dac3850d352f38fdfee9ad751cdcace9
Reviewed-on: https://skia-review.googlesource.com/152590
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-07 20:58:54 +00:00
Brian Salomon
3ac1f95987 Preseve tangents when converting cubics->quads in GrAAHairlinePathRenderer
Bug: chromium:847759
Change-Id: I35a6d069f732d906714a640fca59a71fd35b74ec
Reviewed-on: https://skia-review.googlesource.com/152664
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-09-07 20:21:24 +00:00
Jim Van Verth
b5f23f398d Revert "add flag to soften the blow of removing a legacy api for flutter"
This reverts commit 1b935e65d1.

Reason for revert: Breaking Flutter bot.

Original change's description:
> add flag to soften the blow of removing a legacy api for flutter
> 
> Bug: skia:8350
> Change-Id: I2c4a136be7f20d54e67c5fb77f0f3699eda81851
> Reviewed-on: https://skia-review.googlesource.com/152588
> Reviewed-by: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: Ia6bc6b42b49917aa1a7dfd0b2bf1f2fe8a22cffb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8350
Reviewed-on: https://skia-review.googlesource.com/152667
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-09-07 18:56:27 +00:00
Mike Reed
1b935e65d1 add flag to soften the blow of removing a legacy api for flutter
Bug: skia:8350
Change-Id: I2c4a136be7f20d54e67c5fb77f0f3699eda81851
Reviewed-on: https://skia-review.googlesource.com/152588
Reviewed-by: Mike Reed <reed@google.com>
2018-09-07 18:13:49 +00:00
Mike Klein
64bbee7ab2 fix typo
Change-Id: I8fe8d4d6dfe5332e6a3995e8519cc42e4e74caff
Reviewed-on: https://skia-review.googlesource.com/152041
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-05 21:32:18 +00:00
Mike Klein
d505b19c05 add src/opts headers to .gni files
Chrome's analyze step uses GN and doesn't see changes
to these files as mattering to anything.

I've kept the ones particular to old style opts in
each of their particular targets, and the ones that
are included multiple times (including from outside
src/opts) in core.  Kind of arbitrary, but it's at
least close to the right slicing.

Change-Id: I2a5aaeca5b6287c13d7365ec1b63158f48e4e84a
Reviewed-on: https://skia-review.googlesource.com/152040
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-05 20:31:09 +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
Mike Klein
d84c1e65a6 drop warnings and -Werror from is_official_builds
People using is_official_build don't really want to see warnings.
They're for devs, not users.

The somewhat odd update to gn/BUILDCONFIG.gn keeps command
line flag precedence (later == more important) unchanged.

Change-Id: I1a04a35f066b7408021d474535f0dbf4928e21d3
Reviewed-on: https://skia-review.googlesource.com/151380
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-09-04 15:46:42 +00:00
Ethan Nicholas
78aceb2f87 converted overdraw effect to new FP system
Bug: skia:
Change-Id: I4cff0ecdf3fc61f584012af519730f08bfd78264
Reviewed-on: https://skia-review.googlesource.com/150484
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2018-09-04 13:37:25 +00:00
Chris Dalton
09a7bb2221 Reland "ccpr: Implement stroking with fine triangle strips"
This is a reland of 2f2757fa6b

Original change's description:
> ccpr: Implement stroking with fine triangle strips
>
> Implements strokes by linearizing the curve into fine triangle strips
> and interpolating a coverage ramp for edge AA. Each triangle in the
> strip emits either positive or negative coverage, depending on its
> winding direction. Joins and caps are drawn with the existing CCPR
> shaders for triangles and conics.
>
> Conic strokes and non-rigid-body transforms are not yet supported.
>
> Bug: skia:
> Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
> Reviewed-on: https://skia-review.googlesource.com/148243
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Allan MacKinnon <allanmac@google.com>

TBR=robertphillips@google.com

Bug: skia:
Change-Id: I3f0065e80975ee8334300bc5e934231b66b49178
Reviewed-on: https://skia-review.googlesource.com/151188
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-09-03 10:16:28 +00:00
Cary Clark
db16001d6a add circles to stroked cubics with cusps
Add a circle at the cusp to match Adobe Illustrator,
Microsoft Edge, and our own CCPR implementation.

R=reed@google.com,csmartdalton@google.com
Bug: skia:5623
Change-Id: Ia46c910643f373e50c4b30303fcac5f79d77be62
Reviewed-on: https://skia-review.googlesource.com/150370
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Mike Reed <reed@google.com>
2018-08-31 19:55:44 +00:00
Herb Derby
8378dfb6a1 Extract SkGlyphRunListPainter from SkGlyphRun.*
Change-Id: I2c5275b6dd9cf2f83d4d99b73dd32dff487e659b
Reviewed-on: https://skia-review.googlesource.com/150660
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-08-31 16:36:38 +00:00
Michael Ludwig
a427559c13 Refactor 'in uniform' CPP code generation
Easily supports mapping ctypes to sksl types with templates that
specify how to send data to the GPU and how to track state changes.
The template logic and type mappings are defined in
SkSLCPPUniformCTypes.* while SkSLCPPCodeGenerator is updated to
utilize it.

It also updates the supported ctypes to properly generate code for
SkPoint, SkIPoint, SkIRect, and GrColor4f. The code generated for
'in uniforms' now also correctly supports conditional uniforms.


Bug: skia:
Change-Id: Ib7c0a873bdd68a966b6a00871f33102dfa2c432d
Reviewed-on: https://skia-review.googlesource.com/150129
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2018-08-31 15:19:58 +00:00
Chris Dalton
02e6efe0a4 Revert "ccpr: Implement stroking with fine triangle strips"
This reverts commit 2f2757fa6b.

Reason for revert: issues with DDL

Original change's description:
> ccpr: Implement stroking with fine triangle strips
> 
> Implements strokes by linearizing the curve into fine triangle strips
> and interpolating a coverage ramp for edge AA. Each triangle in the
> strip emits either positive or negative coverage, depending on its
> winding direction. Joins and caps are drawn with the existing CCPR
> shaders for triangles and conics.
> 
> Conic strokes and non-rigid-body transforms are not yet supported.
> 
> Bug: skia:
> Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
> Reviewed-on: https://skia-review.googlesource.com/148243
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Allan MacKinnon <allanmac@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,caryclark@google.com,csmartdalton@google.com,reed@google.com,allanmac@google.com

Change-Id: I1980b09976df8275817eaffb6766dbd9fd3e59c7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/150980
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-08-31 14:45:44 +00:00
Chris Dalton
2f2757fa6b ccpr: Implement stroking with fine triangle strips
Implements strokes by linearizing the curve into fine triangle strips
and interpolating a coverage ramp for edge AA. Each triangle in the
strip emits either positive or negative coverage, depending on its
winding direction. Joins and caps are drawn with the existing CCPR
shaders for triangles and conics.

Conic strokes and non-rigid-body transforms are not yet supported.

Bug: skia:
Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
Reviewed-on: https://skia-review.googlesource.com/148243
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Allan MacKinnon <allanmac@google.com>
2018-08-31 12:51:47 +00:00
Michael Ludwig
10c3776b44 Remove GrTextureStripAtlas, textured gradients use independent textures
The texture strip atlas code path has been disabled without performance
regressions since 8/3/18, so this deletes it completely from the code
base since it is complex and difficult to manage.

GrTextureStripAtlas, GrDynamicTextureStripAtlas, and
GrDDLTextureStripAtlas completely deleted, everything else is cleaning
up references/dead code using the atlas.

Bug: skia:
Change-Id: Ieb967b6e291a1d76da62fce9fa384acbda8c51c0
Reviewed-on: https://skia-review.googlesource.com/150472
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-08-30 20:43:30 +00:00
Herb Derby
e61c23406f Remove drawPosText_asPath - more dead code
Change-Id: I4a0a1eb093767962fb0cd631ad41561962a233ea
Reviewed-on: https://skia-review.googlesource.com/150540
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-08-30 18:58:23 +00:00
Ethan Nicholas
ce008119dc converted arithmetic FP to new FP structure
Bug: skia:
Change-Id: I5492b378fa0f2ab7b453b2b1b18e4aef898370d2
Reviewed-on: https://skia-review.googlesource.com/148910
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-08-30 17:41:11 +00:00
Mike Klein
3e74c51d1c roll ANGLE w/ GN update
ANGLE switched their .gypi files to .gni files this commit,
so we need to make a small tweak to update our ANGLE build.

This removes the last use of gypi_to_gn.py, and in turn gn_helpers.py.

CQ_INCLUDE_TRYBOTS=skia.primary:Build-Debian9-Clang-x86_64-Release-ANGLE;skia.primary:Perf-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia.primary:Perf-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia.primary:Perf-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia.primary:Perf-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE;skia.primary:Perf-Win10-Clang-ShuttleC-GPU-GTX960-x86_64-Debug-All-ANGLE;skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE;skia.primary:Test-Win10-Clang-ShuttleC-GPU-GTX960-x86_64-Debug-All-ANGLE


Change-Id: I76c8a667e7c5c27dc4cd18ba0d932bfc2de38cf9
Reviewed-on: https://skia-review.googlesource.com/150541
Reviewed-by: Stephan Altmueller <stephana@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-08-30 17:31:02 +00:00
Mike Reed
a62d036586 textonpath no longer in canvas
Prev behavior available via utils SkDrawTextOnPath

Bug: skia:7554
Change-Id: I3d71963c632cc947e418757bb83cdc18ec3b184e
Reviewed-on: https://skia-review.googlesource.com/150123
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-08-29 14:04:45 +00:00
Brian Osman
18d7cf76cc Reland "Remove old ICC parser, A2B SkColorSpace, SkGammas, etc..."
This reverts commit 7ba1d64f07.

Reason for revert: Chrome's MakeICC calls are gone now.
Original change's description:
> Revert "Remove old ICC parser, A2B SkColorSpace, SkGammas, etc..."
> 
> This reverts commit 8ae7c90faf.
> 
> Reason for revert: Chrome roll
> 
> Original change's description:
> > Remove old ICC parser, A2B SkColorSpace, SkGammas, etc...
> > 
> > Docs-Preview: https://skia.org/?cl=148807
> > Change-Id: I2d77f6543e390c4948d57242a518af77443f0165
> > Reviewed-on: https://skia-review.googlesource.com/148807
> > Commit-Queue: Mike Klein <mtklein@google.com>
> > Reviewed-by: Mike Klein <mtklein@google.com>
> 
> TBR=mtklein@google.com,brianosman@google.com,reed@google.com
> 
> Change-Id: I5821591b22e395327ec0cd29ec18569bf7f61859
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/150142
> 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: I0269f8627f3afadeed7d1559a2a3dabf0c7f7b3f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/150122
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-08-28 20:07:16 +00:00
Brian Osman
7ba1d64f07 Revert "Remove old ICC parser, A2B SkColorSpace, SkGammas, etc..."
This reverts commit 8ae7c90faf.

Reason for revert: Chrome roll

Original change's description:
> Remove old ICC parser, A2B SkColorSpace, SkGammas, etc...
> 
> Docs-Preview: https://skia.org/?cl=148807
> Change-Id: I2d77f6543e390c4948d57242a518af77443f0165
> Reviewed-on: https://skia-review.googlesource.com/148807
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: I5821591b22e395327ec0cd29ec18569bf7f61859
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/150142
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-08-28 17:52:22 +00:00
Brian Osman
8ae7c90faf Remove old ICC parser, A2B SkColorSpace, SkGammas, etc...
Docs-Preview: https://skia.org/?cl=148807
Change-Id: I2d77f6543e390c4948d57242a518af77443f0165
Reviewed-on: https://skia-review.googlesource.com/148807
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-08-28 14:25:35 +00:00
Mike Reed
0fdc53f9ff textonpath util
Bug: skia:7554
Change-Id: Ifff3030f9d7be24146b5230bbf0e47f73000adfd
Reviewed-on: https://skia-review.googlesource.com/141460
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-08-27 18:01:21 +00:00
Leon Scroggins III
36f7e3298e Reland "Switch SkCodec to use skcms plus fixes""
This reverts commit 83988edfd3.

The CTS failure was actually due to another CL.

TBR=brianosman@google.com
TBR=djsollen@google.com

Bug: skia:6839
Bug: skia:8052
Bug: skia:8278
Change-Id: Id9f152ec2c66467d90f49df223cb9b7c168ac2ac
Reviewed-on: https://skia-review.googlesource.com/149483
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-08-27 16:16:14 +00:00
Leon Scroggins
83988edfd3 Revert "Reland "Switch SkCodec to use skcms" plus fixes"
This reverts commit 49894f450f.

Reason for revert: Breaking a CTS test on the Android roll:

java.lang.AssertionError: expected:<67043583> but was:<50266367>
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.failNotEquals(Assert.java:834)
	at org.junit.Assert.assertEquals(Assert.java:645)
	at org.junit.Assert.assertEquals(Assert.java:631)
	at android.graphics.cts.BitmapColorSpaceTest.verifyGetPixel(BitmapColorSpaceTest.java:301)
	at android.graphics.cts.BitmapColorSpaceTest.inColorSpaceP3ToSRGB(BitmapColorSpaceTest.java:612)

Expected: 3FF00FF Actual: 2FF00FF

Original change's description:
> Reland "Switch SkCodec to use skcms" plus fixes
> 
> This reverts commit 33d5394d08,
> relanding 81886e8f94 as well as
> "Fix CMYK handling in JPEG codec" (commit
> f8ae5ce20c)
> 
> Add a test based on the CTS test that failed in the original commit.
> purple-displayprofile.png is the image used in the CTS test, with the
> Android license.
> 
> This also adds a fix for SkAndroidCodec, ensuring that we continue to
> use a wide gamut SkColorSpace for images that do not have a numerical
> transfer function and have a wide gamut. This includes a test, with
> wide-gamut.png, which was created with Photoshop and the profile
> "sRGB_Calibrated_Homogeneous.icc" from the skcms tree.
> 
> Bug: skia:6839
> Bug: skia:8052
> Bug: skia:8278
> 
> TBR=djsollen@google.com
> As with the original, no API change
> 
> Change-Id: I4e5bba6a3151f9dc6491e8eda73d4de0535bd692
> Reviewed-on: https://skia-review.googlesource.com/149043
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>

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

Change-Id: Ie71e1fecc26de8225d2fe603765c1e1e0d738634
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6839, skia:8052, skia:8278
Reviewed-on: https://skia-review.googlesource.com/149262
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-08-24 21:41:37 +00:00
Herb Derby
d2fec23523 Have GPU and RemoteGlyphCache share mask position code
Change-Id: I0d8a969107304883ccd71c9b35ade50e3ac5d341
Reviewed-on: https://skia-review.googlesource.com/149048
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-08-24 20:13:16 +00:00
Leon Scroggins III
49894f450f Reland "Switch SkCodec to use skcms" plus fixes
This reverts commit 33d5394d08,
relanding 81886e8f94 as well as
"Fix CMYK handling in JPEG codec" (commit
f8ae5ce20c)

Add a test based on the CTS test that failed in the original commit.
purple-displayprofile.png is the image used in the CTS test, with the
Android license.

This also adds a fix for SkAndroidCodec, ensuring that we continue to
use a wide gamut SkColorSpace for images that do not have a numerical
transfer function and have a wide gamut. This includes a test, with
wide-gamut.png, which was created with Photoshop and the profile
"sRGB_Calibrated_Homogeneous.icc" from the skcms tree.

Bug: skia:6839
Bug: skia:8052
Bug: skia:8278

TBR=djsollen@google.com
As with the original, no API change

Change-Id: I4e5bba6a3151f9dc6491e8eda73d4de0535bd692
Reviewed-on: https://skia-review.googlesource.com/149043
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-08-24 17:46:25 +00:00
Leon Scroggins III
33d5394d08 Revert "Switch SkCodec to use skcms" and follow on change
This reverts commit 81886e8f94 and
f8ae5ce20c
("Fix CMYK handling in JPEG codec")

This fixes the Android build, which was failing a CTS test with this
change.

Bug: skia:6839
Bug: skia:8052

TBR=djsollen@google.com
As with the original, no API change

Change-Id: Ic744a610e9f431707f871de44f9f64040bc60d14
Reviewed-on: https://skia-review.googlesource.com/148810
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-08-22 21:13:50 +00:00
Herb Derby
4798576feb Pull SkSpan into its own header file
Change-Id: I32d800c91794093973cb8128fd1b83b4aff91845
Reviewed-on: https://skia-review.googlesource.com/148672
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-08-22 18:49:15 +00:00
Leon Scroggins III
81886e8f94 Switch SkCodec to use skcms
Bug: skia:6839
Bug: skia:8052

Create an skcms_Profile instead of an SkColorSpace when creating an
SkCodec. Eventually we'll move the SkImageInfo (and its SkColorSpace)
entirely to clients (e.g. SkAndroidCodec, SkCodecImageGenerator), but
for now, create it with SkEncodedInfo::makeImageInfo.

Create new SkEncodedInfo::Colors for the special PNG cases that we
want to map to specific SkColorTypes.

SkEncodedInfo:
- Add ICCProfile, which owns an skcms_ICCProfile
 - FIXME: maybe we should have a single instance for
  SRGB like SkColorSpace?
- Add kXAlpha_Color, for kAlpha_8. Since I'm not longer creating
  an SkImageInfo (at least in SkPngCodec), it needs a way to pass
  this info to the caller.
- Add k565_Color, for the same reason. Matt originally had this in
  https://codereview.chromium.org/2212563003/#ps120001, but didn't
  land that version. I like it though. Mike didn't like the bits
  per component for 565, but it seems like a sensible hack, much
  like the existing one for kAlpha_8
- Add width and height. These were removed for redundancy with
  SkImageInfo, but it makes sense to have them here without it.
BUILD.gn:
- Build the new SkEncodedInfo.cpp
SkCodec:
- Remove the constructor with an SkImageInfo. Edit the other one
  to drop width and height (now in SkEncodedInfo) and take a RHS
  reference to SkEncodedInfo
- Create the SkImageInfo from fEncodedInfo (for now)
- Consolidate choosing skcms_AlphaFormat for Transform here
- Call conversionSupported from initializeColorXform, with a new
  parameter for whether there is a color Xform, allowing SkJpegCodec
  and SkHeifCodec to override that method instead of having another
  method.
SkBmpCodec (etc)
- Adapt to the changes above
- Create a new SkEncodedInfo w/o profile for the swizzler.
SkPngCodec:
- use the new SkEncodedInfo::Colors rather than a custom SkImageInfo
SkRawCodec:
- Remove SkEncodedInfo from SkDngImage, which doesn't actually need it.
  This is helpful since we don't know all the info yet.
- Rewrite gAdobeRGB_toXYZD50 as an skcms_Matrix3x3
SkWebpCodec:
- Remove premul_step computation, and simplify to just rely on
  the base class' handling of applying the transform.
SkSwizzler:
- Add cases for the new SkEncodedInfo::Colors

TBR=reed@google.com
No public API changes. Only private/public members of SkCodec.h are
modified.

Change-Id: Ic0d3bb752b03f13be886b80331987aa5a5713fc0
Reviewed-on: https://skia-review.googlesource.com/136062
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-08-22 18:16:20 +00:00
Brian Osman
82cf64a0d3 Remove unused sRGB mip-map support
Change-Id: I94b27561bfaabe821af280ddc719840e5e25d106
Reviewed-on: https://skia-review.googlesource.com/148669
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-22 17:37:57 +00:00
Brian Osman
fbc6d7fcf6 Make SkColor4f <-> SkColor skip sRGB conversion
This lets us remove the old S32 functions, and fix a couple bugs.
I think this is a good first step to using SkColor4f for paint colors.

Bug: skia:
Change-Id: I0337c2b6db29b73c2f682f85b9cf68c985de7cce
Reviewed-on: https://skia-review.googlesource.com/147205
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-08-22 17:03:45 +00:00
Leon Scroggins III
4a0ba280b9 Fix flutter build
Flutter relies on SkCodec::kNone, which has been renamed, so define
SK_LEGACY_SKCODEC_NONE_ENUM in order to see the legacy name.

Change-Id: Icc32128c504fe988f55873b0221f56c56859def4
Reviewed-on: https://skia-review.googlesource.com/148663
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-08-22 16:04:24 +00:00
Brian Salomon
764e546c32 Fix op chaining painter's order violation in GrRenderTargetOpList.
Add unit test of op chaining.

Relax bounds checks in op merging/chaining to only check bounds against
heads of op chains.

Change-Id: I714435913b901c0a068bc7233ca30f2ab7916c2e
Reviewed-on: https://skia-review.googlesource.com/148380
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-08-21 17:03:42 +00:00
Chris Dalton
e1639695bf ccpr: Rename GrCCPathParser to GrCCFiller
Various renames and other refactorings that will allow us to add new
stroking classes alongside the existing code for fills.

Bug: skia:
Change-Id: Ib477f9e1d87f9d4c1604719f9af0695a53614081
Reviewed-on: https://skia-review.googlesource.com/147503
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-08-20 20:25:24 +00:00