Commit Graph

7117 Commits

Author SHA1 Message Date
Mike Klein
f98d0d31c4 let JIT code hoist when possible
This first tries to JIT while hoisting all constants,
and if that fails, tries again hoisting no constants.

I figure this is one of those 80/20 deals for how to
handle constant hoisting and register pressure.  This
probably mostly moots doing anything fancy like using
memory operands with AVX or lane operands with NEON.

This _doesn't_ moot hoisting the NEON tbl arguments,
which is not yet done here, but probably my next CL.

Change-Id: Id09d5cdddcdb45207bdfc914a5a3128a481a26f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229058
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-22 21:06:34 +00:00
Mike Reed
b7dad44040 Reland "hide drawlooper from paint"
This reverts commit 6dc14ded91.

Reason for revert: add flag to google3

Original change's description:
> Revert "hide drawlooper from paint"
>
> This reverts commit 766b42b7ba.
>
> Reason for revert: afaict this is changing a lot of image filter GMs for the worse
>
> Original change's description:
> > hide drawlooper from paint
> >
> > Bug: skia: 4783
> >
> > Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=fmalita@chromium.org,reed@google.com
>
> Change-Id: I0bfd48ada3f8e48a774527caccf7abdb7a1cc470
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia: 4783
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229005
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,fmalita@chromium.org,reed@google.com

Change-Id: Ib3cd8941a63cd323b8872dd7fec1c953ab81cbdc
Bug: skia: 4783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229010
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-22 20:03:36 +00:00
Ethan Nicholas
3908059bee fixed SkSL handling of constant arrays
Bug: skia:
Change-Id: Ib01a9a01a0e9e5c27ea5142f8141b769ef093669
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229012
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-07-22 19:37:40 +00:00
Mike Klein
5e533c9e1f move hoist analysis back into Builder
Even if a JIT ultimately doesn't end up hoisting any values, it's going
to want this information while it decides.  Writing it in one place also
ensures we only get it wrong in one place...

I'm no_ extending the lifetime of hoisted instructions here in Builder.
That's something to leave to the backend so they have the flexibility of
which of these values to hoist, if any.  If they don't hoist, they'll
need to know when the value dies.

Moving this information back here lets the test expectation goldens
reflect the hoist bit again too.  Kind of nice.

Change-Id: Ib165ca898a97c1d822cb28fe24f15bae4d570a17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229024
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-22 19:34:06 +00:00
Robert Phillips
6dc14ded91 Revert "hide drawlooper from paint"
This reverts commit 766b42b7ba.

Reason for revert: afaict this is changing a lot of image filter GMs for the worse

Original change's description:
> hide drawlooper from paint
> 
> Bug: skia: 4783
> 
> Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I0bfd48ada3f8e48a774527caccf7abdb7a1cc470
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia: 4783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229005
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-22 17:27:17 +00:00
Mike Reed
766b42b7ba hide drawlooper from paint
Bug: skia: 4783

Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-22 16:25:41 +00:00
Robert Phillips
ebab03ffbf Add Ganesh support for LUM16F (take 2)
When Chrome has a LUM16F texture they tell Skia it is R16F. Although this has been working for them so far it causes trouble with some upcoming changes.

Change-Id: I2473f70e4f725128f143c2dfb08adb79f3c7c166
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228565
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-22 14:13:36 +00:00
Chris Dalton
c3318f09cd ccpr: Add an MSAA atlas mode
Adds the option to use a multisampled (or mixed sampled) atlas, and
uses the sample mask and stencil buffer instead of coverage counts.

Bug: skia:
Change-Id: I9fb76d17895ae25208124f6c27e37977ac31b5eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227428
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-19 20:52:17 +00:00
Mike Klein
4a13119a60 always fma in mad_f32()
We can always move data around so that an FMA is possible using no more
registers than we would otherwise, and on x86, evne using no more
instructions.

The basic idea here is that if we can't reuse one of the inputs to
destructively host the FMA instruction, the next best thing is to copy
one of the arguments into tmp() and accumulate the FMA there.

Once the FMA has happened, we just need to copy that result to dst().
We can of course skip that copy if dst() == tmp().  On x86 we never need
that copy; dst() and tmp() are picked using the same logic except that
dst may alias one of its inputs, and we only fall into this case after
we've already found it doesn't.  So we can just assert dst() == tmp()
rather than check it like we do on ARM.

It's subtle, but I think sound.

I'm using logical-or to copy registers around.  This is a little lazy,
but maybe not as lazy as it looks: on ARM that is _the_ way to copy
registers.  There's a vmovdqa instruction I could use on x86, TBD.

All paths through this new code were being exercised on ARM, but we
didn't have anything hitting the tmp case on x86, so I've added a new
unit test that hits the corner cases of both implementations.

Change-Id: I5422414fc50c64d491b4933b4b580b784596f291
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228630
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-19 20:12:42 +00:00
Brian Salomon
e8a766b16c Move GrProtected off GrSurfaceDesc and pass separately.
Change-Id: If628c13bb0e5aa885e4249a37432ba572e65d920
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228440
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-19 19:03:19 +00:00
Florin Malita
673e87cda9 [svgcanvas] Consolidate constant-Y text positions
When SkBaseDevice switched to drawGlyphRunList(), we lost the ability to
detect a) constant-Y text and b) default-positioned text.

As a result, the emitted SVG contains lots of redundant/repeating glyph
positions.

This CL enhances SVGTextBuilder to detect and consolidate constant-Y
glyph positions.

Also restore a useful whitespace unit test.

Change-Id: I50568aef1955f75898ebab41441ad5fe418dac43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228563
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-19 18:53:32 +00:00
Mike Klein
1326749832 add sli.4s, use it in pack sometimes
We have pack(x,y,imm) = x | (y<<imm) assuming (x & (y<<imm)) == 0.

If we can destroy x, sli (shift-left-insert) lets us implement that
as x |= y << imm.  This happens quite often, so you'll see sequences
of pack that used to look like this

	shl	v4.4s, v2.4s, #8
	orr	v1.16b, v4.16b, v1.16b
	shl	v2.4s, v0.4s, #8
	orr	v0.16b, v2.16b, v3.16b
	shl	v2.4s, v0.4s, #16
	orr	v0.16b, v2.16b, v1.16b

now look like this

	sli	v1.4s, v2.4s, #8
	sli	v3.4s, v0.4s, #8
	sli	v1.4s, v3.4s, #16

We can do this thanks to the new simultaneous register assignment
and instruction selection I added.  We used to never hit this case.

Change-Id: I75fa3defc1afd38779b3993887ca302a0885c5b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228611
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-19 18:37:12 +00:00
Mike Klein
9e2218a06a restore aarch64 JIT
Trying to keep most of the structural parts shared between x86_64 and
aarch64.  Not sure if this will stay factored like this long-term, but
the last version felt like there was a bit too much redundancy, and I
don't want to write things like register management more often than have
to.

Change-Id: Ieeb21f433715a730c41c85d657c5b33fa4702696
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228608
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-19 18:06:52 +00:00
Michael Ludwig
aa861a1907 Change SkMatrix::decomposeScale to use preScale
While most callers of decomposeScale only depend on the scale factors
that are returned, image filter decomposition depends on the remaining
matrix as well. Hence, the following necessary updates to work with
the new behavior of decomposeScale:

* Update imagefilter DAG sample to reflect prescaling
* Correct embedded matrix in SkApplyCTMToFilter
* Add comment to clipRectBounds() clarifying coordinate spaces and image filters

But, we want to have decomposeScale using preScale() because it then
produces a remainder matrix that can be used as the transform for the
image filter draw, instead of wrapping the image filter in an
SkMatrixImageFilter as currently done by SkApplyCTMToFilter.

Bug: skia:7211
Change-Id: If14570afb4189cebc75f3815e8ccdde05cb074e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228438
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-07-19 15:41:11 +00:00
Mike Klein
237dbb4d87 small cleanups
- get rid of variadic Assembler::byte()... not used very often
  - rename Assembler::byte(ptr,n) to bytes()
  - align with 0 bytes, get rid of nop()

Change-Id: I7564d3bad00e3f0d1c7a80153c445966914fccf0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228601
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-19 15:36:11 +00:00
Robert Phillips
cdb40c9d07 Revert "Add Ganesh support for LUM16F"
This reverts commit 2f6c8af73a.

Reason for revert: Failing on some bots

Original change's description:
> Add Ganesh support for LUM16F
> 
> When Chrome has a LUM16F texture they tell Skia it is R16F. Although this has been working for them so far it causes trouble with some upcoming changes.
> 
> Change-Id: Ic2143ec69f33a17cb1cb64f6ebc39bffd94a5e68
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228557
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ie52150f4f5255a2db697b9f0e810eff2042eadec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228560
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-19 14:53:53 +00:00
Robert Phillips
2f6c8af73a Add Ganesh support for LUM16F
When Chrome has a LUM16F texture they tell Skia it is R16F. Although this has been working for them so far it causes trouble with some upcoming changes.

Change-Id: Ic2143ec69f33a17cb1cb64f6ebc39bffd94a5e68
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228557
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-19 14:39:21 +00:00
Ethan Nicholas
0c8582e48a fixed internal error when parsing invalid SkSL code
Bug: skia:
Change-Id: I1c801a26727b72f36d76e1a1c21cd0e571107f8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228558
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-07-19 14:02:11 +00:00
Florin Malita
abc96536f6 [SkSVGCanvas] Add flag for converting text to paths
Change-Id: I9130518d12acda1a82576a17fa4fa8c34b0618f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228436
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-19 13:39:11 +00:00
Mike Klein
37607d4ccd Reland "more JIT refactoring"
This is a reland of 558b639225

PS2... oh, right, not everything supports AVX2.

Original change's description:
> more JIT refactoring
>
> This re-enables AVX2 JIT with simultaneous register assignment and
> instruction selection.  You can see it working in a very basic way in
> how we choose instructions and registers for Op::mad_f32.
>
> Constants are still broadcast, here inside the loop instead of hoisted.
> I think it'll probably end up best to use constants directly from memory
> (as in vpshufb's masks), falling back to these in-loop broadcasts when
> that can't work.
>
> Change-Id: If17d51b9960f08da3612e51ac04424e996bf83d4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228366
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

Cq-Include-Trybots: skia.primary:Test-Mac10.13-Clang-VMware7.1-CPU-AVX-x86_64-Debug-All-NativeFonts
Change-Id: I6f99d275040abe6210a980fc544f7f22c3b85727
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228476
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-18 23:59:47 +00:00
Mike Klein
d864d1dc19 Revert "more JIT refactoring"
This reverts commit 558b639225.

Reason for revert: broke some perf bots

Original change's description:
> more JIT refactoring
> 
> This re-enables AVX2 JIT with simultaneous register assignment and
> instruction selection.  You can see it working in a very basic way in
> how we choose instructions and registers for Op::mad_f32.
> 
> Constants are still broadcast, here inside the loop instead of hoisted.
> I think it'll probably end up best to use constants directly from memory
> (as in vpshufb's masks), falling back to these in-loop broadcasts when
> that can't work.
> 
> Change-Id: If17d51b9960f08da3612e51ac04424e996bf83d4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228366
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com

Change-Id: Id6cd5acd873499bb394009489d77e7636ecbc9c6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228462
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-18 23:21:24 +00:00
Mike Klein
558b639225 more JIT refactoring
This re-enables AVX2 JIT with simultaneous register assignment and
instruction selection.  You can see it working in a very basic way in
how we choose instructions and registers for Op::mad_f32.

Constants are still broadcast, here inside the loop instead of hoisted.
I think it'll probably end up best to use constants directly from memory
(as in vpshufb's masks), falling back to these in-loop broadcasts when
that can't work.

Change-Id: If17d51b9960f08da3612e51ac04424e996bf83d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228366
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-07-18 22:24:42 +00:00
Brian Osman
869a3e81ea Reland "Interpreter: Bounds check array access, add bool return from run"
This is a reland of f42de9e1e5

Original change's description:
> Interpreter: Bounds check array access, add bool return from run
> 
> Out of bounds access with constant indices is a compile error.
> At runtime, causes the interpreter to fail. Made several other
> conditions trigger the same failure logic, and updated all
> uses of the interpreter to validate success.
> 
> Change-Id: I3720b3c83903220b010ec574121fc64dbe102378
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228256
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

Change-Id: I8849de815f7efb730ac9c55b6edd296cb9ca7599
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228353
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-07-18 21:38:20 +00:00
Greg Daniel
00fb7243c0 Move read swizzle from GL ConfigInfo to FormatInfo.
With this change I also removed GrPixelConfig as param to supportedReadPixelsColorType().
This meant some updates had to be made to Vulkan and Metal to make sure they return the
right GrColorType.

Bug: skia:6718
Change-Id: I71b6360489cf499692c7b777e5915090fad05c56
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228349
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-18 19:42:10 +00:00
Mike Reed
634c9417bd add inverse() intrinsic function to sksl
Change-Id: Ic30f6e0345e851ea8a942996b9eaf2c894455e3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228236
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-18 19:07:49 +00:00
Mike Klein
62bccdaf3c move death back into Builder::Instruction
I find myself passing around parallel vectors of Builder::Instructions
and deaths so often that it just makes more sense practically to store
them together.  It's a little awkward that the values are only useful
after calling done(), but I can live with that.

Get a little more careful about mutation, passing Builder::Instructions
by const&.   Instead of extending lifetimes of live hoisted
instructions, just check for them in maybe_recycle_register() instead.

Change-Id: I1cb9e25c1a7c46a250c2271334821be8535353bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228367
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-18 19:01:44 +00:00
Brian Osman
52c1bf12b8 Interpreter: Fix code-gen for postfix ++/-- used only for side effect
Add a test case that previously asserted (due to incorrect code-gen
underflowing the stack).

Change-Id: I9df7a08b9ac5c7b5bc246129f3383dc723173351
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228351
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-07-18 18:48:04 +00:00
Brian Osman
3e6aa9f528 Revert "Interpreter: Bounds check array access, add bool return from run"
This reverts commit f42de9e1e5.

Reason for revert: All the SANs

Original change's description:
> Interpreter: Bounds check array access, add bool return from run
> 
> Out of bounds access with constant indices is a compile error.
> At runtime, causes the interpreter to fail. Made several other
> conditions trigger the same failure logic, and updated all
> uses of the interpreter to validate success.
> 
> Change-Id: I3720b3c83903220b010ec574121fc64dbe102378
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228256
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

TBR=mtklein@google.com,brianosman@google.com,ethannicholas@google.com,reed@google.com

Change-Id: I434601960d54fbd7d00e2af2dc6269a83a768c5b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228352
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-07-18 17:22:41 +00:00
Mike Reed
9724582271 return self from matrix setters to allow chaining
Change-Id: Ifd4c6bf5f5feb925f06067d50e491fd1a490f896
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228344
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-07-18 17:19:09 +00:00
Brian Osman
f42de9e1e5 Interpreter: Bounds check array access, add bool return from run
Out of bounds access with constant indices is a compile error.
At runtime, causes the interpreter to fail. Made several other
conditions trigger the same failure logic, and updated all
uses of the interpreter to validate success.

Change-Id: I3720b3c83903220b010ec574121fc64dbe102378
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228256
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-18 16:24:57 +00:00
Brian Salomon
c7dced5f68 Revert "Remove simple GrGpu::createTexture helper"
This reverts commit 83cfe4fa24.

Reason for revert:breaking the bots
Original change's description:
> 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>

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

Change-Id: Ie1f156ecd6264f41372dd13fae987df8fcafa564
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228343
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-18 15:02:16 +00:00
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