Commit Graph

26097 Commits

Author SHA1 Message Date
Jim Van Verth
583c24c665 Allow to Metal to build with Xcode 10 again.
Flutter added outputting some system parameters that are only available
with Xcode 11. This hides them behind #ifs if the base SDK doesn't support
them.

Change-Id: Ica1e80580768806e526fb99be2cd9c69cf98c9ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283638
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-04-15 21:15:17 +00:00
Mike Klein
9bb88673f5 start on operand refactoring
This introduces Mem, a way of expressing x86 addressing:

   addr = base reg + offset imm + (scale imm * index reg)

using the usual x86 convention of index = rsp to indicate no index.

And then, this introduces GP64Operand and YmmOperand, which are
generalizations like YmmOrLabel that fold over all the types of
arguments available at that position.  (YmmOperand replaces YmmOrLabel).

There's still much to do, but I've started by generalizing most
of the Ymm instructions to take YmmOperand, and added some new
unit tests for vmovdqa to make sure all the various modes work.

Change-Id: Ie6cc1186310ff39c52a2a061431a91d10816c98a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283344
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-15 20:41:09 +00:00
Brian Osman
03e20ffa9a Cache inverse matrices in SkMarkerStack
Change-Id: I8dc74feaee91e99c294348b8092f5839fa9fa693
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283676
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-04-15 20:08:26 +00:00
Stephen White
b641ddbba0 Refactor GL and Metal FinishCallback into a helper object.
Change-Id: I52ede0363016459976e453ef71cafbcc6775f22e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283496
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-04-15 19:59:48 +00:00
Mike Reed
0f1f87d7bd transition matrix44 to opt-in only
In service of https://chromium-review.googlesource.com/c/chromium/src/+/2067862/

Change-Id: Ib6fd24c16c295fb4211dc295268af1e6f7f3fc45
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283661
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-15 18:34:26 +00:00
Herb Derby
31f6d043af Schedule using tree order traversal the DAG.
Trace out the tree from the DAG. Trace nodes
with fan-out > 1 after all out edges have been traced.

Change-Id: Ic078d212adf95a19146fcbd9fb8d103ea23360ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283557
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-04-15 17:13:06 +00:00
Brian Salomon
5ed3c2fe43 Reland "GaussianConvolutionFragmentProcessor uses GrTextureEffect."
This is a reland of eb48024f8b

No change from original, additional layout test suppression landed.

Original change's description:
> GaussianConvolutionFragmentProcessor uses GrTextureEffect.
>
> Also removes now unused GrShaderVar::appendArrayAccess.
>
> Bug: skia:10139
>
> Change-Id: Ic2583a6822e88510551b1031f3fb130266b3f395
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283440
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>

Bug: skia:10139
Change-Id: I890adc703b6077b6813ca6cb9f5211761e16a13e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283637
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-15 15:11:26 +00:00
Brian Osman
d1afef6b18 Support markers (custom matrices) in SkVertices Attributes
Bug: skia:9984
Change-Id: Ie799ffa19304978e2076f9ba790e8a34c1b03adf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283225
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-04-15 14:30:46 +00:00
Brian Salomon
68626439f3 Revert "GaussianConvolutionFragmentProcessor uses GrTextureEffect."
This reverts commit eb48024f8b.

Reason for revert: Failing additional layout test on Win10

Original change's description:
> GaussianConvolutionFragmentProcessor uses GrTextureEffect.
> 
> Also removes now unused GrShaderVar::appendArrayAccess.
> 
> Bug: skia:10139
> 
> Change-Id: Ic2583a6822e88510551b1031f3fb130266b3f395
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283440
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: I7403e97c51ba966e52679b5a048a962795c4271b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10139
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283636
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-15 12:56:28 +00:00
Mike Klein
151ffbb449 clean up SK_SUPPORT_LEGACY_COLORFILTER_NO_SHADER
Change-Id: Ibbb09aa820bd20ee6b3bc05ed4eb137fcba54d2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283579
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-15 01:29:45 +00:00
Herb Derby
9f64f7a068 Fix to change reject behavior back to original
The original code would reject glyphs that were too large
(!canDrawAsMask or !canDrawAsSDFT). After CL/251760 this behavior
was change so, that glyphs were only rejected once,
and then never again. The next stage (path, etc.) would then not
know to send a glyph in future draws. This code allows glyphs
that can't draw as mask and can't draw as SDFT be rejected.

I don't have a unit test yet.

BUG=chromium:1058517

Change-Id: I6117bc96a8f306be63ffea17b9f4a34e7388645e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281724
Reviewed-by: Khushal Sagar <khushalsagar@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-04-15 00:43:35 +00:00
Mike Klein
01d42b182d MSAN fix for interpreter
MSAN points out we oughta initialize anywhere we pull a trick like this,

    ptr[*ip+0] = skvx::if_then_else(mask(), POP().fFloat, ptr[*ip+0].fFloat);

Change-Id: I321f0d54b7f0f048df2e942dd70a6fabf6fd4efb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283493
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-14 22:10:45 +00:00
Brian Salomon
eb48024f8b GaussianConvolutionFragmentProcessor uses GrTextureEffect.
Also removes now unused GrShaderVar::appendArrayAccess.

Bug: skia:10139

Change-Id: Ic2583a6822e88510551b1031f3fb130266b3f395
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283440
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-04-14 21:47:35 +00:00
Brian Salomon
63410e921c Pass description of GrSurface to GrSurfaceProxy lazy callbacks.
Also make GrDynamicAtlas directly use the GrSurface callback type rather
than go through a springboard.

Change-Id: I3e3c155bbc1e2e794e0d6828b0ea3c64c6a7f3e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283226
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-04-14 21:34:05 +00:00
Greg Daniel
78be37f5cd Only call glFlush in submit when it is required.
Bug: chromium:1070474
Change-Id: I9131c3d931ec0d861fff4d92549d5d3fce8a123f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283503
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-14 21:07:14 +00:00
Herb Derby
a769ec5b5f Remove scheduler instruction dump
And abstract out writing a single instruction to
share between the dumps.

TBR=mtklein@google.com

Change-Id: I5e129889131b5581d61a0359a06643edeb0ef2ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283505
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-04-14 20:56:44 +00:00
Herb Derby
6e147e0081 Instruction dumper with extra notations
TBR=mtklein@google.com

Change-Id: Ia8ec221b08d4f804f0d6a2ba813ac974499b8fa0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283498
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-04-14 19:29:14 +00:00
Robert Phillips
44e2c5f0ba Add render task type to flush-time op spew
In the flush-time op spew it is clear which renderTasks are the Ops-based ones. This clarifies which of the other varieties occur.

Change-Id: I0e55b93f6e8d3cc0d9a9223f9c0ba967eeebb633
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283483
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-14 19:09:54 +00:00
Jim Van Verth
2b9f53edc0 Some D3D cleanup.
* Init D3D texture resources to an appropriate resource state
* Standardize struct initialization

Bug: skia:9935
Change-Id: Ie7113457d59503a25d60b7dc045fae670cf7aebf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283358
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-04-14 16:17:44 +00:00
Ethan Nicholas
5843012837 Add sample(child, matrix) to SkSL.
This allows fragment processors to sample their children with their
local coordinate system transformed by a matrix.

Change-Id: Ifa848bbd85b939bbc5751fec5cf8f89ee904bf39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282590
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-04-14 16:07:34 +00:00
Mike Reed
eb1d5a2e23 Move markerstack into its own object:
- owned by canvas
- pointed to by devices

Change-Id: Ia5abc60434cd34810ceea09ecab63c6b25eb972e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283436
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-14 13:43:34 +00:00
Brian Osman
efb084025e Fail gracefully in SkSLSlide on raster backend
The SlotCount of unsupported types (eg, fragmentProcessor) is zero,
causing things like vector_instruction to assert. Bail out before that
happens.

Change-Id: I24440bd67f09c2a645a54392185716b116f36ec6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283357
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-04-14 13:01:24 +00:00
Mike Reed
1b84ef2b50 [skvm] approx_atan2
I propose landing this, but then pause on extending math functions until
we develop a clearer migration story for sksl.

Change-Id: Id42ec37071da058e6e7809abe1ed0570d48df8e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283229
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-13 22:31:40 +00:00
Greg Daniel
c9624d5c73 Add sample quality to GrD3DTextureResourceInfo.
Change-Id: I3a33d2f80fcb243faec40b13960ea0310723e53e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283356
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-13 21:10:31 +00:00
Greg Daniel
ed4e52c379 Fill in the rest of the d3d pipeline besides shaders and root descriptor.
Change-Id: Ie21dece49a891f5c2dec5fe9385489ece88ae690
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283222
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-04-13 19:25:31 +00:00
Mike Klein
45d9cc86b3 remove i16x2 ops
These are neat but mostly just a distraction for now.
I've left all the assembly in place and unit tested
to make putting these back easy when we want to.

Change-Id: Id2bd05eca363baf9c4e31125ee79e722ded54cb7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283307
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-04-13 19:08:11 +00:00
Mike Klein
cb5110443f impl uniform16
One new instruction movzwl needed.

Change-Id: Ic70ba34d667eb6d570aeca88c4243e0c3309525f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283305
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-13 19:04:11 +00:00
Mike Klein
dec8ed65dd remove some integer comparison ops
They're all best implemented as compound operations,
either by swapping the arguments or bit-negating the
result, or both.

Change-Id: I429c10182b66be7211e9170037755cea617895ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283299
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-04-13 18:48:42 +00:00
Mike Klein
10fc1e66a9 skvm unit test cleanup
- let skvm tell us if FMAs are supported
  - unguard previously LLVM-only tests
  - simplify testing JIT and interpreter

We're getting close enough to always being able to JIT that carefully
marking what JITs and what doesn't is more annoying than helpful.
Now just test the JIT if present, and always test the interpreter.

Change-Id: I83762b38e0773ccaee795ae0fc9907e86628d73e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283275
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-13 18:48:01 +00:00
Robert Phillips
f3953d04a0 Non-substantive GrText-related changes
These are the dregs of the omnibus GrDrawOpAtlas CL

Change-Id: I0723346db293dd6650b905f661053955d2f46a1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279908
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-13 18:10:29 +00:00
Chris Dalton
3d28b6a2f1 Add a cap for when dual sided stencil refs and masks must match
Change-Id: Ice00a00cd7185131578669e9c1ca865341f0ed0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283274
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-13 18:03:18 +00:00
Jim Van Verth
bb60408d6c Clean up GrVkStencilAttachment
Removes unnecessary fields.

Change-Id: I7d2f4d5dff82d3778b3fa378187c7c6c072ae8e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283227
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-04-13 17:48:08 +00:00
Jim Van Verth
4f51f47d14 Add GrD3DStencilAttachment
Bug: skia:9935
Change-Id: I249b819d3cc1387aecde200907657ffcd67d1833
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282591
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-04-13 17:20:48 +00:00
Chris Dalton
ecd82d832f ccpr: Ensure stencil buffer gets fully reset to zero
There was a bug where nonzero values from even/odd fills, whose LSB==0
were not getting reset.

Change-Id: I93b311c079c766d14e63fa8ca535f80597465fd5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283267
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-13 16:20:02 +00:00
Robert Phillips
a6286055e6 Allow path renderers to self-identify
This is intended to help debug path renderer chain/selection behavior.

Change-Id: I581c4428c2f0cc586504f904255f88d0d4d5eb53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283220
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-13 16:14:07 +00:00
Robert Phillips
47064c6ec9 Make GrTextStrike::addGlyphToAtlas a static method in GrTextBlob.cpp
The text strike has very little to do with adding a glyph to an atlas.

Change-Id: I3f9da3d70587ef80aa7c20f1aa511ffdb09e7411
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282842
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-13 15:05:02 +00:00
Brian Osman
ab8f384df4 Remove threaded code
Change-Id: I8bd4ba328b024364972ddafff70fb31ec5a79001
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282621
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-04-13 14:54:52 +00:00
Robert Phillips
bf5bf74a94 Expand PlotLocator into a class
This centralizes the PlotLocator code (esp. the construction & accessors). It also allows just the PlotLocator to be passed to hasID - since the AtlasLocator is overkill for that call.

Change-Id: I424b2d075c40ed46219a623f0c99b3101bc7e043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282861
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-13 14:05:04 +00:00
Mike Reed
d468a1619a [skvm] approx_[asin,acos,atan]
Starting on atan2, but there is a lot of quadrant clean-up, so will
do that in a separate CL.

Change-Id: Ie1e70051a6ecb19a2e521b56ed09796e8e745276
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283016
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-13 12:17:02 +00:00
Brian Salomon
daf94c56bc Fix attrib order with local coords in AALinearizingConvexPathRenderer
Change-Id: Ie14204015dfcbaed55a2a4f86f5decc695b6a983
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283017
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-04-10 20:17:47 +00:00
Greg Daniel
fe159621e6 Reland "Split apart flushing and submitting in the GrGpu classes and GrDrawingManager."
This reverts commit 2faa33772b.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Split apart flushing and submitting in the GrGpu classes and GrDrawingManager."
> 
> This reverts commit 6341d92280.
> 
> Reason for revert: metal tests failing
> 
> Original change's description:
> > Split apart flushing and submitting in the GrGpu classes and GrDrawingManager.
> > 
> > Bug: skia:10118
> > Change-Id: I53e3b9f1bd28a00276a3d35b5160aa0cfec30cfd
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282417
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,senorblanco@chromium.org
> 
> Change-Id: I2cb98b470e3a066c09012b686e9942edb5a3979b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10118
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282852
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: skia:10118
Change-Id: I9a77abe995a991275a87ee1d38bcab4deb361a9d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-10 19:29:17 +00:00
Brian Salomon
a3762ee8bf Batch across view matrix changes in linearizing convex path renderer
Bug: chromium:1066338

Change-Id: Ibcb2aed1331e3069521e4b9d34fd9a1c5a1018c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282845
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-10 17:11:37 +00:00
Mike Reed
801ba0d606 approx_tan for skvm
Change-Id: I22c120db2535929bd20df3068cca1aecc57ae746
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282744
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-10 17:09:17 +00:00
Greg Daniel
2faa33772b Revert "Split apart flushing and submitting in the GrGpu classes and GrDrawingManager."
This reverts commit 6341d92280.

Reason for revert: metal tests failing

Original change's description:
> Split apart flushing and submitting in the GrGpu classes and GrDrawingManager.
> 
> Bug: skia:10118
> Change-Id: I53e3b9f1bd28a00276a3d35b5160aa0cfec30cfd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282417
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,senorblanco@chromium.org

Change-Id: I2cb98b470e3a066c09012b686e9942edb5a3979b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10118
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282852
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-10 16:24:17 +00:00
Brian Salomon
c505a45bac Remove GrCaps::getYUVAColorTypeFromBackendFormat().
We no longer need a color type to make a wrapped proxy.

Update image_from_yuv_textures GM to make single channel textures.

Make Image factories that infer SkColorChannel values for YUVAIndices
be smarter about picking the channel for single channel textures.

Bug: skia:10078

Change-Id: I84eeaae5c9197dec96c856ce4263b6bd674e7111
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282623
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-04-10 16:00:37 +00:00
Brian Salomon
a774193f70 Remove unused GrVkFormatColorTypePairIsValid
Change-Id: Id3d6ab46af71b2966cb55b65138f2d5e9129ca4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282848
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-04-10 15:57:40 +00:00
Greg Daniel
6341d92280 Split apart flushing and submitting in the GrGpu classes and GrDrawingManager.
Bug: skia:10118
Change-Id: I53e3b9f1bd28a00276a3d35b5160aa0cfec30cfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282417
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-10 15:48:48 +00:00
Stan Iliev
1db4d14e59 Trace texture upload always with Android framework
Test: Built on Android
Bug: b/142426387
Change-Id: I7ca32ffedd8896cbb105872cd1b3c746ff8ffe9d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282837
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
2020-04-10 15:48:37 +00:00
Jim Van Verth
96bfeff55c More fixes to get D3D tests running.
* Set up D3D backend texture creation
* Fix GrD3DBackendSurfaceInfo initialization
* Minor fix to get wrapped RTs into the cache

Bug: skia:9935
Change-Id: Ic5319a7d059c4d969894529a326a91de0192f9eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282679
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-04-10 15:19:18 +00:00
Robert Phillips
207d24bef9 Rename GrMeshDrawOp::Target::glyphCache to strikeCache
This renaming, obviously, propagates to the GrOpFlushState derived class.

This CL also removes GrStrikeCache access from:
  SkInternalAtlasTextContext - accessor not used
  GrAtlasManager             - strike cache not used internally


Change-Id: I7b82dc14be7ba7eabe604218f29f875f08a259a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282602
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-09 19:29:17 +00:00
Robert Phillips
e87106df32 Add check that the PlotLocator's plotIndex is consistent w/ the glyph rect
This verifies that the redundant information w/in the AtlasLocator stays consistent.

Bug: 1056730
Change-Id: Ic76d831c3086cfa85979771e1611853d99031f60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282614
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-04-09 18:57:06 +00:00
Robert Phillips
4d932d170f Move the GrStrikeCache from the recording context to the direct context
This solidifies that the strike cache and, thus, GrStrikes can't be used when recording DDLs.

TBR=bsalomon@google.com
Bug: 1056730
Change-Id: I15ce3ac2c0a9db0f476c03ef855bd14d22551043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282536
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-09 18:47:27 +00:00
Ben Wagner
cc81e202b4 Take MorphologyImageFilter radii as SkScalar.
The morphology image filters work on pixels, so took the radii as
integers. However, these radii will be mapped through the CTM, so any
rounding should happen as late as possible or the effect will be overly
discretized.

Bug: skia:10110
Change-Id: I62ab6c37d0b4612690addc48c9bc473099ac36b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282636
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-04-09 18:27:17 +00:00
Mike Klein
d7d1462b50 example of overdraw CF that we can JIT
Branch-free code translates to SkVM more easily than the branchy.

Caveat: the GM is not actually JITing with home-grown JIT today because
that JIT can't gather8, i.e. it can't sample from A8 images yet.  But it
works with SkVM interpreter and JITs with LLVM.

Change-Id: I41a6e1d6dda3a6d89a1150bfc7cbc63fe609d4e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282612
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-09 18:08:36 +00:00
Robert Phillips
51b3e60c6e Clean up GrText-related headers a bit
GrGlyph.h in particular was a bit out of date

Change-Id: I104a4ec3e417ac39856d2f557c61a0222722266b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282607
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-04-09 17:37:16 +00:00
Mike Reed
7fe6ee30c4 Add markCTM(id) api, to replace functionality of saveCamera.
Will need followups on Vertices and SkSL to use these handles.

Change-Id: If775cb01168f601541e889bfa2421129e505b4a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282416
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-09 17:07:36 +00:00
Mike Klein
5d1c163807 fix JIT min/max
x86 was relatively straightforward to fix... we were
passing the arguments in the wrong order.

As far as I can tell, we cannot use the native ARM instructions.
Instead, test and select.

Change-Id: I3411a72462e5d5f04881f0304318fd1ae8792900
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282316
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-09 14:23:35 +00:00
Jim Van Verth
332ab60287 D3D fixes to clean up crashes in tests
Filled in a few more methods, almost gets through tests w/o crashing now.

Bug: skia:9935
Change-Id: If3461db366333cd29c762e1afa51a0959c57689d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282275
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-04-09 13:13:54 +00:00
Robert Phillips
297a219dbf Delay creation of GrTextStrike and GrGlyphs until flush time
Bug: 1056730
Change-Id: If7f1101352e6629e1b31bb888e605984ac29f2e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282312
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-09 12:25:54 +00:00
Brian Osman
68219bfaca Add Usage::kColor to SkVertices custom attributes
Always treated as unpremul, RGB(A) sRGB colors. Automatically
transformed to destination color space, and premuled.

Bug: skia:9984
Change-Id: I78fdb16482f70714a8a8b64a9552e8874d7966fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282336
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-04-08 23:57:27 +00:00
Jim Van Verth
5ca3e54301 Fixes for running on the iOS simulator.
* Disable pixel formats not supported by Metal on the simulator
* Work around invalid sample count value in GLES

Change-Id: I711c3d906ef1c0a467dfc1fb5d36eac2277e7ae0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282270
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
2020-04-08 21:11:17 +00:00
Jim Van Verth
185d3d4fa7 Add onMap, onUnmap, and onUpdateData to GrD3DBuffer.
Fills in more methods for GrD3DBuffer. Still needs some
work to be fully functional.

Bug: skia:9935
Change-Id: If8d0be93c77c86d3d3578afcdc598b428c468da5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282136
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-04-08 20:31:37 +00:00
Brian Salomon
dc8fcdb735 Add getter for channels to GrBackendFormat
Bug: skia:10078

Change-Id: I0172a87d836a606a55e60b73ba255a41313e9c12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282266
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-08 19:54:27 +00:00
Mike Reed
d2c24c8aad more infixifcation -- no functional change
In general, I removed local helper functions, but not always...
in a few places, imho, mad() or mma() still made it a little easier to
read, but easy to change my mind if someone suggest they be 'inlined'.

No pixels diffs afaik

Change-Id: I15b6e611d3e367d7cd30d807369c64b00652157f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281860
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-08 19:22:16 +00:00
Greg Daniel
8561fc23c9 Update gpu flush semaphore contract.
From my scanning of clients this should not change how any of our main
users interact with semaphores. The biggest change here is that we don't
give up on submitted all the semaphores if a creation fails. We just
submit the semaphores we do have. It also makes it explicit that the
client is responsible for deleting any initialized semaphore regardless
if we were able to submit the semaphores or not or if the semaphore was
wrapped or created by Skia.

The motivation for this change is to more align the current API with
how things will work when we separate flushing and submit into different
calls.

Bug: skia:10118
Change-Id: I3e8b5d3a9852ddb2b5dc972fee21bf46ded7a36f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282265
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-08 17:30:16 +00:00
Stephen White
f3d5d44ec9 Dawn: staging manager rewrite.
Using many small staging buffers is quite costly for performance, for
example when there are many small texture uploads (such as MotionMark's
"canvas bouncing clipped rects" test).

Instead, the new manager uses buffers of 32K minimum, and returns
suballocations of those.

For now, allocation is simply iterates through the list of staging
buffers and returns the first one with enough remaining space.
This is O(N) in the number of staging buffers, which should be
ok since there are fewer of them. (If it becomes a hot path, we
can optimize it later.)

This also subsumes the UBO-specific staging buffer, since that one
did much the same thing but did not reuse staging buffers.

Change-Id: I4fddee8bb0fc602c49fe552acc327a640bf6917b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279921
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-04-08 16:11:48 +00:00
Mike Klein
df4b5bff0d get skvm/llvm building again
i8x4/I8x4 are unused since removing Op::bytes,
and since LLVM 10 we need to include IntrinsicsX86.h.

Change-Id: Ib4b60a31bb55b0f22a74c4c6b6ae5e50d075235f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282185
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-08 15:21:48 +00:00
Jim Van Verth
f6860405e1 Use fuzzier definition of zero-length segments in compute_intersection.
When working with segments in compute_intersection, we're often dividing
by the length squared. If that's 0, we'll end up dividing by 0. This
effectively puts a lower bound on the size of segment we can determine
intersections with other than treating it like a single point. We
arbitrarily choose the first endpoint as this point.

Bug: oss-fuzz:20009
Change-Id: I7581922f704ff8cef77456a80159cdb8ba3b716f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282160
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-04-08 11:13:18 +00:00
Mike Klein
4654d46260 add third stack-only jit strategy
Once again, coloremoji_blendmodes is asserting...
but otherwise seems ok.

Change-Id: I52eb8c0d1542913b6f1e69a5a5cdbb560366a7fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282178
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-04-08 01:15:17 +00:00
Mike Klein
eb7784e077 temporarily disable backend-specific min/max f32 impls
Change-Id: I1fe5da641f607cad190f13cbaf4d636d2f8b0598
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282189
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-08 00:08:07 +00:00
Mike Klein
07b2bafbbc build conservative stack frame on x86-64
Should be a behavior no-op, and effective perf no-op.

Change-Id: Iaf755c6938ae5060f11b1ccb83a9273fa53896b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282176
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-04-07 21:34:47 +00:00
Mike Klein
5e9f0ee13f add and test stack load/store
Change-Id: Ie0d29e31bd8c156ecd46cd658b5a4c53d8d2e11d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282115
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-07 21:15:47 +00:00
Brian Osman
62a0fb2837 Remove secret wireframe mode from drawVertices
Now, drawing vertices without colors or a shader simply fills with the
paint color, like anyone would expect.

Bug: skia:9984
Change-Id: I9f7cf72f89948756b9c2c6e055a11c6b64fc22ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282043
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-04-07 20:07:27 +00:00
Chris Dalton
03fdf6a9a9 Implement support for indirect draws
Change-Id: Ib1c0570d747bf9f46be3486f37eba3af53ed1e3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281642
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-04-07 19:41:18 +00:00
Robert Phillips
41bd97d3e4 Remove GrStrikeCache.h from all other header files
Change-Id: I77867f78a43f41629b665f5498736a085ed0a227
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282135
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-07 18:59:07 +00:00
Mike Reed
82ff25e02c approximate sine for skvm
Change-Id: I90f12cb305ff8daf64b07e5f47bb3a158df95bee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282120
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-04-07 18:32:17 +00:00
Mike Klein
4ba8d1f62a remove SK_USE_SKVM_BLITTER
Control everything with gSkUseSkVMBlitter, and that via --skvm flags.

We aren't skipping sprite blitters on the bots because
they're using the #define instead of the --skvm flag.
Might as well go all-in on the runtime flag now that
we have it... no need for the custom build jobs.

Change-Id: I56e5b1a72fecfc505aee5a26de6ee58666880922
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282124
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-07 17:51:57 +00:00
Mike Klein
1ae9672e10 drop luminance parens
The diff is tiny and not at all important.

Change-Id: I7fa1430975e5f2d08086929a8ba2305d0c64f196
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281788
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2020-04-07 16:56:47 +00:00
Chris Dalton
a77cdee048 Reland "Rename instanceAttribSupport -> drawInstancedSupport"
This is a reland of 17f05c737e

Original change's description:
> Rename instanceAttribSupport -> drawInstancedSupport
>
> Change-Id: I7d8ff8597849f2b910928867842857e25a12b4b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281582
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Change-Id: I2e15ac72d86747c30e71bb50d30da48a5a342772
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282118
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-07 16:54:37 +00:00
Chris Dalton
0999bce974 Reland "Remove GrGLGpu mirror methods of GL draw calls"
This is a reland of 4b239b1d50

Original change's description:
> Remove GrGLGpu mirror methods of GL draw calls
>
> Instead make these calls directly from GrGLOpsRenderPass.
>
> Change-Id: Id4d0812ca6b9242207e4f0c9130b43cfa375fd4f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281637
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Change-Id: I6a1b79534b236899bcc49a4acd23498be309d324
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282096
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-07 16:09:18 +00:00
Mike Reed
a735ad98db stage changing didCocnat44 virtual
SK_SUPPORT_LEGACY_DIDCONCAT44

Change-Id: Ie208c245d7121fddc693a7d3c5d6866441c27433
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281864
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-07 15:50:57 +00:00
Florin Malita
0022f5cf1b [SkTrimPathEffect] Preserve wrap-around continuity
In inverted mode (Mode::kInverted), the trim result represents the
logical segment [stop..start] (wrapping around at the path's end).

We currently emit two segments [0..start] and [stop..1], in that
exact order.  This behavior breaks continuity for single closed
contour paths.

Update SkTrimPath to

1) emit the segments in the correct order ([stop..1],[0..start])

2) skip the connecting moveTo for closed paths

Bug: skia:10107
Change-Id: Icd280554ba7291c985f504793feff104df2a4a99
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281882
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-04-07 14:40:17 +00:00
Robert Phillips
e19babf996 Remove GrAtlasManager.h from all other .h files
Having GrAtlasManager.h in GrContextPriv.h was needlessly propagating dependence on that header.

Change-Id: Idf5836f1e217ecd2da91f751b488a63a884c02ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281739
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-04-07 12:43:46 +00:00
Mike Reed
9ff25897db detect if the skip failed
Bug: 1068536
Change-Id: Ie68559aebb04d58446d30451abdb498fcf48af60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282056
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-07 12:32:36 +00:00
Chris Dalton
852ebea2d5 Reland "Reland "Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding""""
This is a reland of 0a51aa55f8

TBR=michaelludwig@google.com

Change-Id: I5bdbb93c4229c4cfdf8bcfc479cd2c4154d058ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281960
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2020-04-07 06:29:07 +00:00
Chris Dalton
5846ff3c7a Make glDraw*BaseInstance non-optional when extension(s) are present
TBR=michaelludwig@google.com

Change-Id: Ie9fc5eb6aee8cffde5d17a01fc816a1c49d02e9c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281881
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-07 04:02:07 +00:00
Chris Dalton
afbf2aa737 Revert "Reland "Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding""""
This reverts commit 0a51aa55f8.

Reason for revert: chrome

Original change's description:
> Reland "Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"""
> 
> This is a reland of 47d03f6ee5
> 
> Original change's description:
> > Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding""
> > 
> > This is a reland of d84b691950
> > 
> > Original change's description:
> > > Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"
> > > 
> > > This is a reland of e8c963d474
> > > 
> > > Original change's description:
> > > > Use glDraw.*BaseInstance calls to avoid deferred buffer binding
> > > > 
> > > > Change-Id: I968dab317673051acc65f87ea76a0d657d89b3d2
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279538
> > > > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > > > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > 
> > > Change-Id: I79b2d23e5e66d47214898a9068079b6fe2269599
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280806
> > > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > 
> > Change-Id: I9240c5cc6e58ce196be393c649bbdd86560602f0
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281077
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> 
> Change-Id: Id9e3aacaa7c693bef74454aeccbebf367c047fd3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281632
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

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

Change-Id: I227b4f0ec8704bd62f22965ff75aeb337786dbdc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281870
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-06 22:27:42 +00:00
Chris Dalton
935ba7e58a Revert "Remove GrGLGpu mirror methods of GL draw calls"
This reverts commit 4b239b1d50.

Reason for revert: chrome

Original change's description:
> Remove GrGLGpu mirror methods of GL draw calls
> 
> Instead make these calls directly from GrGLOpsRenderPass.
> 
> Change-Id: Id4d0812ca6b9242207e4f0c9130b43cfa375fd4f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281637
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I8071e977ac67fd8bf691f9f3ddf2dcca7e83657a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281869
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-06 22:23:57 +00:00
Chris Dalton
31c028c54b Revert "Rename instanceAttribSupport -> drawInstancedSupport"
This reverts commit 17f05c737e.

Reason for revert: chrome

Original change's description:
> Rename instanceAttribSupport -> drawInstancedSupport
> 
> Change-Id: I7d8ff8597849f2b910928867842857e25a12b4b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281582
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I2b28e3066f27b9d63713f93c0b44d7ba92fcdba9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281868
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-06 22:22:37 +00:00
Mike Klein
aae8d13b09 make gUseSkVMBlitter take over sprite draws
Today they all still use legacy or SkRP if applicable.
Returning nullptr makes us fall back into the normal
blitter choice flow.

This is an interesting integration point where we
could create an SkVMBlitter with a varying for the
color pipeline, bypassing the usual SkShader flow.

Change-Id: I6f5acadd2829bf39d82e7bcd144407cd9d97f1bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278811
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-06 22:14:27 +00:00
Michael Ludwig
469dd641cc Use round for morphology radius
The fiddle: https://fiddle.skia.org/c/1a0202dd230713064ad90b627c7de47d
highlighted an issue with the old conversion from float to int for the
mapped dilate/erode radii. Depending on the canvas matrix and the scale
extraction floating point error, the computed float raddi would be
very close to 1.0 (for a nominal radii = 1), but actually be 0.9999.

The floor would turn this into a 0 integral radius and then the image
filter implementation would determine that no operation was needed.
Switching to round fixes the issue present in the filter. This may
cause some GMs to change as it does change how the floating point radii
are mapped. Now, for fractional radii, we will jump up to the next
kernel size a little sooner.

The SVG spec appears ambiguous in terms of rounding behavior for these
scenarios. The other kernel-based image filters that I checked
(matrix, blur, drop-shadow) are all defined in device space, or use
a sigma to determine kernel size, so morphology filters are somewhat
unique. This means we don't need to worry about creating a
discrepency between this filter's kernel rounding behavior and other
filters' behaviors.

Bug: skia:10066
Bug: skia:10110
Change-Id: I6b3daa4c1242273ce924e22ba6de5eb25a7a96bc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281731
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-04-06 22:01:39 +00:00
Mike Klein
06323daaed full clamp in clip_color
I think this will let us land the sprite blitter change.

Change-Id: Ifee3a823e1389800f35e964413d816ea0b388364
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281787
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-06 21:33:48 +00:00
Mike Reed
2f92c93dc7 virtual for saveCamera
Change-Id: Iff486ae8dbf94971cfd513954299e2635c13ef1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281585
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-06 21:31:47 +00:00
Brian Osman
aa9983aec8 Add usage field to SkVertices::Attribute
Bug: skia:9984
Change-Id: I237585fe8c7178f3a0a108afaa02d07fd8e202b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281438
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-06 21:26:17 +00:00
Mike Reed
16992e1ced simplify some HSL blend modes in skvm
Starting to look at https://skia-review.googlesource.com/c/skia/+/278811
and noticed we could do some local cleanup.

Just readability -- no functional change.

Change-Id: I3f2d64979a1c251ddb11eff42f8f6d6c37699875
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281784
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-04-06 21:04:07 +00:00
Mike Klein
2f23bae659 basic runtime color filters on skvm
Now with enough implemented to also run runtime_colorfilter.

This won't actually run without
https://skia-review.googlesource.com/c/skia/+/278811.

Change-Id: I55c69e9135f381ef58a0b69ee985d377c3888ec1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281750
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-04-06 19:26:37 +00:00
Ethan Nicholas
16464c3232 Tracking uniform ownership
This is a prerequisite change for the upcoming sample(child, matrix)
function. By itself, this CL doesn't really change anything; it just
adds an ownership tracking feature which sample(child, matrix) depends
on.

Change-Id: I98b12e5fb062a2535af367931e7a932ea9c63a59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281337
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-04-06 19:02:37 +00:00
Chris Dalton
17f05c737e Rename instanceAttribSupport -> drawInstancedSupport
Change-Id: I7d8ff8597849f2b910928867842857e25a12b4b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281582
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-06 18:53:57 +00:00
Chris Dalton
4b239b1d50 Remove GrGLGpu mirror methods of GL draw calls
Instead make these calls directly from GrGLOpsRenderPass.

Change-Id: Id4d0812ca6b9242207e4f0c9130b43cfa375fd4f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281637
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-06 18:45:07 +00:00
Chris Dalton
0a51aa55f8 Reland "Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"""
This is a reland of 47d03f6ee5

Original change's description:
> Reland "Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding""
> 
> This is a reland of d84b691950
> 
> Original change's description:
> > Reland "Use glDraw.*BaseInstance calls to avoid deferred buffer binding"
> > 
> > This is a reland of e8c963d474
> > 
> > Original change's description:
> > > Use glDraw.*BaseInstance calls to avoid deferred buffer binding
> > > 
> > > Change-Id: I968dab317673051acc65f87ea76a0d657d89b3d2
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279538
> > > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > 
> > Change-Id: I79b2d23e5e66d47214898a9068079b6fe2269599
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280806
> > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> Change-Id: I9240c5cc6e58ce196be393c649bbdd86560602f0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281077
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

Change-Id: Id9e3aacaa7c693bef74454aeccbebf367c047fd3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281632
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-06 18:43:10 +00:00