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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>