Commit Graph

7156 Commits

Author SHA1 Message Date
Robert Phillips
bac46728fc Add a means of printing out the GrBackendFormat
Change-Id: I78b145765bc6ad2f0568ff9bee97397844c23728
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231557
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-01 20:42:32 +00:00
Greg Daniel
0258c90803 Remove use of isConfigRenderable.
Bug: skia:6718
Change-Id: I7eb25601e55042252a4fdcddfa4bb906ce0307dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231108
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-01 18:57:51 +00:00
Robert Phillips
ffe27290ff Add GrCaps::getTestingCombinations
This will decrease our reliance on GrPixelConfig for testing.

Bug: skia:6718
Change-Id: I951f57cce229792d994391dbba74dd206bbfb923
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230893
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-01 14:46:36 +00:00
Brian Salomon
8f8354a9a3 Reland "Remove GrCaps::SupportedRead::fSwizzle and supporting code"
This reverts commit a0f864d6ac.

Reason for revert: updated valgrind suppression

EXTRA_TRYBOTS=Test-Ubuntu18-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_SK_CPU_LIMIT_SSE41

Original change's description:
> Revert "Remove GrCaps::SupportedRead::fSwizzle and supporting code"
>
> This reverts commit 1cec69ae5c.
>
> Reason for revert: Causing Valgrind failures
>
> Original change's description:
> > Remove GrCaps::SupportedRead::fSwizzle and supporting code
> >
> > Add weird color types that handle the swizzling.
> >
> > Change-Id: Ie37a00eb877fe5e519f7498bf749e02a2f1dc204
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230135
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com
>
> Change-Id: I710e1952f2cef1a1e6e7ccf408b8a71ce721c002
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231262
> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>

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

Change-Id: I367f62ba7349b112d0a2eb5340a37be938ad5ef5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231178
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-01 00:17:54 +00:00
Ben Wagner aka dogben
a0f864d6ac Revert "Remove GrCaps::SupportedRead::fSwizzle and supporting code"
This reverts commit 1cec69ae5c.

Reason for revert: Causing Valgrind failures

Original change's description:
> Remove GrCaps::SupportedRead::fSwizzle and supporting code
> 
> Add weird color types that handle the swizzling.
> 
> Change-Id: Ie37a00eb877fe5e519f7498bf749e02a2f1dc204
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230135
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I710e1952f2cef1a1e6e7ccf408b8a71ce721c002
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231262
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-07-31 23:55:31 +00:00
Hal Canary
d7cf0be186 SkPDF: SkPDFMakeShader handles pathological inputs better.
Also add a unit test that crashes before this change.

Change-Id: I94e441a57a9c28e7c12bc2b214a65b41446ffab8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230754
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-07-31 16:23:35 +00:00
Brian Salomon
1cec69ae5c Remove GrCaps::SupportedRead::fSwizzle and supporting code
Add weird color types that handle the swizzling.

Change-Id: Ie37a00eb877fe5e519f7498bf749e02a2f1dc204
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230135
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-31 15:48:45 +00:00
Mike Klein
9fdadb949f test a (the) zero-arg program
Just because a program doesn't read from or
write to memory doesn't mean it's pointless.

Oh wait, yes it does.  It shouldn't crash though.

Change-Id: I6a9c26c065831f9598afccce6e0a34a178cbd925
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230839
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-30 19:58:37 +00:00
Mike Klein
d4546d6c4c add vmovdqa(ymm,ymm)
Fills in a little TODO.
Also add assembler unit tests for similar float->int and int->float.

Tested by SkVM_mad, SkVM_madder.

Change-Id: I5334029927fdecb0ff7f5a3b081cf2ce7b23995c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230838
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-30 18:43:35 +00:00
Chris Dalton
95d8ceb955 Add GrMipMapsStatus to GrTextureProxy
Bug: skia:
Change-Id: I5adf10f730b04c2b3b62c3b12aa5899da4db3431
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229922
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-30 18:04:04 +00:00
Robert Phillips
0a15cc62a8 Propagate GrRenderable flag to GrCaps::getBackendFormatFromColorType
This makes calling GrCaps::getBackendFormatFromColorType equivalent to calling GrContext::defaultBackendFormat

Change-Id: Ic402245fa0502920c47c2a29aadc4e559abdc09b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230416
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-30 17:45:45 +00:00
Mike Klein
81d526703c more unit tests
Backfill tests for some uncovered operations.

Mostly functional tests, with some targeted at particular
corners of code generation, and a few assembler unit tests.

This doesn't get up to 100% line coverage, but I think it
covers all the non-failure cases.

Change-Id: Ib701df0c505aa41e3b2fe3cd429447acb294b752
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230837
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-30 17:35:15 +00:00
Mike Klein
5591fdf930 small refactors
Change-Id: I58b52d3e1d05d0834be30e00d991636e227cbf0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230836
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-30 15:43:13 +00:00
Robert Phillips
d5e80ca8ea Add GrContext::defaultBackendFormat
TBR=bsalomon@google.com
Bug: 987392
Change-Id: I38ff649b25e78c0a02a8fd20f513db4be62abf43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229919
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-30 14:05:28 +00:00
Robert Phillips
8ff8bccf77 Add GrCaps::isFormatCompressed
This is part of trying to remove uses of GrPixelConfig from the proxy provider

Change-Id: I12d085cfbff86d0e44829ce3ee36744b937b804e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230576
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-30 13:47:58 +00:00
Mike Reed
9dc0b9e2f8 remove code now that loopers are dead (w.r.t. canvas and paint)
We can't remove the loopers themselves, as they are still used
by android and chrome (they just don't ever pass them to skia).

Eventually each of those clients will resolve this, but for now
we just keep the classes (and tests) in skia.

Bug: skia:4783
Change-Id: I5f507e6bb82280f2bc7c0b21eebe59c287aa9265
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230579
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-30 12:49:28 +00:00
Mike Klein
8ac9f4e5b2 flesh out SkVM ops a bit more
Add missing comparison and selection ops, bit casts, 16-bit memory
operations, gathers, uniform loads, and fill in math holes where
reasonable.  Update some names to be a bit more regular.

I think all instructions are implemented in the interpreter,
and many tested.  More testing and JITs to follow.

Change-Id: I8cf377e8b72a86ac950e020892ce82b39e9d7277
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229893
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-29 20:43:10 +00:00
Ethan Nicholas
1386366e01 renamed SkSL texture() and process() to sample()
Bug: skia:
Change-Id: I2ae0caf08f8434302cae8151ae1ea0fda8d56928
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230397
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-07-29 17:37:38 +00:00
Brian Osman
886af0dae3 Allow defined functions in the SkSL .inc files
Use that to implement many intrinsics in SkSL for the interpreter.

Change-Id: I3762867781cb1a053429fd37b12ae3cf7739cb3c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230134
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-07-29 17:10:48 +00:00
Greg Daniel
7bf37e07c3 Fix valgrind crash in TransferFrom test.
Change-Id: Iac78e5a832d209227cca58dd9f359e3d4dbd7da6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230396
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-29 14:38:06 +00:00
Robert Phillips
b7f95d1c16 Switch BackendAllocationTests from GrPixelConfig to GrColorType
Bug: skia:6718
Change-Id: Ifd78a1b227dc468ce882cf3caf78b4fae80cc006
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229386
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-07-29 13:26:06 +00:00
Brian Salomon
6f6d2de95c Test more color types in TransferPixelsFrom.
Change-Id: I55f04660c35595d53e6ad1753d3f922578cdf681
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229978
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-26 21:25:10 +00:00
Brian Salomon
42be09d535 Test GrGpu::transferPixelsTo for more color types.
Change-Id: Ibae377f01c1ed37c5dfac50a085c7eb97e93f24b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229376
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-26 16:48:12 +00:00
Greg Daniel
ba88ab65b3 Reland "Move ExternalFormat and Type to FormatInfo."
This reverts commit e2c5e8c7ee.

Reason for revert: relanding with fix

Original change's description:
> Revert "Move ExternalFormat and Type to FormatInfo."
>
> This reverts commit 80140518ef.
>
> Reason for revert: probably breaking angle
>
> Original change's description:
> > Move ExternalFormat and Type to FormatInfo.
> >
> > This also deletes the ConfigInfoTable in GrGLCaps as there is no more use
> > of it.
> >
> > Additionally with the rework of storing External Io info on the format table
> > I rewrote the implimination of supportedReadPixels and supportedWritePixels
> > for GL to loop over the supported types looking for a match instead of
> > simply defaulting to a base value.
> >
> > Finally transferFromOffsetAlignment has been rolled into the SupportedRead
> > instead of being its own query.
> >
> > Bug: skia:6718
> > Change-Id: I39f77adf6c0b5b38245e55e8a7e18c0b428862d0
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229381
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: Ifef2e7308fdb4d91d649f08488b798815e0aa5fa
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:6718
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229896
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ida09be706b461cf89467fc0082744177e71e8985
Bug: skia:6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229918
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-26 13:17:16 +00:00
Mike Reed
59f2e46ab4 Return translate info from looper, rather than moding a canvas
Change-Id: Ibb4520030bc0ca455fa079d923fd4f5be86d72a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229837
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-25 20:39:13 +00:00
Greg Daniel
e2c5e8c7ee Revert "Move ExternalFormat and Type to FormatInfo."
This reverts commit 80140518ef.

Reason for revert: probably breaking angle

Original change's description:
> Move ExternalFormat and Type to FormatInfo.
> 
> This also deletes the ConfigInfoTable in GrGLCaps as there is no more use
> of it.
> 
> Additionally with the rework of storing External Io info on the format table
> I rewrote the implimination of supportedReadPixels and supportedWritePixels
> for GL to loop over the supported types looking for a match instead of
> simply defaulting to a base value.
> 
> Finally transferFromOffsetAlignment has been rolled into the SupportedRead
> instead of being its own query.
> 
> Bug: skia:6718
> Change-Id: I39f77adf6c0b5b38245e55e8a7e18c0b428862d0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229381
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ifef2e7308fdb4d91d649f08488b798815e0aa5fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229896
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-25 18:46:44 +00:00
Brian Salomon
f27e51f8a7 Fix two issues in transfer to test
1) Use buffer wider than texture when write pixels row bytes *is* supported
2) Fix buffer rowbytes/size calculation

Change-Id: I458010e75a42ada9b0fa9628fa0d2d4a3d823162
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229816
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-25 18:30:31 +00:00
Greg Daniel
80140518ef Move ExternalFormat and Type to FormatInfo.
This also deletes the ConfigInfoTable in GrGLCaps as there is no more use
of it.

Additionally with the rework of storing External Io info on the format table
I rewrote the implimination of supportedReadPixels and supportedWritePixels
for GL to loop over the supported types looking for a match instead of
simply defaulting to a base value.

Finally transferFromOffsetAlignment has been rolled into the SupportedRead
instead of being its own query.

Bug: skia:6718
Change-Id: I39f77adf6c0b5b38245e55e8a7e18c0b428862d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229381
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-25 18:05:38 +00:00
Mike Klein
52337de95c re-run tools/rewrite_includes.py
PS2 adds a rewrite for Skia #include <...> to #include "...", letting
them be otherwise rewritten and sorted too.  (We do need one exception
for the Vulkan headers, which will otherwise be rewritten to always
point to our own.)  I don't think it's particularly important to
favor "" or <>, but picking one keeps things consistent.

PS3 adds a missing SkMutex.h include.

PS4 fixes a terrible readability problem.

Change-Id: Id9fe752727ef30e802b1daf755ee2ed15e267577
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229742
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-07-25 15:40:33 +00:00
Robert Phillips
62221e768c Delete GrBackendSurface's GrPixelConfig
This member variable is no longer used

TBR=bsalomon@google.com
Bug: skia:6718
Change-Id: I84680c8c3bc36eefa603f5be7f3c15b496a79948
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229478
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-25 15:18:08 +00:00
Hal Canary
a1730e18f1 SkMetaData: remove unused features
Change-Id: Iecd80244b3803b6d5916bfd793741e67f05d0d46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227437
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2019-07-25 15:15:22 +00:00
Ethan Nicholas
c6dce5ac87 Child fragment processors are now written as separate functions
Bug: skia:
Change-Id: Icbf8f542637a874b3e2d3513d932b39728fa5e77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229385
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-07-25 14:48:47 +00:00
Brian Osman
b380e71cfe Interpreter: Add radians and normalize builtins
Change-Id: I2c76d8cbcfc3f36448127de5a3e1a22f76eda863
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229489
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-07-25 14:23:37 +00:00
Mike Reed
6d907faa7d add copytable method to typefaces
This allows some backends to efficiently retrieve a copy of the data.

Inspired by https://skia-review.googlesource.com/c/skia/+/229136

Change-Id: I9b0345333e30376a50a5dc7c9e993b847e2791c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229384
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-07-24 19:20:46 +00:00
Chris Dalton
bbb3f646f8 Add a workaround for PowerVRRogue to never disable color writes
Instead we leave color writes enabled and use a blend state that
preserves the dst color. This allows us to re-enable msaa ccpr on
PowerVR.

Bug: skia:
Change-Id: I1e902d695ad483ffb13dff6a7920749e307b49c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229387
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-24 17:30:35 +00:00
Robert Phillips
4d87b2bdf6 Address TODO in testing code (i.e., cleanup create_backend_texture)
This is left over from:

https://skia-review.googlesource.com/c/skia/+/212408 (Add test for DDLs and SkSurface::flush)

Change-Id: I45797385d5ce33d4197284d53c9ec73e1a9c5e2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212506
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-23 18:10:46 +00:00
Robert Phillips
c80b0e9541 Make rest of GrGpu::wrapBackend* methods take a GrColorType (take 2)
This CL is intended to further wean Ganesh off of using the GrBackendTexture's pixel config

TBR=bsalomon@google.com
Bug: skia:6718
Change-Id: Iedaa7811f9c4aac552f219c702627bc476325317
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228338
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-23 16:13:30 +00:00
Brian Salomon
27b4d8d8db Remove sample count from GrSurfaceDesc.
This leaves just width, height, and GrPixelConfig. Once we remove the
latter we can replace GrSurfaceDesc with SkISize.

Also remove unused GrRenderTarget::overrideResolveRect

Also remove GrSurfaceProxy::Renderable and use GrRenderable instead.

Change-Id: I652fe6169a22ca33d199b144ec6385286ac07b5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228570
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-23 13:42:29 +00:00
Julia Lavrova
5207f35f33 The current version...
Adding cache
Caching shaped results
Base+Index for referencing arrays
The very first and naive version of cache
Cache measurement, lines and picture
Added text blob cache for lines
Removed Run* from Cluster
Removed const char* from Cluster and Run
Few minor changes

Change-Id: I444a1defa950aed5999cfa1c3545fd83ccb54ce9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227840
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-23 13:31:39 +00:00
Mike Klein
f98d0d31c4 let JIT code hoist when possible
This first tries to JIT while hoisting all constants,
and if that fails, tries again hoisting no constants.

I figure this is one of those 80/20 deals for how to
handle constant hoisting and register pressure.  This
probably mostly moots doing anything fancy like using
memory operands with AVX or lane operands with NEON.

This _doesn't_ moot hoisting the NEON tbl arguments,
which is not yet done here, but probably my next CL.

Change-Id: Id09d5cdddcdb45207bdfc914a5a3128a481a26f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229058
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-22 21:06:34 +00:00
Mike Reed
b7dad44040 Reland "hide drawlooper from paint"
This reverts commit 6dc14ded91.

Reason for revert: add flag to google3

Original change's description:
> Revert "hide drawlooper from paint"
>
> This reverts commit 766b42b7ba.
>
> Reason for revert: afaict this is changing a lot of image filter GMs for the worse
>
> Original change's description:
> > hide drawlooper from paint
> >
> > Bug: skia: 4783
> >
> > Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=fmalita@chromium.org,reed@google.com
>
> Change-Id: I0bfd48ada3f8e48a774527caccf7abdb7a1cc470
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia: 4783
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229005
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ib3cd8941a63cd323b8872dd7fec1c953ab81cbdc
Bug: skia: 4783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229010
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-22 20:03:36 +00:00
Ethan Nicholas
3908059bee fixed SkSL handling of constant arrays
Bug: skia:
Change-Id: Ib01a9a01a0e9e5c27ea5142f8141b769ef093669
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229012
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-07-22 19:37:40 +00:00
Mike Klein
5e533c9e1f move hoist analysis back into Builder
Even if a JIT ultimately doesn't end up hoisting any values, it's going
to want this information while it decides.  Writing it in one place also
ensures we only get it wrong in one place...

I'm no_ extending the lifetime of hoisted instructions here in Builder.
That's something to leave to the backend so they have the flexibility of
which of these values to hoist, if any.  If they don't hoist, they'll
need to know when the value dies.

Moving this information back here lets the test expectation goldens
reflect the hoist bit again too.  Kind of nice.

Change-Id: Ib165ca898a97c1d822cb28fe24f15bae4d570a17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229024
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-22 19:34:06 +00:00
Robert Phillips
6dc14ded91 Revert "hide drawlooper from paint"
This reverts commit 766b42b7ba.

Reason for revert: afaict this is changing a lot of image filter GMs for the worse

Original change's description:
> hide drawlooper from paint
> 
> Bug: skia: 4783
> 
> Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I0bfd48ada3f8e48a774527caccf7abdb7a1cc470
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia: 4783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229005
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-22 17:27:17 +00:00
Mike Reed
766b42b7ba hide drawlooper from paint
Bug: skia: 4783

Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-22 16:25:41 +00:00
Robert Phillips
ebab03ffbf Add Ganesh support for LUM16F (take 2)
When Chrome has a LUM16F texture they tell Skia it is R16F. Although this has been working for them so far it causes trouble with some upcoming changes.

Change-Id: I2473f70e4f725128f143c2dfb08adb79f3c7c166
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228565
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-22 14:13:36 +00:00
Chris Dalton
c3318f09cd ccpr: Add an MSAA atlas mode
Adds the option to use a multisampled (or mixed sampled) atlas, and
uses the sample mask and stencil buffer instead of coverage counts.

Bug: skia:
Change-Id: I9fb76d17895ae25208124f6c27e37977ac31b5eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227428
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-19 20:52:17 +00:00
Mike Klein
4a13119a60 always fma in mad_f32()
We can always move data around so that an FMA is possible using no more
registers than we would otherwise, and on x86, evne using no more
instructions.

The basic idea here is that if we can't reuse one of the inputs to
destructively host the FMA instruction, the next best thing is to copy
one of the arguments into tmp() and accumulate the FMA there.

Once the FMA has happened, we just need to copy that result to dst().
We can of course skip that copy if dst() == tmp().  On x86 we never need
that copy; dst() and tmp() are picked using the same logic except that
dst may alias one of its inputs, and we only fall into this case after
we've already found it doesn't.  So we can just assert dst() == tmp()
rather than check it like we do on ARM.

It's subtle, but I think sound.

I'm using logical-or to copy registers around.  This is a little lazy,
but maybe not as lazy as it looks: on ARM that is _the_ way to copy
registers.  There's a vmovdqa instruction I could use on x86, TBD.

All paths through this new code were being exercised on ARM, but we
didn't have anything hitting the tmp case on x86, so I've added a new
unit test that hits the corner cases of both implementations.

Change-Id: I5422414fc50c64d491b4933b4b580b784596f291
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228630
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-19 20:12:42 +00:00
Brian Salomon
e8a766b16c Move GrProtected off GrSurfaceDesc and pass separately.
Change-Id: If628c13bb0e5aa885e4249a37432ba572e65d920
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228440
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-19 19:03:19 +00:00
Florin Malita
673e87cda9 [svgcanvas] Consolidate constant-Y text positions
When SkBaseDevice switched to drawGlyphRunList(), we lost the ability to
detect a) constant-Y text and b) default-positioned text.

As a result, the emitted SVG contains lots of redundant/repeating glyph
positions.

This CL enhances SVGTextBuilder to detect and consolidate constant-Y
glyph positions.

Also restore a useful whitespace unit test.

Change-Id: I50568aef1955f75898ebab41441ad5fe418dac43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228563
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-19 18:53:32 +00:00