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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Lays the infrastructure to use mixed samples internally, and begins
using nvpr with mixed samples on the default "gl" and "gles" configs.
In this rendition, we take the simplest approach possible re: stencil
attachments. We initially create a render target without stencil
(i.e., 0 samples). Then, any time a proxy needs a stencil buffer with
more samples than its target currently has, we create and attach a new
stencil buffer. However, we never "downgrade" a render target's
stencil attachment to one with fewer samples. So if the proxy only
needs one sample and the target has many, we leave it.
Bug: skia:
Change-Id: I8558ba799ac3dee457f349f77d4517c11413c9a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224456
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This reverts commit 4c6f9b7670.
Reason for revert: Landing with neuxs 7 and androind one fixes
Original change's description:
> Revert "Reland "Remove support for copyAsDraw in gpu copySurface.""
>
> This reverts commit 84ea04949c.
>
> Reason for revert: nexus 7 and android one broken
>
> Original change's description:
> > Reland "Remove support for copyAsDraw in gpu copySurface."
> >
> > This reverts commit c5167c053b.
> >
> > Reason for revert: fixed
> >
> > Original change's description:
> > > Revert "Remove support for copyAsDraw in gpu copySurface."
> > >
> > > This reverts commit 6565506463.
> > >
> > > Reason for revert: seems to break things?
> > >
> > > Original change's description:
> > > > Remove support for copyAsDraw in gpu copySurface.
> > > >
> > > > The major changes on a higher lever are:
> > > > 1) The majority of all copies now go through GrSurfaceProxy::Copy which
> > > > takes in a proxy and returns a new one with the data copied to it. This
> > > > is the most common use case within Ganesh.
> > > >
> > > > 2) The backend copy calls no longer do draws, require origins to be the
> > > > same, and won't do any swizzling or adjustment of subrects. They are
> > > > all implemented to be dumb copy this data to this other spot.
> > > >
> > > > 3) The GrSurfaceContext copy call has now been moved to priv and renamed
> > > > copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.
> > > >
> > > > 4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
> > > > of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
> > > > call the priv methods on GrSurfaceContext.
> > > >
> > > > Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
> > > > 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: Id43aa8aa1451e794342e930441d9975b90e6b59f
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218549
> > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> >
> > Change-Id: I1a96f85ae2ff7622a6b57406755d478e7fbcf56e
> > No-Presubmit: true
> > No-Tree-Checks: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218797
> > 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: I310930a9df30535f45a065263a40239141e15562
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219384
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: I88df4f19aa26ed77b5af4e25d138387cbabd1934
No-Presubmit: true
No-Tree-Checks: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219386
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>