Commit Graph

5451 Commits

Author SHA1 Message Date
Mike Klein
63789ccc03 Revert "Remove SkColorSpace_Base::MakeNamed, along with most uses of Adobe RGB"
This reverts commit 411b8ea74d.

Reason for revert: a couple layout tests in the roll.  :/

Original change's description:
> Remove SkColorSpace_Base::MakeNamed, along with most uses of Adobe RGB
> 
> Bug: skia:
> Change-Id: If5935eac48184bc8cbe4db21dac4d6033a8704e6
> Reviewed-on: https://skia-review.googlesource.com/84200
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>

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

Change-Id: I6d2eb57b613035ec26da15218182c808bed364ed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/84920
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2017-12-14 12:10:12 +00:00
Brian Osman
411b8ea74d Remove SkColorSpace_Base::MakeNamed, along with most uses of Adobe RGB
Bug: skia:
Change-Id: If5935eac48184bc8cbe4db21dac4d6033a8704e6
Reviewed-on: https://skia-review.googlesource.com/84200
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-12-13 21:34:30 +00:00
Robert Phillips
b67821da87 Add GrBackendTexture & GrBackendRenderTarget access methods to GrTexture and GrRenderTarget
Change-Id: I627fcc2cab1d04169f49e33a6c17e161e9a9772a
Reviewed-on: https://skia-review.googlesource.com/84621
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-12-13 21:34:20 +00:00
Cary Clark
225825044d move divide by zero inside guard
speculative fix to see if this helps developer.
It's the right thing to do in any case.

TBR=reed@google.com

Change-Id: I4fa576a096a6188f290957a7f2fabe73668f142d
Reviewed-on: https://skia-review.googlesource.com/84521
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-12-13 20:22:30 +00:00
Ethan Nicholas
2d5f9b3d58 converted GrMagnifierEffect to SkSL
Bug: skia:
Change-Id: I6dc14ac66d5b911117e71fa23fef49a897082781
Reviewed-on: https://skia-review.googlesource.com/71342
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-12-13 20:01:40 +00:00
Robert Phillips
e42edcc8ef Add stubbed out GrContext
This CL mainly just:
   stores the GrContextOptions in GrContextThreadSafeProxy (so they can be passed on to a stubbed out GrContext)
   adds a method to create a stubbed out GrContext that has a GrStubGpu
      - the stubbed out GrContext isn't quite ready for prime time yet

Change-Id: I31be6763640e406c5963e6f0714489ac358339e4
Reviewed-on: https://skia-review.googlesource.com/79601
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-12-13 18:24:30 +00:00
Mike Reed
45ab630045 Revert "Revert "impl SkSerial picture procs""
This reverts commit 2a3009931d.

Implement SkSerialProcs for pictures

Bug: skia:
Change-Id: Icde2d912941a19999e204ac5213f519ed5387e12
Reviewed-on: https://skia-review.googlesource.com/84480
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-13 17:02:10 +00:00
Mike Reed
2a3009931d Revert "impl SkSerial picture procs"
This reverts commit c822672854.

Reason for revert: broke old skps

Original change's description:
> impl SkSerial picture procs
> 
> The picture serialization code is a bit of a mess, with duplicated functions for streams and buffers.
> Could not see how to fix that and land this at the same time, but I will try to circle back and
> simplify if possible afterwards.
> 
> Bug: skia:
> Change-Id: I9053fdc476c60f483df013d021e248258181c199
> Reviewed-on: https://skia-review.googlesource.com/83943
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I68ae019a286691b65cc373cb29c941d6620fd34a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/84460
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-13 15:16:53 +00:00
Mike Reed
c822672854 impl SkSerial picture procs
The picture serialization code is a bit of a mess, with duplicated functions for streams and buffers.
Could not see how to fix that and land this at the same time, but I will try to circle back and
simplify if possible afterwards.

Bug: skia:
Change-Id: I9053fdc476c60f483df013d021e248258181c199
Reviewed-on: https://skia-review.googlesource.com/83943
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-13 13:41:32 +00:00
Brian Osman
36703d9d36 Push much of the SkColorSpace_Base interface up to SkColorSpace
Some pieces still remain, but the next step looks less mechanical,
so I wanted to land this piece independently.

Bug: skia:
Change-Id: Ie63afcfa08af2f6e4996911fa2225c43441dbfb2
Reviewed-on: https://skia-review.googlesource.com/84120
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-12-12 19:34:29 +00:00
Robert Phillips
d21b2a5d5c Remove GrBackendObject from tests (except image_from_yuv_textures)
This sets the stage for landing https://skia-review.googlesource.com/c/skia/+/82823 (Update SkImage::MakeFromYUVTexturesCopy to GrBackendTexture)

Change-Id: I2c62f23dc447b9ad55c0b5f06bcd6d7ca0ec4d2b
Reviewed-on: https://skia-review.googlesource.com/83920
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-12-12 18:45:09 +00:00
Hal Canary
925e31e749 dm: require tmpDir, reasonable defaults
Change-Id: I9d84ce1ebbe417160a29ca2221b1df04901238e3
Reviewed-on: https://skia-review.googlesource.com/83541
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2017-12-12 18:22:39 +00:00
Ethan Nicholas
e7e81c15c1 converted vertex shaders to device coords
Bug: skia:6239
Change-Id: I1a3b67fe84d208d426d71deb7aea6b0cd433af37
Reviewed-on: https://skia-review.googlesource.com/75501
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-12-12 15:24:09 +00:00
Chris Dalton
344e9037e1 Prefer fullscreen clears on Qualcomm/GL
Adds Qualcomm to the set of GL devices on which we prefer fullscreen
clears.

Renames fullscreenClearIsFree in GrCaps to preferFullscreenClears.

Replaces 'bool canIgnoreClip' on GrRenderTargetContext::clear with an
enum.

Bug: skia:
Change-Id: I5b30298c4d0b092c398b9fea6060f3e2bea91e46
Reviewed-on: https://skia-review.googlesource.com/83060
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-12-12 15:21:09 +00:00
Hal Canary
a4935104a5 resources: optionally link them into our binary
To enable, set skia_embed_resources=true in args.gn.

Also add *-EmbededResouces bots.

Change-Id: Ia69b26e926a3ad4676a4fa021894432ea2104538
Reviewed-on: https://skia-review.googlesource.com/82626
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2017-12-11 22:06:38 +00:00
Mike Reed
58a3fcd4b3 add virtual to confirm flattenable type
meant to replace https://skia-review.googlesource.com/c/skia/+/83381

Bug:793639
Change-Id: I972dc80725bf5ce5be24769aafa23269735e089c
Reviewed-on: https://skia-review.googlesource.com/83444
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-12-11 18:50:00 +00:00
Mike Reed
0933bc9b67 Revert "Revert "resources: remove most uses of GetResourcePath()""
This reverts commit cca2300559.

Reason for revert: think I guessed wrong about g32 -- unreverting

Original change's description:
> Revert "resources: remove most uses of GetResourcePath()"
> 
> This reverts commit 5093a539de.
> 
> Reason for revert: google3 seems broken
> 
> Original change's description:
> > resources: remove most uses of GetResourcePath()
> > 
> > Going forward, we will standardize on GetResourceAsData(), which will
> > make it easier to run tests in environments without access to the
> > filesystem.
> > 
> > Also: GetResourceAsData() complains when a resource is missing.
> > This is usually an error.
> > 
> > Change-Id: Iaf70b71b0ca5ed8cd1a5538a60ef185ae8736188
> > Reviewed-on: https://skia-review.googlesource.com/82642
> > Reviewed-by: Hal Canary <halcanary@google.com>
> > Commit-Queue: Hal Canary <halcanary@google.com>
> 
> TBR=halcanary@google.com,scroggo@google.com
> 
> Change-Id: Ic5a7c0167c995a672e6b06dc92abe00564432214
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/83001
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=halcanary@google.com,scroggo@google.com,reed@google.com

Change-Id: I5a46e4de61186a8a5eb9cacd3275e24e311d5a07
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/82942
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-09 01:27:50 +00:00
Mike Reed
cca2300559 Revert "resources: remove most uses of GetResourcePath()"
This reverts commit 5093a539de.

Reason for revert: google3 seems broken

Original change's description:
> resources: remove most uses of GetResourcePath()
> 
> Going forward, we will standardize on GetResourceAsData(), which will
> make it easier to run tests in environments without access to the
> filesystem.
> 
> Also: GetResourceAsData() complains when a resource is missing.
> This is usually an error.
> 
> Change-Id: Iaf70b71b0ca5ed8cd1a5538a60ef185ae8736188
> Reviewed-on: https://skia-review.googlesource.com/82642
> Reviewed-by: Hal Canary <halcanary@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

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

Change-Id: Ic5a7c0167c995a672e6b06dc92abe00564432214
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/83001
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-08 21:09:19 +00:00
Hal Canary
53e5e7d4ce resources: resource identifiers don't begin with leading slash
Change-Id: I52522ffffbf0f5176ac9156cd563b41d6fdde59f
Reviewed-on: https://skia-review.googlesource.com/82940
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-12-08 20:03:18 +00:00
Hal Canary
5093a539de resources: remove most uses of GetResourcePath()
Going forward, we will standardize on GetResourceAsData(), which will
make it easier to run tests in environments without access to the
filesystem.

Also: GetResourceAsData() complains when a resource is missing.
This is usually an error.

Change-Id: Iaf70b71b0ca5ed8cd1a5538a60ef185ae8736188
Reviewed-on: https://skia-review.googlesource.com/82642
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-12-08 19:30:48 +00:00
Mike Reed
8e74cbcd65 Revert "Revert "use serialprocs for typefaces""
This reverts commit 1a104bce20.

Change (from first version) is
- only signal error in readbuffer for corrupt stream, not default fonts
- change test to ensure a non-null typeface (i.e. MakeDefault())

Bug: skia:
Change-Id: I325445b56b0a402e1b89a2439df06e92314c793f
Reviewed-on: https://skia-review.googlesource.com/82687
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-08 18:50:41 +00:00
Cary Clark
1acd3c7e84 keep SVG arcs axis aligned with suppression
another attempt at https://skia-review.googlesource.com/c/skia/+/79423

this time, bracket change with SK_SUPPORT_LEGACY_SVG_ARC_TO
to avoid prematurely changing SVG layout test results.

R=djsollen@google.com
Bug: b:69622768
Change-Id: Ia929f89d4f4292dfead191a381cdb431f743726a
Reviewed-on: https://skia-review.googlesource.com/82723
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2017-12-08 18:34:11 +00:00
Hal Canary
c465d13e6f resources: orgainize directory.
Should make it easier to ask just for images.

Change-Id: If821743dc924c4bfbc6b2b2d29b14affde7b3afd
Reviewed-on: https://skia-review.googlesource.com/82684
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-12-08 17:16:00 +00:00
Mike Reed
4bcef3c40a minor cleanup to typeface serial test
Bug: skia:
Change-Id: I572fbcbb382a665c4e4e27a7cee718c4eaa7743d
Reviewed-on: https://skia-review.googlesource.com/82801
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-08 17:13:11 +00:00
Brian Osman
f55e1ef1ba Remove unused private field
(Found by latest version of clang)

Bug: skia:
Change-Id: Ia24e023ed0cd8296276dbdd6abff5e0017de02d3
Reviewed-on: https://skia-review.googlesource.com/82741
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-12-08 16:22:40 +00:00
Mike Reed
64f73764b7 return data instead of bool
Bug: skia:
Change-Id: Id7c3044a2fce087703544c624c75a7756b9c62b4
Reviewed-on: https://skia-review.googlesource.com/82602
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-08 15:58:00 +00:00
Brian Salomon
f06c358267 Remove instanced rendering
Change-Id: I4219b1d23a647b849ee41fe71b53e1c45edfc3f4
Reviewed-on: https://skia-review.googlesource.com/82241
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-12-08 13:41:10 +00:00
Greg Daniel
7af060a8bc Add gray_8_as_lum and _as_red private grpixelconfigs
Bug: skia:
Change-Id: I70cbd0bc9f7a7a16fb9f0688d272d7afa607700a
Reviewed-on: https://skia-review.googlesource.com/80622
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-12-07 20:52:40 +00:00
Brian Salomon
384fab467e sk_spification of GrGpu creation.
Make GrContext::MakeGL take interface as sk_sp.

Make GrContext::MakeVulkan take GrVkBackendContext as sk_sp.

Change-Id: I13c22a57bd281c51738f503d9ed3418d35a466df
Reviewed-on: https://skia-review.googlesource.com/81842
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-12-07 17:56:59 +00:00
Brian Salomon
4f5e1d4ff3 Remove SkImage deferred texture image data APIs.
These APIs existed for Chrome. Chrome is no longer using them.

Change-Id: I15a5e2f88c7e8d1356188748fc68d4658f6f1849
Reviewed-on: https://skia-review.googlesource.com/81021
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-12-07 13:13:20 +00:00
Mike Reed
fadbfcd4ab upgrade SkReadBuffer to always validate
Bug: skia:
Change-Id: I054560b66c6cde346d939015326d8547879d2c4b
Reviewed-on: https://skia-review.googlesource.com/81160
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-06 21:33:00 +00:00
Cary Clark
5104137844 Revert "keep SVG arcs axis aligned"
This reverts commit c382384848.

Reason for revert: need to add legacy flag to chrome first

Original change's description:
> keep SVG arcs axis aligned
> 
> Computing the arc width introduces rounding errors that cause the
> arc to exceed 1/4 circle and cause integer anchored arcs to start
> outside their marks. A round rect may lose convexity as a result.
> 
> Check if arcTo() inputs are integers and arc is 90 degrees;
> if so, output conics which are axis-aligned on integers as well.
> 
> This is triggered when using SVG to represent a round rect.
> 
> Possible future enhancements are recorded in bug.skia.org/7383
> 
> R=​reed@google.com,djsollen@google.com
> Change-Id: I6609456fcefabcda6c9560a044533ecb5cda2d31
> Reviewed-on: https://skia-review.googlesource.com/79423
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>

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

Change-Id: Ia503ea62def15322df2b11da30d377a9543d6999
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/81281
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-12-06 20:07:56 +00:00
Mike Klein
0554d497f8 add SkVptr()
I was wondering how feasible using this to make downcasts safe would be.
These tests would need to build and pass on all our bots, at least.

Change-Id: I1753ba58841bf6c17d6ac3af7374518356e1bb05
Reviewed-on: https://skia-review.googlesource.com/81180
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-12-06 19:37:27 +00:00
Cary Clark
c382384848 keep SVG arcs axis aligned
Computing the arc width introduces rounding errors that cause the
arc to exceed 1/4 circle and cause integer anchored arcs to start
outside their marks. A round rect may lose convexity as a result.

Check if arcTo() inputs are integers and arc is 90 degrees;
if so, output conics which are axis-aligned on integers as well.

This is triggered when using SVG to represent a round rect.

Possible future enhancements are recorded in bug.skia.org/7383

R=reed@google.com,djsollen@google.com
Change-Id: I6609456fcefabcda6c9560a044533ecb5cda2d31
Reviewed-on: https://skia-review.googlesource.com/79423
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2017-12-06 16:50:39 +00:00
Chris Dalton
a3e9271ec4 CCPR: Eliminate texel buffers
Points cost 8 bytes and indices cost 4. If a point is accessed twice,
it's a wash whether we duplicate it or index. This change eliminates
texel buffers by duplicating points across instance arrays. This
reduces our dependence on extensions as well as getting rid of our
indirect memory access pattern in vertex shaders.

As a result of this change, memory usage by GPU buffers will only be a
fraction larger at worst, and slightly better at best.

Bug: skia:
Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD
Change-Id: I3c7f03772edd4f850d5fdd7b55552647335c1b52
Reviewed-on: https://skia-review.googlesource.com/79185
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-12-05 21:12:48 +00:00
Mike Reed
60691a5127 add serial procs to pictures
Bug: skia:7380
Change-Id: Ic1b7e437316c7913711cf5cb119e3fe904cd2c05
Reviewed-on: https://skia-review.googlesource.com/76980
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-12-05 20:33:18 +00:00
Leon Scroggins III
c8037dc5ed Reland "Hide SkEncodedInfo"
This partially reverts commit
1793e7bb46.

Hide SkEncodedInfo

Bug: skia:7353
Bug: skia:6839

This contains information that is not necessary for clients to know. The
Color enum tells the number of components in the input, but this is only
interesting internally (to the SkSwizzler).

Similarly, the Alpha enum differs from SkAlphaType in that it has
kBinary instead of kPremul. This is useful information only internally
for determining whether the SkColorSpaceXform needs to premultiply.

The bitsPerComponent is potentially useful for a client; Android (in
SkAndroidCodec) uses it to determine the SkColorType. Rather than
exposing bitsPerComponent, make SkAndroidCodec a friend so it can
access the SkEncodedInfo. A future change will change SkCodec to
recommend F16 for bitsPerComponent > 8, but that will be more involved;
it was the reason for the revert of this CL.

Switch conversionSupported to use an SkColorType, which is enough info.

Replace the SkEncodedInfo::Alpha field on SkCodec::FrameInfo with an
SkAlphaType.

SkCodec still needs an SkEncodedInfo, so move its header (which is
already not SK_API) to include/private.

TBR=mtklein@chromium.org,reed@google.com
Change-Id: I928b1f55317602cb37d29da63b53026c8d139cee
Reviewed-on: https://skia-review.googlesource.com/80860
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-12-05 19:28:08 +00:00
Chris Dalton
a32a3c32c3 Add analytic clip FPs that read from the CCPR atlas
Bug: skia:7190
Change-Id: Ie31d368f52910e6917efdeb1b024370b06fc11ee
Reviewed-on: https://skia-review.googlesource.com/77160
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-12-05 18:06:18 +00:00
Brian Salomon
1447177005 Avoid GrEllipseEffect for small radii on devices without 32 bit float.
Also limit small radius bail in GrCircleEffect to clip out cases.

Change-Id: I14ce736969b05203219d68f30283c36c84f78f3a
Reviewed-on: https://skia-review.googlesource.com/80621
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-12-05 15:56:01 +00:00
Leon Scroggins
1793e7bb46 Revert "Hide SkEncodedInfo"
This reverts commit c6f7a4ffa9.

Reason for revert: Causing differences in Gold, stemming from the fact that this changes the recommended SkImageInfo for 16 bits-per-component PNG from N32 to F16.
- an F16 bitmap already png-encodes to a 16 bits-per-component PNG, but it does not encode a linear colorspace (possibly a bug?). when we decode this PNG using getInfo(), it fails because it has an F16 color type and non-linear colorspace. (In the encode-srgb-png gm, this results in blank results for F16.) We could correct this on the encoder side, but it seems possible that a 16 bits-per-component PNG could be encoded with a different color space. In that case, we'd want SkCodec to recommend F16/SRGBLinear, but I think we'd want the SkCodec to store the encoded SkColorSpace so that we can Xform between the two. Currently SkCodec only stores one color space, so that will require a refactor.
- When decoding 16-bits-per-component PNGs, we are now decoding them to F16. This shows differences in Gold. The srgb/gpu results now look more like F16. I think this is fine.

Original change's description:
> Hide SkEncodedInfo
> 
> Bug: skia:7353
> Bug: skia:6839
> 
> This contains information that is not necessary for clients to know. The
> Color enum tells the number of components in the input, but this is only
> interesting internally (to the SkSwizzler).
> 
> Similarly, the Alpha enum differs from SkAlphaType in that it has
> kBinary instead of kPremul. This is useful information only internally
> for determining whether the SkColorSpaceXform needs to premultiply.
> 
> The bitsPerComponent is potentially useful for a client; Android (in
> SkAndroidCodec) uses it to determine the SkColorType. Rather than
> exposing bitsPerComponent, use it to make the same decision that Android
> would have made - 16 bits per component means to set the info to F16. Add
> a test that computeOutputColorType behaves as expected.
> 
> Switch conversionSupported to use an SkColorType, which is enough info.
> 
> Replace the SkEncodedInfo::Alpha field on SkCodec::FrameInfo with an
> SkAlphaType.
> 
> SkCodec still needs an SkEncodedInfo, so move its header (which is
> already not SK_API) to include/private.
> 
> Change-Id: Ie2cf11339bf999ebfd4390c0f448f7edd6feabda
> Reviewed-on: https://skia-review.googlesource.com/79260
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Leon Scroggins <scroggo@google.com>

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

Change-Id: I0c5dd1461e1b70d1e55349a8e7ee6b029c3f556e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7353, skia:6839
Reviewed-on: https://skia-review.googlesource.com/80660
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-12-05 15:38:22 +00:00
Leon Scroggins III
c6f7a4ffa9 Hide SkEncodedInfo
Bug: skia:7353
Bug: skia:6839

This contains information that is not necessary for clients to know. The
Color enum tells the number of components in the input, but this is only
interesting internally (to the SkSwizzler).

Similarly, the Alpha enum differs from SkAlphaType in that it has
kBinary instead of kPremul. This is useful information only internally
for determining whether the SkColorSpaceXform needs to premultiply.

The bitsPerComponent is potentially useful for a client; Android (in
SkAndroidCodec) uses it to determine the SkColorType. Rather than
exposing bitsPerComponent, use it to make the same decision that Android
would have made - 16 bits per component means to set the info to F16. Add
a test that computeOutputColorType behaves as expected.

Switch conversionSupported to use an SkColorType, which is enough info.

Replace the SkEncodedInfo::Alpha field on SkCodec::FrameInfo with an
SkAlphaType.

SkCodec still needs an SkEncodedInfo, so move its header (which is
already not SK_API) to include/private.

Change-Id: Ie2cf11339bf999ebfd4390c0f448f7edd6feabda
Reviewed-on: https://skia-review.googlesource.com/79260
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-12-05 00:52:42 +00:00
Robert Phillips
8d1e67ed6b Add resource cache limits to SkSurfaceCharacterization
Change-Id: I4c3b2f1c6ecc39b2364cefae07d5dee5e3d20d60
Reviewed-on: https://skia-review.googlesource.com/79600
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-12-04 18:54:09 +00:00
Robert Phillips
7ffbcf909d Add unit test for SkDeferredDisplayLists (take 2)
Change-Id: I76a4c77d5b9418cb7fe677bd55ba32a2e336924d
Reviewed-on: https://skia-review.googlesource.com/79820
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-12-04 18:37:29 +00:00
Robert Phillips
8172c0a24a Revert "Add unit test for SkDeferredDisplayLists"
This reverts commit 8458a2807b.

Reason for revert: ??
Original change's description:
> Add unit test for SkDeferredDisplayLists
> 
> Change-Id: I015094145cb0af6cfe368c570a5d5280c11c8f28
> Reviewed-on: https://skia-review.googlesource.com/78660
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: Iec3abb18d3ed41fcfbec72bc2de14603f659f8ce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/79720
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-12-04 14:38:15 +00:00
Robert Phillips
8458a2807b Add unit test for SkDeferredDisplayLists
Change-Id: I015094145cb0af6cfe368c570a5d5280c11c8f28
Reviewed-on: https://skia-review.googlesource.com/78660
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-12-04 14:00:14 +00:00
Greg Daniel
10ed243e2e Add cap on intel to avoid calling abs and floor on the same line in a
shader.

This fixes a bug on some intel devices where we are failing
in the ProcessorOptimizationTest.

I've tried other "no op" type things between the floor call and abs which
also fixed the issue, as well as adding explicit checks to see if we are
less than -1 or greater than 1 where the clamp is. Thus the clamp itself
should be a no op and shouldn't secretly be fixing the problem outside
of forcing the floor and abs lines to be separate.

Bug: skia:
Change-Id: I85bf82e0e02607b78470b7a5f8f918e9f53f0154
Reviewed-on: https://skia-review.googlesource.com/76820
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-12-02 00:00:59 +00:00
Chris Dalton
0cb75879a5 Add Store3 to Sk2f
Bug: skia:
Change-Id: I0377e6a1dd8259e944f7902a5c68af524fa588c7
Reviewed-on: https://skia-review.googlesource.com/79382
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-12-01 21:12:49 +00:00
Cary Clark
afca4d6bc0 fix pathops handling of tiny wrapback quads and cubics
If a quad or cubic reverses on itself, path ops breaks
it in two. It determines the type of curve remaining,
but needs to replace near-zero with zero first.

TBR=reed@google.com
Bug:790731
Change-Id: I3a1afa14fff064ca874b5abc768ec1ec5c2cf22f
Reviewed-on: https://skia-review.googlesource.com/79400
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-12-01 20:48:40 +00:00
Mike Klein
213d821462 add Load2() to Sk4f
and test it.

Change-Id: Ib0c2cf93c63d8d3c36a7d4d60bbec4ecede29bc7
Reviewed-on: https://skia-review.googlesource.com/78480
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-12-01 19:26:02 +00:00
Chris Dalton
706a6ff60c Add "lazy" texture proxies
Adds ultra-deferred proxies that are instantiated by a user-supplied
callback during flush.

Bug: skia:7190
Change-Id: I75a7ac6dba953c3b0a99febc203a7f4d2f3789fc
Reviewed-on: https://skia-review.googlesource.com/76461
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-11-30 15:37:12 +00:00