Commit Graph

7086 Commits

Author SHA1 Message Date
Brian Salomon
83cfe4fa24 Remove simple GrGpu::createTexture helper
Change-Id: I8ad3213517594987ac604f4c08086778254b5a7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228062
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-18 14:22:35 +00:00
Robert Phillips
dd39980115 Revert "Make rest of GrGpu::wrapBackend* methods take a GrColorType"
This reverts commit 9725638fb1.

Reason for revert: Chrome roll

Original change's description:
> Make rest of GrGpu::wrapBackend* methods take a GrColorType
> 
> This CL is intended to further wean Ganesh off of using the GrBackendTexture's pixel config
> 
> Bug: skia:6718
> Change-Id: I593c0c73922fb76045e379214e20adb1f17ea215
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227780
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: Id71acf1dec63c288a858fccd7109c84cf3cc6f0a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228337
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-18 12:28:17 +00:00
Greg Daniel
c6dc5cf16a Move FormatType from ConfigInfo to FormatInfo.
Bug: skia:6718
Change-Id: Ia4cab74983a92a7ff6c9d7d6f683971bacbc10da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228122
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-17 20:35:48 +00:00
Robert Phillips
9725638fb1 Make rest of GrGpu::wrapBackend* methods take a GrColorType
This CL is intended to further wean Ganesh off of using the GrBackendTexture's pixel config

Bug: skia:6718
Change-Id: I593c0c73922fb76045e379214e20adb1f17ea215
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227780
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-17 20:00:05 +00:00
Mike Klein
c2fb3b4b72 split deaths() out of other analysis
I'm slowly refactoring my way to where hoisting and register assignment
are done in backend-specific ways, but this liveness analysis is always
going to be useful for each backend.

Use deaths() to restore friendly ☠️  dead code markers in test dumps.

Change-Id: I3ab94665bbbbf0788b0b27e00d644eba927dff47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228113
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-07-17 18:11:10 +00:00
Greg Daniel
009ad250fe Remove RG32F color type and pixel config.
Change-Id: I7fd3a8f6c02217d011f353ef602718a537bb87b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228116
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-17 17:05:36 +00:00
Brian Salomon
f2c2ba99f6 Remove kRenderTarget_GrSurfaceFlag, instead pass GrRenderable.
This is the last surface desc flag, so remove flags from GrSurfaceDesc.

Bug: skia:6718

Change-Id: Id3ed66b161289927b62f40bfb1f6482cf544deda
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227858
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-17 15:09:03 +00:00
Greg Daniel
64329094c2 Move renderable flag and valid samplecounts in GrGLCaps to FormatInfo.
Change-Id: Ic94a748c1ebfb53431f623d9b63c0aaf12c6f3ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227836
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-17 13:53:12 +00:00
Hal Canary
e574f1e409 [reland] SkMetaData: move from src/ to tools/
Original: https://skia-review.googlesource.com/c/skia/+/227436
Change-Id: Iec326027319f39b0402e1b5c03b327cb26249159
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227778
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-07-17 13:14:38 +00:00
Mike Klein
9977efa703 test both JIT and interpreter
Add Program::dropJIT() to allow us to proactively drop
any JIT code forcing fallback on the interpreter,
and use it to test both on JIT-supported platforms.

Other platforms will just test the interpreter twice.

Change-Id: I607d00ef3c648e66a0b3a1374b11aa82dbfff70c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227424
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-07-16 22:31:17 +00:00
Mike Klein
2616efda08 pin down arg() stride (a.k.a. type) info sooner
Arg strides are the reason JIT happens lazily in Program::eval() today
instead of proactively in Builder::done() or Program's constructor.  It
also just really doesn't make sense to delay this information... it's
not like you can change it up sanely between calls to eval().

The argument index now comes implicitly from the order of calling arg().
This may seem logically independent, but it prevents a weird situation
where you could use the same argument index twice with different
strides... not sure what that would mean.

Change-Id: I0f5d46e94a1ca112a72675c5492f17c0dd825ce0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227390
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-16 21:06:45 +00:00
Brian Salomon
947efe28de makeDeferredSurfaceContext -> makeDeferredTextureContext and makeDeferredRenderTargetContext.
Removes some usage of GrSurfaceDesc.

Bug: skia:6718
Change-Id: Icc4f93aba0e5c49a801b4c7bbfcba76a6e30c538
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227776
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-16 20:06:04 +00:00
Brian Salomon
a3e2996b08 Rework how initial clearing of texture works.
1) It only applies when a texture is created, not when recycled from cache

2) It is all textures or none, not a flag GrSurfaceDesc

3) It is implemented by GrGpu clearing the texture after creation if
such a thing is supported in underlying API. Otherwise, GrResourceProvider
must provide pre-zeroed mip levels.

4) Works for MIP mapped textures (all levels without initial data are cleared)

This could cause performance regressions in WebGL until we re-add the
ability to clear using glCear() in GL. Doing that requires making the "can
clear using GrGpu" caps query be per-format. Deferring doing that until
GrPixelConfig work is farther along.

Bug: skia:6718


Change-Id: I234715b9faaf61e8b44d54464497a17cd553585d

start

Change-Id: Ib84a8c3ece010cc3164b18895107e78484cbf76b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226977
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-16 16:36:41 +00:00
Brian Salomon
6aecd5e62f Rework transfer pixels tests to be more robust.
Make them query caps for supported read/write info and do CPU
conversions before uploading/after reading.

Removes use of GrColor so in theory could be used to test
non-8888 color types.

Bug: skia:6718

Change-Id: Icf9d0b778348a4e960fbfec49e1308b21e45a051
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227497
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-16 14:31:04 +00:00
Robert Phillips
0902c98825 Pass GrColorType to the GrGpu::wrapRenderableBackendTexture chain of calls (take 2)
This is a step towards reducing our reliance-on/use-of the GrPixelConfig stored in the GrBackendTexture.

TBR=egdaniel@google.com
Bug: skia:6718
Change-Id: I316a98416c51f273e6ab578f9cbaea5f7adfe331
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227639
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-16 13:07:06 +00:00
Greg Daniel
fe88bf67c2 Revert "Pass GrColorType to the GrGpu::wrapRenderableBackendTexture chain of calls"
This reverts commit 5572737d95.

Reason for revert: Adreno 4xx bots hitting compatibility assert in InitialTextureClear test

Original change's description:
> Pass GrColorType to the GrGpu::wrapRenderableBackendTexture chain of calls
> 
> This is a step towards reducing our reliance-on/use-of the GrPixelConfig stored in the GrBackendTexture.
> 
> Bug: skia:6718
> Change-Id: I2170032bfbbb57423c4bb0d901ad014c61d38131
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223701
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: I24cf6b3aa0dfca2e935a36592860ad91171b21a7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227637
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-16 00:33:13 +00:00
Greg Daniel
12e7585495 Revert "SkMetaData: move from src/ to tools/"
This reverts commit 9d844d8ce5.

Reason for revert: breaking google3

Original change's description:
> SkMetaData: move from src/ to tools/
> 
> Change-Id: If581c8ceeaa76985535cb7b6772742f0011cfe8e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227436
> Commit-Queue: Hal Canary <halcanary@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Auto-Submit: Hal Canary <halcanary@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: Ifadad46f0663b743d3e57bb6317707f2a2fac07d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227636
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-16 00:28:44 +00:00
Robert Phillips
5572737d95 Pass GrColorType to the GrGpu::wrapRenderableBackendTexture chain of calls
This is a step towards reducing our reliance-on/use-of the GrPixelConfig stored in the GrBackendTexture.

Bug: skia:6718
Change-Id: I2170032bfbbb57423c4bb0d901ad014c61d38131
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223701
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-15 20:40:09 +00:00
Hal Canary
9d844d8ce5 SkMetaData: move from src/ to tools/
Change-Id: If581c8ceeaa76985535cb7b6772742f0011cfe8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227436
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-15 18:45:09 +00:00
Brian Salomon
85aeccfb9d Make pixel comparison utility in ReadPixelsTest shareable
Also make it support GrColorType

Change-Id: I2aecb82dd1b8e3bc942549f2023ff5cae9deb4f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227403
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-15 17:21:32 +00:00
Mike Klein
35b97c3130 handle x86 tail in JIT code too
Basically the same deal as aarch64:

    - a bunch of instructions to rewrite control
      flow to be two loops, body and tail

    - a bunch of instructions to support scalar
      loads and stores in the tail

We can now remove the JIT::mask field.

I've removed the SkUNREACHABLE I'd put in for the ARM code...  as
written the interpreter is still reachable by the loser if two threads
race to JIT the program.  Medium term I plan to move JIT compilation to
a more proactive time, eliminating the need for the lock and letting the
interpreter become truly unreachable.

I had a little bit of a false start with what instructions to use for
scalar load8 and store8, first starting with instructions that loaded
via GP registers, then remembering vpinsrb and vpextrb can take a memory
argument, loading into xmm directly.  I've left the first instructions I
used in the file, still implemented but only used from the unit tests.
They're pretty common and will probably be useful some day.

Change-Id: I471b13026af4b1c6e861a53159f9df5f0285447c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227178
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-15 03:13:56 +00:00
Mike Klein
86a645c5d9 fix bug for add/sub with r8-r15
I had been setting the REX R bit to select high registers,
but you actually set the B bit.  Don't know how I got that
wrong before... the leading byte should be 49 not 4c.

    $ cat test.s
    foo:
        addq $7, %r8

    $ clang -c test.s && objdump -d test.o

    0000000000000000 <foo>:
       0:	49 83 c0 07          	add    $0x7,%r8

Change-Id: I039e1c4f4ea20523a1e2cc9bcf5f6d9321a6223b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227177
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-15 02:04:36 +00:00
Brian Osman
4a47da7357 Interpreter: Disallow return statements inside loops or conditionals
These didn't work correctly, and they're extremely tricky to get right
in the vectorized execution model (vs. structured control flow). As a
side effect, determine the maximum stack depth used for the execution
masking - the same idea will be used for the primary stack in a later
CL. Add a unit test to verify the new restriction, and fix two places
that were relying on this feature before.

In addition, boolean external values need to be masks. I may implement
this in the code-gen at some point, but this is already a fringe
feature, so just fix the one unit test for now.

Change-Id: I9607ffaf67c7795dbf42e4009180aea8f3e65c44
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226849
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-07-12 16:07:16 +00:00
Mike Klein
65c10b5018 make all instructions take two-way labels
This turned out to be quite an easy transformation
with yesterday's work already done.  No codegen changes.

Change-Id: Ife19ab7731514c54cfed963a6d2e9b1ec2246997
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227137
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-07-12 15:56:06 +00:00
Leon Scroggins
980d03b2d0 Reland "Update Wuffs version"
This reverts commit aed8009a6d.

Reason for revert: Flutter's version of Wuffs has been updated. See https://github.com/flutter/engine/pull/9466#issuecomment-510639898

Original change's description:
> Revert "Update Wuffs version"
> 
> This reverts commit 42ece2b7c9.
> 
> Reason for revert: Requiring the latest version of wuffs broke the flutter roll.
> 
> Original change's description:
> > Update Wuffs version
> > 
> > The primary purpose of this commit is to track upstream Wuffs more
> > closely.
> > 
> > A side effect is to pull in the Wuffs commit
> > 5bea867f72
> > "Allow an LZW literal width of 1", which eliminates a difference between
> > the old third_party/gif decoder and the new third_party/wuffs decoder.
> > 
> > As the CodecTest.cpp comment says, the GIF spec explicitly says that the
> > LZW literal width should be at least 2, but in practice, GIF encoders
> > violate the spec. After that upstream commit, Wuffs has followed other
> > GIF decoders in being more liberal in what it accepts.
> > 
> > Codec_InvalidAnimated therefore no longer has a separate "#ifdef
> > SK_HAS_WUFFS_LIBRARY" section. The first frame of the test's GIF image
> > data, being the required frame of the third frame, no longer has an
> > invalid LZW literal width according to Wuffs.
> > 
> > Bug: skia:8235
> > Change-Id: Ie94537f5232128ffc1d1547f4c0b84992e54ab02
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226476
> > Commit-Queue: Leon Scroggins <scroggo@google.com>
> > Reviewed-by: Leon Scroggins <scroggo@google.com>
> 
> TBR=scroggo@google.com,nigeltao@google.com
> 
> Change-Id: I9e636e81f57eefd836a53738872ddb9f5c9b13c3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8235
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226697
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>

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

Change-Id: Ibeeea1cf9c2e210b5e49dec65037ec8a494209de
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8235
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226851
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Nigel Tao <nigeltao@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-07-12 13:33:28 +00:00
Mike Klein
ce7b88ce7d bidirectional Labels
Support forward references in Label.

In addition to tracking the current Label offset (used for
backward references essentially just the same as before this CL)
we also store a list of instructions that refer to each Label.
When a Label moves, each instruction gets a new displacement.

To make this a little easier, remove the 8-bit jump form on x86...
this way all x86 displacements are 32-bit and and all ARM 19-bit.

For now only cbz() supports this, just to start somewhere.
More to do but it's worth an early design review.

Change-Id: I23d2bcd7742965ab694ae4828f53409cb9fc807f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226937
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-07-12 12:53:24 +00:00
Jim Van Verth
658d499afc New approach to fixing Vulkan MSAA.
MakeFromBackendTextureAsRenderTarget is planned to be deprecated, so we
should use MakeFromBackendTexture with a sampleCount parameter instead.
On Vulkan, this ran into issues because we assumed an allocation for the
VkImage and the swapchain doesn't provide us with one. Fixed so we don't
need an allocation for Borrowed textures.

Bug: skia:
Change-Id: Ib26888020e093f4a734a4159eae898539c2273b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226839
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-07-11 18:34:19 +00:00
Mike Klein
4cfe3ed0f2 instructions for JIT tail support on ARM
This adds a bunch of instructions we'll need to handle the N < 4 tail
within the JIT code on ARM.

   - ldrb/strb are 1-byte load and stores
   - sub subtracts without setting flags
   - cmp just sets flags (actually just subs with an xzr destination)
   - add b and b.lt, just like b.ne
   - cbz and cbnz... we only need cbz but I accidentally did cbnz first

Once I add support for forward jumps, we'll be able to use these
instructions to restructure the loop to

    entry:
        hoisted setup
    loop:
        if N < 4, jump tail      (cmp N,#4; b.lt tail)
        ... handle 4 values ...
        jump loop                (b loop)
    tail:
        if N == 0, jump end      (cbz N, end)
        ... handle 1 value ...
        jump tail                (b tail)
    end:
        ret

Change-Id: I62d2d190f670f758197a25d99dfde13362189993
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226828
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-11 17:49:44 +00:00
Ben Wagner
7825d4983f Add comparison of rendered SkPictures to Serialization unit test
This identifies a possible bug with font serialization (changing the
typeface on line 444 causes the test to fail).

Change-Id: I4e2c9d21cd03586e043b8d82eeff6607bb02b380
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226510
Auto-Submit: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-07-11 15:33:13 +00:00
Greg Daniel
e877dce203 Add kRGBA_8888_SRGB GrColorType and remove GrSRGBEncoded.
Change-Id: Iad1c72eb81ffd9c006e39c96191fada990d9dbd6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226224
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-11 15:22:23 +00:00
Leon Scroggins
aed8009a6d Revert "Update Wuffs version"
This reverts commit 42ece2b7c9.

Reason for revert: Requiring the latest version of wuffs broke the flutter roll.

Original change's description:
> Update Wuffs version
> 
> The primary purpose of this commit is to track upstream Wuffs more
> closely.
> 
> A side effect is to pull in the Wuffs commit
> 5bea867f72
> "Allow an LZW literal width of 1", which eliminates a difference between
> the old third_party/gif decoder and the new third_party/wuffs decoder.
> 
> As the CodecTest.cpp comment says, the GIF spec explicitly says that the
> LZW literal width should be at least 2, but in practice, GIF encoders
> violate the spec. After that upstream commit, Wuffs has followed other
> GIF decoders in being more liberal in what it accepts.
> 
> Codec_InvalidAnimated therefore no longer has a separate "#ifdef
> SK_HAS_WUFFS_LIBRARY" section. The first frame of the test's GIF image
> data, being the required frame of the third frame, no longer has an
> invalid LZW literal width according to Wuffs.
> 
> Bug: skia:8235
> Change-Id: Ie94537f5232128ffc1d1547f4c0b84992e54ab02
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226476
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>

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

Change-Id: I9e636e81f57eefd836a53738872ddb9f5c9b13c3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8235
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226697
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-07-11 13:14:33 +00:00
Nigel Tao
42ece2b7c9 Update Wuffs version
The primary purpose of this commit is to track upstream Wuffs more
closely.

A side effect is to pull in the Wuffs commit
5bea867f72
"Allow an LZW literal width of 1", which eliminates a difference between
the old third_party/gif decoder and the new third_party/wuffs decoder.

As the CodecTest.cpp comment says, the GIF spec explicitly says that the
LZW literal width should be at least 2, but in practice, GIF encoders
violate the spec. After that upstream commit, Wuffs has followed other
GIF decoders in being more liberal in what it accepts.

Codec_InvalidAnimated therefore no longer has a separate "#ifdef
SK_HAS_WUFFS_LIBRARY" section. The first frame of the test's GIF image
data, being the required frame of the third frame, no longer has an
invalid LZW literal width according to Wuffs.

Bug: skia:8235
Change-Id: Ie94537f5232128ffc1d1547f4c0b84992e54ab02
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226476
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2019-07-10 17:45:43 +00:00
Robert Phillips
3cd5432331 Add protected status to SkSurfaceCharacterization
Change-Id: I27bd051c1fce0239faff7fc073eaf82976fb63ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225940
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-10 16:30:35 +00:00
Brian Osman
6f5358f505 Interpreter: Disallow recursion
I think this is the minimum rule that's easy to understand when writing
SkSL for the interpreter that ensures we'll be able to statically
determine total stack usage of a particular function.

While writing the new test, I also noticed that we still return
(invalid) byte code, even when there are errors. Fixed that.

Change-Id: I625a8592c9ba1656074e5f0d4227d41968af7b37
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226218
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-07-10 16:08:39 +00:00
Ben Wagner
96fdfe0fe8 Fix test TextBlob_serialize
Previously, this test was passing only because it used the default
typeface. In deserialization code, if the typeface can't be
deserialized, it is replaced with the default typeface. I changed the
test to use a non-default typeface, which caused it to fail. I then
changed the custom typeface serializer/deserializer functions so that
the test passes.

Change-Id: I14e33f7fd18342e76a1fa624ae97fd894e010b6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226221
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Ben Wagner aka dogben <benjaminwagner@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-09 22:40:01 +00:00
Greg Daniel
5c96db8821 Move last few uses of SkColorType out of GrCaps.
Change-Id: Ie13e511f42afa7a06fad674ead3e1d5d8e051e77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226216
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-09 20:03:44 +00:00
Robert Phillips
a5e78be278 Make Mock GrBackendFormat use GrColorType (instead of GrPixelConfig)
The switch to GrColorType does mean that we can no longer represent compressed backend formats in the Mock backend surfaces.

This will require a Chrome CL before it can land in Skia.

TBR=bsalomon@google.com
Change-Id: Ie4e2d4826f960664a21d3de79933eb1cb5d06896
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225538
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-09 17:43:14 +00:00
Brian Salomon
b450f3be4f Use vkCmdClearColorImage to clear backend textures
Also don't use GrPixelConfig to create the VkImage.


Bug: skia:7959
Bug: skia:6718

Change-Id: Ia13c5ed2fbe0542c060b725694eff9d566c491f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226078
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-09 15:00:43 +00:00
Greg Daniel
627d053913 Move uses of functions taking SkColorType to GrColorType versions in GrCaps.
Change-Id: I4feda6277cf14be0d32a8ce22257902483d7ae1a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225734
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-09 13:29:07 +00:00
Leon Scroggins III
112ac7f19a Check for uninitialized memory during jpeg encode
Bug: chromium:951893

This will help determine which piece of code left memory uninitialized.
Add a test that exercises all the different ways we might pass memory
to jpeg_write_scanlines.

Change-Id: I6392a414795da9b0471e8cd6b373a7fff8f0a1b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225098
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-07-09 12:48:17 +00:00
Robert Phillips
7c8af174dd Remove some uses of isTestingOnlyBackendTexture
These uses seem redundant. The remaining uses are in the test "ResourceCacheWrappedResources" where the call is used to ensure borrowed resources aren't deleted.

Change-Id: I2323a3496330b53e13b84e8b7c20037b841224a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225732
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-08 20:27:10 +00:00
Greg Daniel
2f2caeaa9b Make isFormatTexturable take a GrColorType.
Change-Id: I02db9025c49d9ee2d805dd6b48916bcc4136f9a8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225729
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-08 20:12:43 +00:00
Aaron O'Mullan
829b6a0ff4 Fix Metal includes breaking macOS local builds
Before this fix, skia (and thus Chrome) would fail to compile on macOS when the user (developer) had a case-sensitive file-system.

So I've replaced the incorrect includes of <metal/metal.h> by <Metal/Metal.h>

Change-Id: I6ebcc0f46608f6d840d80d18e5f5baf0744a7f16
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225776
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-08 14:02:47 +00:00
Brian Salomon
27ae52c6f4 Make deferred render target context without config or format
config is completely redundant. No caller really cares what the backend
format is.

Change-Id: I93f1feb3ee61db6c21b7915bab3ee3fba5656f92
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225194
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-03 16:53:48 +00:00
Robert Phillips
02dc0307ad Add bridge between GrContext::createBackendTexture and SkSurface::MakeFromBackendTexture
In order to effectively use the explicit backend texture allocation API Chrome needs a way to use them with surface characterizations

Change-Id: Ic61eff9f3b6b0e8280481149d7c08d37a2fe7ec0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222781
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-03 12:31:12 +00:00
Mike Klein
aab45b5638 add misc. value programs to SkVMTest.expected
Noticed we were only dumping the final register
programs for the integer code.  Might as well also
track the value programs.

Change-Id: I417c5c655b632691557bbbb136dcbd3f3167af9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225324
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-07-02 23:13:06 +00:00
Mike Klein
7e65076ae3 move Builder/Program dump()
This is test-only code only used by SkVMTest.cpp,
so it can live there.  This cuts the dependency
of SkVM on SkStream and co.

Change-Id: I7695e527b2d16e4485f8c5f4cd39bb8300e9221d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225321
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-02 23:10:23 +00:00
Herb Derby
9ee1edda15 Add SkMakeSpan and helpful conversion
SkMakeSpan uses function type inference to remove boilerplate
code. The converting casts simplifies dealing with T* to const T*
uses.

Change-Id: I1851e144c4e530c275710514ce30ad75a7eb94c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225192
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-07-02 21:49:09 +00:00
Brian Salomon
624f9063c1 Be more stringent about API failure cases in AsyncReadPixels test
Bug: skia:8962
Change-Id: I636d8d5c53a653c7b02bfe315e927c1e2fbc0ddf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222791
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-02 19:06:47 +00:00
Brian Salomon
1047a49d82 GrGpu requires row bytes to be non-zero before read/writePixels and createTexture
Make GrGpu base class validate GrMipLevel arrays and row bytes parameters.

GrCaps states whether row bytes passed to GrGpu must be tight or not and callers
are responsible for temporary buffers if needed to make tight.

Change-Id: I2c522f7bd67c86044a36b3f70e13d7dcb38b0a6b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224961
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-02 18:33:51 +00:00