Commit Graph

7033 Commits

Author SHA1 Message Date
Brian Salomon
a7de0f3231 Reenable GPU ReadPixels tests on ANGLE ES2
Bug: skia:6742
Change-Id: I96728c01e961c15085d44fdc7187806e363c27e3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224736
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-01 19:32:48 +00:00
Brian Salomon
1d43530aa2 Pass alpha type to GrSurfaceContext::read/writePixels and remove flags.
We deduce whether to premul or unpremul based on the the input/output
alpha types. This means we also now support unpremuling on write and
premuling on read.

Class-ify former struct GrPixelInfo. Remove origin and instead pass a
flip bool to GrConvertPixels.

Unifies read/write methods on GrSurfaceContext via automatic conversion
of SkImageInfo to GrPixelInfo and making GrDirectContext an optional
parameter.

Bug: skia:7580

Change-Id: I42f6997852b4b902fb81264c6de68ca9537606aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224281
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-01 17:30:40 +00:00
Mike Klein
1fa149a713 finish up arm64 ops
Some small refactoring to common up redundant opcode building.

Oddly, I think I've got better codegen than what Clang would do here.
Clang doesn't generate uxtl-based code to unpack 8-bit to 32-bit,
instead preferring to load each byte one at a time and insert them one
at a time.

Me:
    ldr  s0, [x0]
    uxtl v0.8h, v0.8b
    uxtl v0.4s, v0.8h

Clang:
    ldrb  w8,  [x0]
    ldrb  w9,  [x0, #1]
    ldrb  w10, [x0, #2]
    ldrb  w11, [x0, #3]
    fmov  s0,      w8
    mov   v0.s[1], w9
    mov   v0.s[2], w10
    mov   v0.s[3], w11

Change-Id: I0fdf5c6cdcde6a4eb9290936284fd3ffcb2159f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224821
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-01 17:26:03 +00:00
Robert Phillips
c046ff0b10 Add SkSurfaceCharacterization::isCompatible
Although the main change in this CL is the addition of GrCaps::areColorTypeAndFormatCompatible.

This is split out of:

https://skia-review.googlesource.com/c/skia/+/222781 (Add bridge between GrContext::createBackendTexture and SkSurface::MakeFromBackendTexture)

Change-Id: I2e50fff91eb07fb1358840e1a4a76dc138a2f195
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223932
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-01 15:15:12 +00:00
Greg Daniel
ab013ebe9c Move GL caps textureable and fbocolorattachment flags to FormatInfo.
Change-Id: I68d623151a64dd68a5ea7a396023c7909c6e48a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223798
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-28 19:43:37 +00:00
Brian Salomon
bb8dde8f7c Reland "Reland "Separate compressed and uncompressed texture functions""
This is a reland of c0519233cd

Original change's description:
> Reland "Separate compressed and uncompressed texture functions"
> 
> This is a reland of 9acfb33ad8
> 
> Original change's description:
> > Separate compressed and uncompressed texture functions
> > 
> > Change-Id: Iccf31e1e4dbebde8aab4bb9b57cfb0341bb05912
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223802
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> Change-Id: I9f212b7d34cf43216f7d2ec63b959b75fd6a71b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223992
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Change-Id: I0654a49dadfb56ad276051c8632b91da05bf24cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224181
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-27 17:09:24 +00:00
Greg Daniel
c29e6dc358 Disable texturing and rendering to F32 pixel configs.
Change-Id: Iefd29ceb5431a9e2e12a9fcdfcc548131b29032c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224187
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-27 16:48:48 +00:00
Michael Ludwig
425eb45435 Reland "Replace GrQuadList with variable-length quad buffer"
This reverts commit 19628ec144.

Reason for revert: fixed struct size on 32-bit iOS

Original change's description:
> Revert "Replace GrQuadList with variable-length quad buffer"
> 
> This reverts commit f281604429.
> 
> Reason for revert: Breaking G3 and iOS Build
> 
> Original change's description:
> > Replace GrQuadList with variable-length quad buffer
> > 
> > Change-Id: I5cc391e8d143032893511695961f5251f40e8291
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223803
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,michaelludwig@google.com
> 
> Change-Id: I55947c068c6472c301952e33cbc36d04505f9800
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223993
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I7522270d467faf0f4e777831e9186bad010409ab
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224184
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-06-27 14:58:09 +00:00
Greg Daniel
15500644c7 Revert "Reland "Separate compressed and uncompressed texture functions""
This reverts commit c0519233cd.

Reason for revert: breaking google3 cause of abort in constexpr

Original change's description:
> Reland "Separate compressed and uncompressed texture functions"
> 
> This is a reland of 9acfb33ad8
> 
> Original change's description:
> > Separate compressed and uncompressed texture functions
> > 
> > Change-Id: Iccf31e1e4dbebde8aab4bb9b57cfb0341bb05912
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223802
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> Change-Id: I9f212b7d34cf43216f7d2ec63b959b75fd6a71b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223992
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I9cee240b438a3682911a3c6cddadfe2062447b8c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223995
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-27 03:06:05 +00:00
Greg Daniel
e706735433 Reland "Removed made-up kSBGRA pixel config."
This reverts commit 70aae53d57.

Reason for revert: Relanding with fix

Original change's description:
> Revert "Removed made-up kSBGRA pixel config."
>
> This reverts commit ff95f6ca9d.
>
> Reason for revert: Broke command buffer GLBackendAllocationTest??
>
> Original change's description:
> > Removed made-up kSBGRA pixel config.
> >
> > We made up this pixel config and don't actually use it ourselves so lets
> > kill it for simplicity.
> >
> > Change-Id: I6ae1c78fe7ada336a2411d295e8836dfeecb2d5c
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223979
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com
>
> Change-Id: I62e954495a702c7ad050719d8a1d6c4abcea3f60
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223990
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: If8781567f065031c46bcea74098d32ed1bc72607
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223994
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-27 01:57:13 +00:00
Brian Salomon
c0519233cd Reland "Separate compressed and uncompressed texture functions"
This is a reland of 9acfb33ad8

Original change's description:
> Separate compressed and uncompressed texture functions
> 
> Change-Id: Iccf31e1e4dbebde8aab4bb9b57cfb0341bb05912
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223802
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Change-Id: I9f212b7d34cf43216f7d2ec63b959b75fd6a71b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223992
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-27 01:26:23 +00:00
Brian Salomon
19628ec144 Revert "Replace GrQuadList with variable-length quad buffer"
This reverts commit f281604429.

Reason for revert: Breaking G3 and iOS Build

Original change's description:
> Replace GrQuadList with variable-length quad buffer
> 
> Change-Id: I5cc391e8d143032893511695961f5251f40e8291
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223803
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: I55947c068c6472c301952e33cbc36d04505f9800
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223993
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-27 01:02:03 +00:00
Brian Salomon
70aae53d57 Revert "Removed made-up kSBGRA pixel config."
This reverts commit ff95f6ca9d.

Reason for revert: Broke command buffer GLBackendAllocationTest??

Original change's description:
> Removed made-up kSBGRA pixel config.
> 
> We made up this pixel config and don't actually use it ourselves so lets
> kill it for simplicity.
> 
> Change-Id: I6ae1c78fe7ada336a2411d295e8836dfeecb2d5c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223979
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I62e954495a702c7ad050719d8a1d6c4abcea3f60
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223990
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-26 23:52:13 +00:00
Mike Klein
e51632e8c5 128-bit load / store
Change-Id: I665f43279ac7bfd3dffbf38a10a571b959a3425c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223977
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-26 22:56:51 +00:00
Mike Klein
15a368d519 some scalar ops
Change-Id: I1603f89603755914ed91645a2e5eeb9c87f63bbe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223929
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-26 21:33:29 +00:00
Greg Daniel
ff95f6ca9d Removed made-up kSBGRA pixel config.
We made up this pixel config and don't actually use it ourselves so lets
kill it for simplicity.

Change-Id: I6ae1c78fe7ada336a2411d295e8836dfeecb2d5c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223979
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-26 21:25:41 +00:00
Greg Daniel
eed7d63f1c Disable VkTransitionExternalQueueTest.
Bug: skia:8936
Change-Id: If134f141cc357a0ebf60b2b70e54fa2d6dc619fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223928
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-26 20:42:51 +00:00
Brian Salomon
31539a8a92 Revert "Separate compressed and uncompressed texture functions"
This reverts commit 9acfb33ad8.

Reason for revert: vulkan bots failing

Original change's description:
> Separate compressed and uncompressed texture functions
> 
> Change-Id: Iccf31e1e4dbebde8aab4bb9b57cfb0341bb05912
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223802
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ic5cf829e2de0ef0f577072bd571fdee54a0a03a3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223987
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-26 20:37:40 +00:00
Michael Ludwig
f281604429 Replace GrQuadList with variable-length quad buffer
Change-Id: I5cc391e8d143032893511695961f5251f40e8291
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223803
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-06-26 19:53:42 +00:00
Brian Salomon
9acfb33ad8 Separate compressed and uncompressed texture functions
Change-Id: Iccf31e1e4dbebde8aab4bb9b57cfb0341bb05912
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223802
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-26 19:37:32 +00:00
Chris Dalton
b3c9745911 Remove "nvpr" configs
The majority of our gm testing has been disabling nvpr, which doesn't
match our real-world behavior where we use nvpr whenever available.
This CL fixes the issue by completely removing the explicit nvpr
configs. Now if we have nvpr, you get it.

This CL also lowers the nvpr priority in the path renderer chain and
adds a "NonNVPR" job on Quadro where we can continue to test our
non-nvpr codepaths on NVIDIA.

Bug: skia:
Change-Id: I6a36f1101c8218adcaaf10cab25d2c28e70371f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223828
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-06-26 16:53:50 +00:00
Robert Phillips
9907e6e476 Expose SkSurface::isCompatible
This is part of bridging the explicit backend surface API and making SkSurfaces

This is pulled out of:

https://skia-review.googlesource.com/c/skia/+/222781/ (Add bridge between GrContext::createBackendTexture and SkSurface::MakeFromBackendTexture)

Change-Id: Ib55bcd8a0d1a049f230314a8f8ba7a3951b06d5c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223707
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-25 19:52:23 +00:00
Herb Derby
a4eecd8041 findImage(const SkGlyph&) -> prepareImage(SkGlyph*)
Because it mutates the glyph.

Change-Id: Ic7ce320350764454d7a76335828d398f19b149d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223797
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-25 19:36:53 +00:00
Mike Klein
65809146b2 more aarch64 instructions
Change-Id: Iabb9a2357b9279ab6e5a3ee899c5d029d35499e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223697
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-25 19:33:53 +00:00
Brian Salomon
d628747dfb Make GrColorSpaceInfo store GrColorType.
This is largely redundant with GrPixelConfig. However, we intend to
remove GrPixelConfig.

Bug: skia:7580

Change-Id: I03d92303be832711f7821f8a97d36387c9b04a9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222883
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-25 14:29:09 +00:00
Mike Klein
9f4df80fda baby steps for aarch64 support
So far this is just as easy as I had hoped.

Change-Id: I5f69a900b32d9bf70156b55e334233d7376b820f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223340
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-25 13:40:49 +00:00
Mike Klein
88c0a90ee5 assemble directly into mmap'd memory
Instead of allocating into a std::vector, we do one quick first pass to
measure how much memory we need to allocate, mmap enough pages for that,
then another real writing pass.

This cuts a microsecond or so off the profile.  There's another
microsecond left to cut if we could eliminate that first measuring pass,
but I'm no longer sure it's easy to come up with a good upper limit on
the program size now that I'm thinking about the data part of the
program as well.

vpshufb is our current max instruction at 9 bytes of code, but that also
implies another 32 bytes of control data.  I'm not sure I feel very
clever allocating 41 * |instructions| bytes to be conservatively safe...
it seems like ridiculous overkill.

Ultimately I found it easier to just measure twice, cut once.

Change-Id: I16ccdafbc789711837b41b3d5a557808798eb1b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223305
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-25 03:02:28 +00:00
Brian Osman
1a79f0be15 ByteCode: Improved ExternalValue interface
Use float* to match the ByteCode run API (and make the sizing of data
clearer). Add a lane index to all external value calls. My upcoming
overhaul of the particle code needs this, but I wanted to break that
(large) CL up.

Change-Id: I0588cd7769a1dced9f088de5756947bb744c146b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223178
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-25 02:57:24 +00:00
Nigel Tao
1f1cd1f449 Pause Wuffs' getFrameCount in incremental decode
Bug: skia:8235
Bug: skia:8750
Change-Id: I7b8a6a1aba38ba2f16bd184253fbef2a37000cef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223016
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-06-24 20:10:02 +00:00
Herb Derby
511dcfc339 Remove getGlyphIDMatrics type calls.
Converting to glyph() style calls that return SkGlyph*. This is mainly preparation
for removing converting findImage(const SkGlyph&) to prepareImage(SkGlyph*).

+ Misc cleanups mainly fWidth -> width() type things.

Change-Id: Id5c9b0ba5856b3ea54353ece4d05fa495cc5a640
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223187
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-24 19:35:01 +00:00
Brian Salomon
bd0d3e4bce Fix EGLImageTest asserts on Android
Bug: skia:7580
Change-Id: Ifb7727bead43aecfcfae6a6f42ea38434110a99c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223195
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-24 18:53:33 +00:00
Robert Phillips
d8f79a27b0 Reduce GrCaps' reliance on GrPixelConfig
By itself this CL isn't all that compelling but I believe we need some intermediate path to wean ourselves off of GrPixelConfig. In particular, I believe isFormatTexturable will not need an SkColorType parameter in the future.

This is pulled out of:

https://skia-review.googlesource.com/c/skia/+/222781/ (Add bridge between GrContext::createBackendTexture and SkSurface::MakeFromBackendTexture)

which adds SkSurface::isCompatible - so the SkSurface_Gpu::isCompatible calls have been removed from this CL.

Change-Id: I6c2b8a2c4af98c1437b92c58513f34014e551b2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223188
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-24 18:29:15 +00:00
Brian Salomon
e7499c7e8a GrColorSpaceInfo stores SkAlphaType.
This means GrSurfaceContext's know their alpha type.
All GrRenderTargetSurfaceContexts are kPremul.

Make GrTextureProducer store GrColorSpaceInfo.

Bug: skia:7580
Change-Id: I5ff321ef52c0edd32e5fac99dff95d44aa66f592
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223184
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-24 17:48:01 +00:00
Mike Klein
2b7b2a2331 add bit_clear
I was just reading the ARM docs and realized that their BIC ("BIt
Clear") is the same as SSE's ANDN ("AND Not") instruction.  It's kind of
a neat little tool to have laying around... comes up more than you'd
think, and it's sometimes the clearest way to express what you're doing,
as in the changed program here where the comment is "mask away the low
bits".  That's a bit_clear with a mask for what you want to clear away!

And the real reason to write this up is that I want to have a CL to
point to that shows how to add an instruction top to bottom.

Change-Id: I99690ed9c1009427b3986955e7ae6264de4d215c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223120
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-06-24 16:31:15 +00:00
Emircan Uysaler
23ca4e7dc5 Enable creating protected vulkan backend
This CL allows user to indicate that they have a protected content in
GrVkBackendContext creation which results in protected CommandPool and Queue
usage.

Bug: skia:9016
Change-Id: I6a478d688b6988c2c5e5e98f18f58fb21f9d26ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210067
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Emircan Uysaler <emircan@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-24 16:04:00 +00:00
Chris Dalton
6ce447a4ec Eliminate mixed samples as an FBO type or AA type
From now on, sample counts always refer to the number of actual color
samples, and render targets don't have separate color and stencil
sample counts.

If mixed samples support is available when making a
"GrAAType::kCoverage" draw, then an op may attach and use a mixed
sampled stencil buffer internally. But this will all be invisible to
the client.

After this CL, we temporarily won't have a mode to use nvpr with mixed
samples. That will soon be fixed by a follow-on CL that enables nvpr
with mixed samples in the normal "gl" and "gles" configs.

Bug: skia:
Change-Id: I1cb8277f0d2d0d371f24bb9f39cd473ed5c5c83b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221878
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-24 04:08:45 +00:00
Mike Klein
6bbeb4ab72 remove xbyak
For now, disable the vpmovusdb AVX-512 instruction, using the compound
AVX2 fallback instead.  I need to learn how to encode EVEX prefixes
before we can use that, and it's not very important.

That's everything!  We're fully in control now, and should be able to
run this on any x86-64 Linux or Mac.  And we can relax some of the
defined(SKVM_JIT) guards so that, e.g., we can unit test Assembler even
on all platforms.

Stifle some warnings about ~bool by ~(int)bool.

Would like to enable when is_mac too but can't seem to get past
(bogus?) thread annotation on the bots.  My local Mac is fine. :/

Change-Id: If00bdd97ebd9684ed109933e2fa70c5e6f6ea339
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222631
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-22 00:16:38 +00:00
Mike Klein
f3881b278e vmovq
Change-Id: Id83573bb7e66c0a6316917ae17abe7f56a172941
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222629
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-21 22:01:14 +00:00
Mike Klein
ae51aa3adf vpmovzxbd
Change-Id: I3ae8b3a6a109f6286dfc28a1c2b8e9aea913bcae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222626
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-21 21:52:54 +00:00
Mike Klein
120d9e8e18 vmovups, both ways
Change-Id: I6790b59df1e4b4ee9b36b24819586411eff6324d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222623
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-21 21:47:44 +00:00
Mike Klein
060eaaaaef jne
Change-Id: Ie6b033367e24ae92f6e246963f1f014c4d7cf013
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222859
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-21 21:05:27 +00:00
Michael Ludwig
b4580351c7 Fix subset behavior in makeWithFilter.
Most image filters were fixed with just the changes to SkImage::makeWithFilter
and the changes to SkSpecialImage's subset handling (particularly the
raster backend that could read from a bitmap view, or ganesh impls that relied
SkSpecialImage::draw).

The gpu implementation for alpha threshold, blurs, matrix convolutions,
and displacement maps have been updated to account for the special image's
offset when it reads from the backing texture.

Change-Id: I8778aa373e60e9268961305057b2bf6da2bdb3af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221121
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-06-21 21:00:17 +00:00
Herb Derby
9b06f2168d Add API for glyph image data
Move the invariants for glyph image data into SkGlyph.

Change-Id: I1958612bb73cfffe42df19a11c8899048559013b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222876
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-21 19:56:17 +00:00
Mike Klein
04db9c265a vpshufb
Change-Id: If23681e7a34a091cb78e5bd469d71c56b9cf5dc8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222858
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-21 19:52:48 +00:00
Mike Klein
e505341a24 vbroadcastss
This shows off a little how easy backwards-only labels are.

The rip == rbp + Mod::Indirect convention isn't something
you'd be able to guess without just looking at the docs.

I'm not actually sure if you can only use rbp or also r13,
but LLVM seems to always do the equivalent of rbp... might
just be that high bit in VEX is ignored: they're registers
5 and 13, 8 apart, only distinguished by that bit.

Convenienly RIP addressing is always 32-bit, so there's
no benefit to spending time checking whether the offset
fits in a byte, though most of our offsets would.

Change-Id: I01b7fb1500667e1bf98490d5144459f92e1b375d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222857
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-21 19:28:37 +00:00
Nathaniel Nifong
0426c38daa Reland "Deserialize MultiPictureDocument based SKP files (with image sharing proc) in wasm debugger."
This is a reland of 7635013ad1

Original change's description:
> Deserialize MultiPictureDocument based SKP files (with image sharing proc) in wasm debugger.
> 
> Change-Id: I73affae3cd05a2aa6ac1c75c8e049d352bbf3a85
> Bug: 9176
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217135
> Commit-Queue: Nathaniel Nifong <nifong@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>

Bug: 9176
Change-Id: Ifef1ff45ac0013ba3015f88c7ecd75527b28b604
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222505
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2019-06-21 15:49:21 +00:00
Mike Klein
62392726b7 rearrange code,data -> data,code
By putting data first in descending alignment then code, we never need
any alignment padding.

This also makes all jumps and ip-relative data loads backward, so
they're really easy to assemble.  No need for any sort of deferred
where-does-this-label-mean logic; the label can just be a simple byte
offset established before you need to use it.

Nothing new switched off of Xbyak in this CL, but the rearrangement
makes the rest a lot easier.

The one downside I've found so far is that the disassembly of the
first instruction can get confused into data or other instructions,
e.g.

  63:   01 ff                           add    %edi,%edi
  65:   00 ff                           add    %bh,%bh
  67:   00 00                           add    %al,(%rax)
  69:   ff 00                           incl   (%rax)
  6b:   ff c4                           inc    %esp
  6d:   e2 7d                           loop   ec <skvm-jit-884702985+0xac>
  6f:   18 05 eb ff ff ff               sbb    %al,-0x15(%rip)        # 60 <skvm-jit-884702985+0x20>
  75:   c4 e2 7d 18 0d e6 ff ff ff      vbroadcastss -0x1a(%rip),%ymm1        # 64 <skvm-jit-884702985+0x24>
  7e:   c4 e2 7d 18 15 e1 ff ff ff      vbroadcastss -0x1f(%rip),%ymm2        # 68 <skvm-jit-884702985+0x28>

There are 3 vbroadcastss instructions here, each starting with c4 e2 7d
18, but the first has been disassembled as if its c4 were part of the
last data entry (0xff00ff00) as inc %esp.

Probably not a big deal for now, particularly since those vbroadcastss
are all outside the loop and never show up on a profile.  If it gets too
confusing I think we can dump the programs starting from the beginning
of the code instead of from the data; we won't be able to inspect the
data, but everything should disassemble perfectly.

Change-Id: I0cc864359fd0740fc026070eaf2b6cb130783a57
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222574
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-21 15:38:41 +00:00
Brian Osman
d3494ede8d ByteCode: Support out params in local function calls
Change-Id: I1d133259264adfdc872b0f4aeaa9390363c46341
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222040
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-21 13:55:15 +00:00
Robert Phillips
82774f8bad Cleanup some legacy instantiate calls
Since explicit resource allocation has stuck these instantiate calls are no longer required.

Change-Id: I5a8a7fa714eb1e9550f4f645ce8fced2d5f7aa4e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222457
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-21 12:31:24 +00:00
Mike Klein
ff0ae81e74 two register + immediate ops
The encoding kind of all goes through the same paths,
as the three argument instructions, but like the nursery
rhyme when there are only two they kind of all roll over
and the op-extension hops into the bed.

vpermq is the first place we need to set the W bit
to indicate a 64-bit lane operation, so a little
minimal plumbing for that.  It takes its arguments
a little differently too, passing dst where you'd
expect, the source where we'd pass y, and requiring
us to pass literal 0000 for the vvvv bits in VEX
(inverted as normal to literal 1111).

Change-Id: I91a4cd1b316eb908992631ce8b2cb3c62078e8c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222565
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-20 21:25:16 +00:00