Commit Graph

6983 Commits

Author SHA1 Message Date
Brian Osman
fba386b940 ByteCode: Allow calls to functions that return void
Change-Id: Ia2e21bc984c509cd2405499f93ee5e19941cc492
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222499
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-20 19:29:40 +00:00
Brian Salomon
384981be3d Revert "Deserialize MultiPictureDocument based SKP files (with image sharing proc) in wasm debugger."
This reverts commit 7635013ad1.

Reason for revert: breaking bots 

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>

TBR=djsollen@google.com,mtklein@google.com,kjlubick@google.com,reed@google.com,nifong@google.com

Change-Id: Ie5e5dac46ba1beeb8de0a29c1a7be1264616fe92
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 9176
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222502
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-20 18:52:01 +00:00
Mike Klein
397fc88fc0 first VEX ymm vector ops
- 32x8 i32 add,sub,mul
   - add I32_Naive bench/test builder to get better i32 mul coverage
   - minor refactoring all over

Change-Id: I13cc19ff37a2da0bcff289ba51baac08f456d6c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222485
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-20 18:20:00 +00:00
Nathaniel Nifong
7635013ad1 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>
2019-06-20 17:33:04 +00:00
Brian Salomon
f30b1c1bd5 Revert "Revert "Make SkASSERT not break build in constexpr GrSwizzle method on GCC""
This reverts commit 27239e456a.

Revert "Revert "Add function to GrDataUtils to handle color conversions.""

This reverts commit c34d993b62.

Change-Id: Iac1bdaa6f8380e63bbb87394e7fca96808572131
Bug: skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222039
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-20 16:56:15 +00:00
Greg Daniel
2c3398dc26 Switch from querying swizzle on caps to using swizzles stored on proxies.
Change-Id: I03f4a3affd6dda7a83bee8eec768dcaa93a6b801
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220534
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-20 13:38:05 +00:00
Robert Phillips
b520476ee6 Swap GrSurfaceProxy over to being held via sk_sp
This CL:
   replaces GrProxyRef with sk_sp
   streamlines GrIORefProxy to be more like SkRefCntBase (i.e., move the fTarget pointer to GrSurfaceProxy)

Change-Id: I17d515100bb2d9104eed64269bd3bf75c1ebbbb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221997
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-20 11:43:45 +00:00
Michael Ludwig
613282042d Reland "Consolidate quad optimizations into single internal function."
This reverts commit 7694b90eb0.

Reason for revert: suppression: https://chromium-review.googlesource.com/c/chromium/src/+/1666472
Original change's description:
> Revert "Consolidate quad optimizations into single internal function."
>
> This reverts commit 646616a78f.
>
> Reason for revert: Suspected as cause of layout test changes.
>
> Original change's description:
> > Consolidate quad optimizations into single internal function.
> >
> > Routes all non-textured quad draws through single internal function
> >
> > Change-Id: Ief66864a0ad2d598982c5bf500c8a84ecbf84387
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215455
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=robertphillips@google.com,michaelludwig@google.com
>
> Change-Id: I0dc6a0d948c0f5e9221ff6c9fbbbbbb9bc3d9bc0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221737
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I4e5d39d603d32b18c48db291fb1650fe33e9ba11
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222096
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-06-19 18:26:10 +00:00
Brian Osman
8d56457f77 ByteCode: Fix subtle bug with nested loops and lanes re-activating
When starting a nested loop, we can't rely on the condition mask to keep
dead lanes dead, because of conditional breaks/continues that may have
happened earlier. So always narrow the loop mask by inheriting the
previous one.

Change-Id: I5bb076e6467fe1b6a2f682a590e8ae972a440b03
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222098
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-19 15:28:05 +00:00
Mike Klein
d3e75a7a1c add(GP64 dst, int imm)
Change-Id: I6aaa1dc3ff3a9529f87ff58a2ae1fc5f59bc626b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221653
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-19 15:10:35 +00:00
Mike Klein
948045d1a5 make registers a little less verbose to work with
Change-Id: I92c6027e16af19112a5497854f1085715cc38e3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221652
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-19 14:36:12 +00:00
Mike Klein
61703a643d first interesting instruction, sub(GP64,imm)
Change-Id: I89618ec826f54a24fce8ac5fa61ab27e8ec7d5c2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221651
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-19 14:19:12 +00:00
Mike Klein
056420428d Reland "extract Assembler so it can be tested"
This is a reland of a224fc1105

Changes since original:

  - switch fJIT_K to less error prone fJITMask
  - guard fJIT Assembler Program member with SKVM_JIT

Not really sure why the mips64el-Debug bot's compiler is crashing;
it does at least make sense to crash where it does... the file
includes SkOpts.h which includes SkVM.h.

If no reasonable code transformation can get it working again
I'll remove the bot.  The -Release version is fine, and mips64el
is one of those things I'd happily flush if it blocks progress.

In this end I think all this SKVM_JIT and Xbyak stuff should
go away and make things simple again, hopefully too simple to
crash GCC.  :|

Original change's description:
> extract Assembler so it can be tested
>
> And start documenting some structs we'll need
> to replace xbyak.
>
> Change-Id: I21c91642799a54e10af85afc8edbe12a9b4aa062
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221644
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_CPU_LIMIT_SSE2,Build-Debian9-GCC-mips64el-Debug
Change-Id: I6d7c27bc758b23c164ee67067cdfacc291e289fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221983
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-19 13:57:22 +00:00
Robert Phillips
e5f73281f9 No longer forward refs and unrefs from the GrSurfaceProxy to the backing GrSurface
This is setting up for GrIORefProxy to just become SkRefCnt and GrProxyRef to just become sk_sp.

Change-Id: Ica66565a353de980a7070e0788f1f2b17565baee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220297
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-19 00:01:51 +00:00
Mike Klein
6b7c9d95f5 Revert "extract Assembler so it can be tested"
This reverts commit a224fc1105.

Reason for revert: breaking x86-64 bots without AVX2, e.g. Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_CPU_LIMIT_SSE2

Original change's description:
> extract Assembler so it can be tested
> 
> And start documenting some structs we'll need
> to replace xbyak.
> 
> Change-Id: I21c91642799a54e10af85afc8edbe12a9b4aa062
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221644
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

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

Change-Id: Ie90d57f66e4d45f94db4ab4f485155533faddae1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221655
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-18 21:24:41 +00:00
Brian Salomon
7694b90eb0 Revert "Consolidate quad optimizations into single internal function."
This reverts commit 646616a78f.

Reason for revert: Suspected as cause of layout test changes.

Original change's description:
> Consolidate quad optimizations into single internal function.
> 
> Routes all non-textured quad draws through single internal function
> 
> Change-Id: Ief66864a0ad2d598982c5bf500c8a84ecbf84387
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215455
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I0dc6a0d948c0f5e9221ff6c9fbbbbbb9bc3d9bc0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221737
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-18 21:00:32 +00:00
Julia Lavrova
6e6333fba4 Refactor font resolution out of font iterator;
few minor bug fixes

Change-Id: Ibc60e972480f3503965af873f36001ed233382ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221544
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-06-18 19:23:33 +00:00
Robert Phillips
66a46033a6 Add Ganesh support for RGBA_16161616 and RG_half (take 2)
TBR=egdaniel@google.com
Bug: skia:9171
Change-Id: I862c87ba4bd55381b347333cf9ca23cf5389dff6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220816
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-18 19:05:04 +00:00
Mike Klein
a224fc1105 extract Assembler so it can be tested
And start documenting some structs we'll need
to replace xbyak.

Change-Id: I21c91642799a54e10af85afc8edbe12a9b4aa062
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221644
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-18 19:04:44 +00:00
Michael Ludwig
646616a78f Consolidate quad optimizations into single internal function.
Routes all non-textured quad draws through single internal function

Change-Id: Ief66864a0ad2d598982c5bf500c8a84ecbf84387
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215455
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-18 18:20:09 +00:00
Greg Daniel
f91aeb259e Move a bunch of gpu files out of include/private and into src/gpu.
In GrRecordingContext I moved the auditTrail onto the heap and only there
when compiling for tests. This allowed us to move a lot of files out of
include private.

Change-Id: Ib76ac211c0c6fd10bacaccf0c5f93f21a59f35d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221344
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2019-06-18 14:24:42 +00:00
Robert Phillips
c34d993b62 Revert "Add function to GrDataUtils to handle color conversions."
This reverts commit 5509102043.

Reason for revert: valgrind issues

Original change's description:
> Add function to GrDataUtils to handle color conversions.
> 
> Like SkConvertPixels but knows about all GrColorTypes, origin, and can
> apply an arbitrary GrSwizzle.
> 
> Use in GrSurfaceContext read/write pixels methods.
> 
> Add support for '0' to GrSwizzle.
> 
> 
> Change-Id: Ib9dd215fcb0ee8b33c4020893c22b4ab7ce1f40b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220761
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: If50f3e26875787d9309009e9c701774fbad0afda
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221538
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-18 11:57:28 +00:00
Herb Derby
9c71e7be10 Remove all global mutexes
Remove the SkBaseMutex (and SkBaseSemaphore). This allows all the thread
annotation machinery to work.

Change-Id: I2da420ec3165ccbcd90c474c0b62bfef42df2a53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221340
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-18 00:39:15 +00:00
Brian Salomon
5509102043 Add function to GrDataUtils to handle color conversions.
Like SkConvertPixels but knows about all GrColorTypes, origin, and can
apply an arbitrary GrSwizzle.

Use in GrSurfaceContext read/write pixels methods.

Add support for '0' to GrSwizzle.


Change-Id: Ib9dd215fcb0ee8b33c4020893c22b4ab7ce1f40b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220761
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-17 19:31:57 +00:00
Brian Salomon
3ec1f54750 Revert "Store GrSwizzle on proxies for texturing and swizzling."
This reverts commit 23093135d1.

Reason for revert: Breaking Google3 :(

Original change's description:
> Store GrSwizzle on proxies for texturing and swizzling.
> 
> Bug: skia: 6718
> Change-Id: I023d7507da9334e984ac8209a32323d616b3d79d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214305
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ie2303ad090f58de07db7b0ac2d42e06e5e5bbcc1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia: 6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221338
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-17 17:55:16 +00:00
Greg Daniel
23093135d1 Store GrSwizzle on proxies for texturing and swizzling.
Bug: skia: 6718
Change-Id: I023d7507da9334e984ac8209a32323d616b3d79d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214305
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-17 17:04:48 +00:00
Herb Derby
3721688f64 Make fMaskFormate private
Change-Id: I20e652f2b6f9bf606b03c6dd4e346c3439ea8a0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220876
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-15 00:56:48 +00:00
Brian Salomon
6c1205a900 Avoid using GrGpu::readPixels in GrTestingBackendTextureUploadTest.
Change-Id: Ic7ba918177f6f5cc35da713cf063c467bd7a7908
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220999
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-14 17:15:11 +00:00
Brian Osman
08a8496135 Interpreter: Simplify interface quite a bit.
Slightly sharper, but far easier to hold:

- Remove Value union from interface, everything is a 32-bit
  value type, or a collection thereof.
- Collapse to one version of Run (that takes count), and make
  it a member on ByteCode.
- Similarly, move disassemble to ByteCodeFunction.

Change-Id: I07c85e65991178b3f52e20e815c25f36bc9c4257
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220753
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-14 16:04:58 +00:00
Greg Daniel
2b5be0aa34 Fix EGLImageTest for new assert.
Change-Id: I873a17712c77413ceb09ccc9a0813a5838fe62e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220754
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-13 21:22:39 +00:00
Greg Daniel
fa55f2e100 Add asserts to make sure we always have valid GrBackendFormats before creating proxies.
Change-Id: I59dd970b6fd512f2e2ee08cc821b758b950a2b53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220743
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-13 20:06:34 +00:00
Mike Klein
5640397c48 fix dst/arg aliasing issues
Any time we implement a Program::Instruction with multiple low-level
operations, we risk overwriting any arguments that alias the
destination.

This is why the _I32 tests are failing, mad_unorm8 where d == x.  We
want (x*y+x)/256+z, but end up calculating (x*y+x*y)/256+z when x == d.

We could fix this by never allowing any arguments to alias any
destinations, but most instructions don't have this problem, and doing
that blindly would bloat the register count significantly.

We could fix this by knowing which Ops may be prone to aliasing in any
backend, but I find that somewhat error prone and also a little
abstraction- level-violatey.  I would have thought, for instance, that
the mad_f32 Op might be vulnerable here, but it's actually not... in any
situation where there is aliasing, we actually lower it to a single
vfmadd instruction, never mul-then-add.

This sort of aliasing issue is going to keep coming back up again and
again, especially with 2-argument architectures like SSE.  Luckily it's
trivially easy to fix by reserving a single tmp register to use as the
result of all but the final instructions.

The interpreter is safe because all its switch cases are single r(d) =
... statements.  The right hand sides are evaluated before anything is
written back to a destination register slot.  Had it been written a
little differently, it could have easily had this same aliasing issue.

Change-Id: I996392ef6af48268238ecae4a97d3bf3b4fba002
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220600
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-13 16:53:29 +00:00
Robert Phillips
f83c4684a6 Revert "Add Ganesh support for RGBA_16161616 and RG_half"
This reverts commit 156622513f.

Reason for revert: valgrind

Original change's description:
> Add Ganesh support for RGBA_16161616 and RG_half
> 
> Change-Id: Ia424ff719c5fb8d1842a909ade09ad6f5f78f21f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219998
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I7a8e99e70f575fb301ce289d9a04ebbec25b934b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220739
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-13 16:49:31 +00:00
Brian Osman
569f12f0e5 Interpreter: Vectorized interpreter
This converts the SkSL interpreter to operate in SIMT fashion. It handles
all the same features as the previous scalar implementation, but operates
on N lanes at a time. (Currently 8).

It's modeled after GPU and other parallel architectures, using execution
masks to handle control flow, including divergent control-flow.

Change-Id: Ieb38ffe2f55a10f72bdab844c297126fe9bedb6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217122
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-06-13 15:50:55 +00:00
Brian Salomon
d608e224b2 Add load/store to SkRasterPipeline for 16161616 unsigned normalized.
Bug: skia:8962

Change-Id: I0ab208063b6b7eca010f86d4d851ade23df5f849
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220529
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-13 14:48:35 +00:00
Robert Phillips
156622513f Add Ganesh support for RGBA_16161616 and RG_half
Change-Id: Ia424ff719c5fb8d1842a909ade09ad6f5f78f21f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219998
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-12 19:20:36 +00:00
Mike Klein
3f593799da expand unit tests, fix extract
The mask-only special case for extract is wrong...
it never looked it its input!

This not only makes things correct-er, but oddly it also
makes them faster by breaking inter-loop data dependencies.

Disable tests for _I32... they're actually still broken
because of a much more systemic flaw in how I've evaluated
programs.  The _F32 and _I32_SWAR JIT code and all interpreted
code is just getting lucky.  o_O

While here, update the I32_SWAR code to use the same math as I32,
(x*y+x)/256 for unorm8 mul.  This just helps keep me sane.

Change-Id: I1acc09adb84c426fca4b2be5ca8c2d46d9678dd8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220577
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-12 18:58:56 +00:00
Mike Klein
81756e4cae test and fix that we cover the right inputs
At head we're redoing any n<8 tail from the start,
not continuing from (n/8)*8 like we'd want.

Change-Id: I1a3d24cdffc843bbe6f3e01a163b6e3a20fdd0ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220556
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-12 18:44:58 +00:00
Brian Salomon
217522c40d Add SkRasterPipeline support for more load/store formats and GrSwizzle.
Adds loads/stores (but not dst loads/gathers) for:
*fp16 single and two channel
*fp32 two channel
*normalized unsigned 8 bit two channel
*normalized unsigned 16 bit single and two channel

TODO: 4 channel unsigned normalized 16 bit.

MISSING: fp32 single channel. No matching current or future GrColorType
planned AFAIK.

Intent is to support all (noncompressed) GrColorType load/stores in
order to implement fallbacks for 3D API limitations on texture uploads
and render target readbacks (some of which require swizzling).

Also, can be used to support YUV<->RGB planar
splitters/joiners on CPU.

Bug: skia:8962
Change-Id: I258d5682a1f4025b31639a97b1a1a02077a2453f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219999
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-11 20:31:02 +00:00
Julia Lavrova
a3552c5e6d Reland "SkParagraph"
This is a reland of 10ad0b9b01

Original change's description:
> SkParagraph
>
> Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: I46cf43eae693edf68e45345acd0eb39e04e02bfc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219863
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-06-11 17:20:36 +00:00
Brian Osman
2d170c35d4 Remove all NexusPlayer bots and driver workarounds
This device is very old and very unsupported. It doesn't officially come
with a browser (Chrome needs to be sideloaded).

Bug: skia:6531 skia:6670 skia:7286 skia:7921
Change-Id: I720cd3a40981694bf7befa5cafc700717dcd7cdf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219486
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-11 17:05:23 +00:00
Ethan Nicholas
d188c18835 fixed SkSL handling of negated literal vectors
Bug: oss-fuzz:14409
Change-Id: I837083139489d46f7db2f697ce85a0cabf85fb94
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219997
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-06-11 16:34:04 +00:00
Robert Phillips
3d4cac52f2 Remove IO refs from GrSurfaceProxy only
This CL leaves the Ganesh world in a very odd place. In particular it still:
  has pendingIO refs on GrSurfaces
  forwards the proxy refs on to the backing GrSurface

Removing everything at once only ends in a mess thus, this goofball CL.

Change-Id: If112ff311bcef2e8d65a36c3b53b0ded4041c24e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210040
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-11 15:39:33 +00:00
Robert Phillips
cb1adb40d0 Add srcData version of createBackendTexture API
Change-Id: I9679774d69e087a4ceb24de78e98585382bf8593
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218553
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-10 19:39:33 +00:00
Mike Reed
40d9c5162f Fix font creation lost style on Mac
On Mac 10.11, when creating a font from its name and style by using a
font descriptor, sometimes the created font lost the style. To work
around this problem, we check the font style after the creation, if
it is not correct, we will resort to font creation with symbolic traits
which creates the correct font.

BUG=skia:8447
BUG=874103

Change-Id: I8b57e5a81d0d19d9fb0a7bd2951de75f2c41e236
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/172200
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-06-10 18:40:28 +00:00
Mike Klein
22ea7e994b add Builder::dump()
I used to have a dump of the value program before it was
translated to registers, but it went away a while ago.
This restores it.

Change-Id: I9b8bfcb124843cad4b0dc44bdf0a03e95a0c83d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219757
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-06-10 17:43:58 +00:00
Robert Phillips
d1d869d96e Make GL & Vk backends create uninitialized backend textures
We want the non-color, non-pixel-data version of createBackendTexture to truly create uninitialized textures.

Change-Id: I08867508ea181b7ba3685638cc7a3ea11d527a24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218396
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-10 16:27:07 +00:00
Stephen White
9b7f1430d7 GrTessellator: fix for intersections returning non-finite points.
If the line/line intersection code returns Inf, it can easily turn into
a NaN in subsequent operations, which leads to an assert or hang.

The fix is to ignore intersections which are non-finite.

Bug: 969359
Change-Id: I9e9a5ce5d617aa75b91215a5bbae91ce6f234b7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219696
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-06-10 15:30:08 +00:00
Herb Derby
07cd38dc13 Revert "SkParagraph"
This reverts commit 10ad0b9b01.

Reason for revert: Breaks google3 build

Original change's description:
> SkParagraph
> 
> Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=borenet@google.com,djsollen@google.com,halcanary@google.com,bungeman@google.com,kjlubick@google.com,reed@google.com,drott@chromium.org,jlavrova@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I3f4ef2f34b7489d008c2fe92527d39fba0e16ff7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219858
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-10 13:16:53 +00:00
Brian Osman
8016441e20 Interpreter: Refactor interface and lifetime management
Interpreter is now just a namespace with Run and Disassemble. This hides
all of the implementation details. In addition, the interpreter only used
the Program because of a few details in FunctionDeclarations - scrape that
when constructing a ByteCodeFunction, and we don't need to keep the entire
Program alive, just the ByteCode. Adjust tests to ensure that this works.

Change-Id: I61efe4fe986476afedbd295d3d55b2a326fea4e3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219521
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-07 18:47:22 +00:00