Commit Graph

26307 Commits

Author SHA1 Message Date
Robert Phillips
8bd071998e Add GrVkResourceProvider::findCompatibleRenderPass variant that takes an AttachmentsDescriptor
The plan is to create an AttachmentsDescriptor and AttachmentFlags from the GrProgramInfo in order to get a GrVkRenderPass which can be used to findOrCreate a PipelineState.

This is pulled out of:
https://skia-review.googlesource.com/c/skia/+/288462 ([Omnibus] Add program pre-compilation to Vulkan backend)

Bug: skia:9455
Change-Id: I5bc3f65f92cee50567b7bd2d5f2414628869c9b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289222
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-05-12 18:01:13 +00:00
Mike Reed
48fcdacf9e only pass a real paint to drawPicture if we need to
drawPicture(..., paint)

If paint is non-null, drawPicture will always draw the picture into a
temp layer. Thus we should not blindly pass in a "filtered" paint unless
it will actually draw differently (other than the layer itself).

Side-effect: drawing into a layer is also much slower, so a 2nd reason
to not blindly pass in a non-null paint.

Change-Id: I766c0a129d3bb2882cab976fb2780ef9a09278ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289241
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-12 17:55:43 +00:00
Michael Ludwig
828d341199 Reland "Refactor stencil clip mask generation into helper"
This reverts commit de228e53fe.

Reason for revert: GrReducedClip now assumes context isn't abandoned,
windowrectangles GM abuses GrReducedClip and has to be abandon-aware.

Original change's description:
> Revert "Refactor stencil clip mask generation into helper"
>
> This reverts commit 8b3a8a5238.
>
> Reason for revert: GM assert failure
>
> Original change's description:
> > Refactor stencil clip mask generation into helper
> >
> > Change-Id: If3dc80efde3b44e87ba8e7af3a258896ec5e78e6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288977
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Chris Dalton <csmartdalton@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
>
> Change-Id: I16559f791601145f57d147cdae345c200af313f1
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289237
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

# Not skipping CQ checks because this is a reland.

Change-Id: I6a9372edecd0bdc1a38464ab85f7b7f3ca85e5ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289239
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-05-12 17:49:47 +00:00
Robert Phillips
f497c36625 Make GrVkResourceProvider::PipelineStateCache use GrGpu::Stats
This allows tracking of pre-compiled vs. inline-compiled pipelines.

This is pulled out of:
https://skia-review.googlesource.com/c/skia/+/288462 ([Omnibus] Add program pre-compilation to Vulkan backend)

Bug: skia:9455
Change-Id: I926b61c266c8d8b2ea4fb2b8aea35d308bac322b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289178
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-05-12 17:41:57 +00:00
Robert Phillips
3bce1f710a Non-substantive Vulkan backend changes
These changes just serve to muddy the water in the real CL.

This is pulled out of:
https://skia-review.googlesource.com/c/skia/+/288462 ([Omnibus] Add program pre-compilation to Vulkan backend)

Change-Id: I033ff7976ce0ee39e9e99b6dec1b80277f7c04ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289221
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-05-12 17:22:07 +00:00
Michael Ludwig
de228e53fe Revert "Refactor stencil clip mask generation into helper"
This reverts commit 8b3a8a5238.

Reason for revert: GM assert failure

Original change's description:
> Refactor stencil clip mask generation into helper
> 
> Change-Id: If3dc80efde3b44e87ba8e7af3a258896ec5e78e6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288977
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I16559f791601145f57d147cdae345c200af313f1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289237
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-05-12 16:17:35 +00:00
Michael Ludwig
8b3a8a5238 Refactor stencil clip mask generation into helper
Change-Id: If3dc80efde3b44e87ba8e7af3a258896ec5e78e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288977
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-12 15:27:18 +00:00
Adlai Holler
684838f1f5 Mark SkStringPrintf as SK_PRINTF_LIKE
Change-Id: I3d2ee8dca1d2e962794ce8c3c391779bff357f0c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288762
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-05-12 15:22:14 +00:00
Brian Osman
cb1c2624e7 SkMatrixProvider: Move local-to-device storage to base class
Simplifies all the helpers. Also changed "override" to "post-concat", to
reflect what it's really doing (because we're going to need post-concat
soon anyway).

Change-Id: Iff388998407441c8df418a3c8464eb8f6aad0786
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289197
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-05-12 15:22:13 +00:00
Xianzhu Wang
a1ed96b1cf Remove code resetting pixelGeometry for filters
The code wasn't executed because we always reset pixelGeometry to
kUnknown_SkPixelGeometry unless kPreserveLCDText_SaveLayerFlag
(which has not been actually used yet) was specified.

The client should be responsible to use
kPreserveLCDText_SaveLayerFlag only when it's appropriate.

Bug: chromium:1076019
Change-Id: Ie2a559445c11cae63db20976cbedee269fca6b24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289129
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-05-12 14:20:23 +00:00
Adlai Holler
00ddb0029d Reland "Support large kernels on GPU in matrix convolution effect"
This reverts commit a117e7b75b.

Reason for revert: Fixed divide-by-0 in the unpremul logic. This was here before but never caused problems (or we ignored them.)

Original change's description:
> Revert "Reland "Support large kernels on GPU in matrix convolution effect""
>
> This reverts commit 76cb9c4d4c.
>
> Reason for revert: Tegra3 & Metal issues
>
> Original change's description:
> > Reland "Support large kernels on GPU in matrix convolution effect"
> >
> > This reverts commit 41e377d1ba.
> >
> > Reason for revert: fixed issues
> >
> > Bug: skia:8449
> > Change-Id: I0c4389f0efa92c6da69253b2304ad9a072750965
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287817
> > Commit-Queue: Adlai Holler <adlai@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com,adlai@google.com
>
> Change-Id: I5c3f04d4d262550a3298b8fd677c8a1661be7ad9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8449
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289076
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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


Bug: skia:8449
Change-Id: I90b8e9e0eb52bc08308fb472eb216ed0bd4785a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289030
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-05-12 12:47:44 +00:00
Brian Salomon
3d2c41b773 Look for GL_ARB_texture_rectangle on SwiftShader contexts
Bug: skia:9832
Change-Id: Id3841a36dc94f16db4c06398944a7b0497344ccd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289136
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-05-12 12:45:53 +00:00
Adlai Holler
a117e7b75b Revert "Reland "Support large kernels on GPU in matrix convolution effect""
This reverts commit 76cb9c4d4c.

Reason for revert: Tegra3 & Metal issues

Original change's description:
> Reland "Support large kernels on GPU in matrix convolution effect"
> 
> This reverts commit 41e377d1ba.
> 
> Reason for revert: fixed issues
> 
> Bug: skia:8449
> Change-Id: I0c4389f0efa92c6da69253b2304ad9a072750965
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287817
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I5c3f04d4d262550a3298b8fd677c8a1661be7ad9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8449
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289076
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-05-11 20:17:26 +00:00
Brian Salomon
518fd4d9d0 Reland "Another fix for dash line thickness."
This is a reland of bf1904fd48

Fix for case of scaling matrix and update GM to use a scaling
matrix.

Original change's description:
> Another fix for dash line thickness.
>
> Use the device space offset from the dash centerline for
> antialiasing in y direction.
>
> Bug: chromium:1049028
>
> Change-Id: Ib6363579680d05cbf1fe34795695422baeca7065
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288764
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: chromium:1049028
Change-Id: I6d2b04f9cf5de302c41045c2e2494cee43092d9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-05-11 18:58:01 +00:00
Mike Klein
c74db7998b remove Assembler::here()
It's just a shortcut for

   Assembler::Label l;
   a->label(&l);

and it never really took off.
It's easier to work on Label without it.

Change-Id: I4a060f78f235ac3fcc87b996f5d9404ffba43c53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288997
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-05-11 17:42:40 +00:00
Greg Daniel
ed219fe171 Revert "Reland "Add api on GrContext to update the data of GrBackendTextures.""
This reverts commit 83c6626946.

Reason for revert: technospark is failing to upload pixmaps to non base mip levels

Original change's description:
> Reland "Add api on GrContext to update the data of GrBackendTextures."
> 
> This reverts commit 93ca54e0ac.
> 
> Reason for revert: relanding with fix
> 
> Original change's description:
> > Revert "Add api on GrContext to update the data of GrBackendTextures."
> > 
> > This reverts commit ac09f7cd7a.
> > 
> > Reason for revert: breaking bots, may need to use swizzled color for
> > correctness test
> > 
> > Original change's description:
> > > Add api on GrContext to update the data of GrBackendTextures.
> > > 
> > > Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> > > 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: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> 
> # Not skipping CQ checks because this is a reland.
> 
> Change-Id: I82283b2437e523b80acead71c5f7c651180620db
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288631
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> 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: I5d6614db8db59a69ded511726507a186596cfbd4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288907
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-11 15:48:40 +00:00
Adlai Holler
76cb9c4d4c Reland "Support large kernels on GPU in matrix convolution effect"
This reverts commit 41e377d1ba.

Reason for revert: fixed issues

Bug: skia:8449
Change-Id: I0c4389f0efa92c6da69253b2304ad9a072750965
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287817
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-11 15:40:09 +00:00
Ben Wagner
e08729ce23 Don't add empty segments to XPS figures.
Prior to this change if a path started with two move-to verbs in a row
the error

Could not set path segments.
src\xps\SkXPSDevice.cpp(1265) : error 0x80004003: Invalid pointer

would be emitted. The issue is that IXpsOMGeometryFigure::SetSegments
returns E_POINTER if any of the pointers passed to it are nullptr even
if the counts are all 0. Since the IXpsOMGeometryFigure already contains
the starting point there is no need to add the empty segment.

In addition, this re-orders some code to always use segmentTypes,
segmentData, and segmentStrokes in that order (the order they are passed
to SetSegments) for consistency.

Change-Id: I1aa141516c883f9286a50ac265acbbebc039d348
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288635
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-05-11 14:52:48 +00:00
Greg Daniel
83c6626946 Reland "Add api on GrContext to update the data of GrBackendTextures."
This reverts commit 93ca54e0ac.

Reason for revert: relanding with fix

Original change's description:
> Revert "Add api on GrContext to update the data of GrBackendTextures."
> 
> This reverts commit ac09f7cd7a.
> 
> Reason for revert: breaking bots, may need to use swizzled color for
> correctness test
> 
> Original change's description:
> > Add api on GrContext to update the data of GrBackendTextures.
> > 
> > Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> > 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: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

# Not skipping CQ checks because this is a reland.

Change-Id: I82283b2437e523b80acead71c5f7c651180620db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288631
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-11 14:45:08 +00:00
Mike Klein
6b08ddce05 most Labels are used _twice_
Once from the vector loop, once from the scalar loop.

Change-Id: I2d1cd0c95cd9254c664c29ace607d78ba752403a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288921
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-05-11 14:06:08 +00:00
Mike Klein
baf8921806 xor to make zero
Just noticed this while digging through skia:10210.

Not super important, but does make programs a little smaller,
and the vpxor reg,reg,reg stands out clearly in disassembly.

Could do the same for all-ones, but I think that's mostly
used from memory directly, by vptest.

Change-Id: I8372f7071a3c951f879d440bbd32640ebdfabf08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287858
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-05-11 13:54:18 +00:00
Brian Salomon
d7a5b59b1e Revert "Another fix for dash line thickness."
This reverts commit bf1904fd48.

Reason for revert: layout test needs update

Original change's description:
> Another fix for dash line thickness.
> 
> Use the device space offset from the dash centerline for
> antialiasing in y direction.
> 
> Bug: chromium:1049028
> 
> Change-Id: Ib6363579680d05cbf1fe34795695422baeca7065
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288764
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

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

Bug: chromium:1049028
Change-Id: Id2a9e737a757734af4e3e7db679eab0293a620b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288898
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-11 12:46:01 +00:00
jiepan
e947efb9d2 Avoid scale by alpha if unnecessary
~15% improvement for S32_alpha_D32_filter_DX on skylake-x.

nanobench result on 7900X(fixed frequency@3.2GHz)
                                before    after
bitmaprect_FF_filter_trans      524µs     453µs

Change-Id: I1c0c05915ecd3dc6f59da5eb49b5ae1c6cd98814
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288436
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-05-09 23:43:14 +00:00
Brian Salomon
bf1904fd48 Another fix for dash line thickness.
Use the device space offset from the dash centerline for
antialiasing in y direction.

Bug: chromium:1049028

Change-Id: Ib6363579680d05cbf1fe34795695422baeca7065
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288764
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-05-08 21:32:05 +00:00
Robert Phillips
fe3dce2c50 Preserve numSamples and numStencilSamples w/in the GrProgramInfo
We want to preserve this distinction so we can easily recreate the render target attachments.

This is pulled out of:
https://skia-review.googlesource.com/c/skia/+/288462 ([Omnibus] Add program pre-compilation to Vulkan backend)

Bug: skia:9455
Change-Id: Ic0d537c54d709bbb26a97b018d3107f4abbf4e27
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288743
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-05-08 20:03:43 +00:00
Robert Phillips
6913d1bb1d Make it clear that GrVkRenderPass::Create is modifying its AttachmentsDescriptor parameter
This is pulled out of:
https://skia-review.googlesource.com/c/skia/+/288462 ([Omnibus] Add program pre-compilation to Vulkan backend)

Bug: skia:9455
Change-Id: I2a24096edf6bb07945444272a022e5569dbf47b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288744
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-05-08 20:03:14 +00:00
Jim Van Verth
7359165e66 Automatically grow D3DRenderTargetView heap as needed.
Change-Id: I55cf2daa48ec694fc9e1939e270f55dd7a3162a7
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287619
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-05-08 17:49:50 +00:00
Brian Salomon
c683912173 Improve thin horiz/vertical dashed lines by not forcing width to 1.
It looks like a bug slipped in quite a while back here:
https://codereview.chromium.org/1092793006/diff/30002/src/gpu/effects/GrDashingEffect.cpp

where a width snapping that was supposed to apply to non-AA lines was
changed to apply to AA lines.

Adds GM that tests < 1 pixel wide dashed horiz/vertical lines.

The lines look better with the change but are still a little too thick,
depending on the subpixel offset.

BUG: chromium:1049028

Change-Id: I45734f5ef55548b62c188d9f55d3150c00059eed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288628
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-05-08 16:25:20 +00:00
Greg Daniel
93ca54e0ac Revert "Add api on GrContext to update the data of GrBackendTextures."
This reverts commit ac09f7cd7a.

Reason for revert: breaking bots, may need to use swizzled color for
correctness test

Original change's description:
> Add api on GrContext to update the data of GrBackendTextures.
> 
> Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> 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: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-08 15:38:21 +00:00
Greg Daniel
ac09f7cd7a Add api on GrContext to update the data of GrBackendTextures.
Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-08 15:15:00 +00:00
Mike Reed
a14084ba1b remove another bad assert
Change-Id: Id99da13183dfc512966768f8867ce7f7ca707c7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288621
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-08 00:31:16 +00:00
Mike Reed
656aac9203 fix assert
Change-Id: I27f5fd2082e65f1daf66e82d556a9cb4d34bb40b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288619
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-08 00:11:09 +00:00
Mike Reed
b0210d208c Revert "Revert "custom typeface""
Fix: const auto [...] --> auto [...]

This reverts commit 0066adefa9.

Change-Id: I5d2df8bcc2bc681259a55b2b851d53fb18599287
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288550
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-07 22:52:56 +00:00
Brian Salomon
08cb4bfa80 Ensure GrGaussianConvolutionFragmentProcessor::fKernel can be passed as float4[]
BUG: chromium:1075540

Change-Id: Ice300ec25f148b9ccf3db07b66f37859f4711a1f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288547
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-05-07 21:18:46 +00:00
Stephen White
bc24aedeff Dawn readpixels fixes.
The dawn backend was calling GrDawnGpu::flush() in a few places (in
particular, for readpixels).Since GrGpu::submitToGpu() is now
responsible for unmapping the staging buffers prior to command
submission, internally calling GrDawnGpu::flush() is error-prone,
since it requires you to unmapStagingBuffers() manually.

The fix is to get rid of GrDawnGpu::flush(), and put its guts into
GrDawnGpu::onSubmitToGpu(). Then we call submitToGpu(true) where we
used to call flush().

Also, make the backend responsible for moving staging buffers from the
active to the busy list. We do it just before calling mapAsync(),
since the callback may return right away and we want the buffer to be
in the busy state at that point.

Change-Id: I99cfa5e7ea3a454b0383a30483fa93795191347a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288516
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-05-07 20:38:30 +00:00
Chris Dalton
957189bfc2 Remove RawIter usages from pathops
Change-Id: Ib988271088cb1459d026faeb497eeed793172928
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287887
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-05-07 19:38:50 +00:00
Brian Osman
c66cd987f7 Reland "Revert "custom typeface""
This reverts commit 61642b3366.

Reason for revert: ../../src/utils/SkCustomTypeface.cpp(179,20): error: cannot decompose this type; 'std::tuple_size<const SkPoint>::value' is not a valid integral constant expression

Original change's description:
> Revert "Revert "custom typeface""
> 
> Fix: implement onComputeBounds() and generateFontMetrics()
> 
> This reverts commit 0066adefa9.
> 
> Change-Id: Idb59336a3d201bb97e494ee0e0bb189e0a7186f1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288536
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

# Not skipping CQ checks because this is a reland.

Change-Id: I6845bb96a00a0c9ee54704a4c299556cc32e6438
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288557
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-05-07 18:46:16 +00:00
Chris Dalton
1fc1bd3a03 Don't modify the pts array in SkOpEdgeBuilder::preFetch
Change-Id: I2596986cb203e00b1d6d24c0086e98eb6373142b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288178
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-07 18:41:20 +00:00
Mike Reed
61642b3366 Revert "Revert "custom typeface""
Fix: implement onComputeBounds() and generateFontMetrics()

This reverts commit 0066adefa9.

Change-Id: Idb59336a3d201bb97e494ee0e0bb189e0a7186f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288536
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-05-07 18:21:30 +00:00
Mike Reed
0066adefa9 Revert "custom typeface"
This reverts commit 3a79f33eca.

Reason for revert: MSAN issues

   Uninitialized value was stored to memory at
     #0 0x2cd74de in SkFontPriv::GetFontBounds(SkFont const&) /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkFont.cpp:400:34
     #1 0x31115ad in SkTextBlobBuilder::ConservativeRunBounds(SkTextBlob::RunRecord const&) /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:307:31
     #2 0x31104d2 in SkTextBlobBuilder::updateDeferredBounds() /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:374:47
     #3 0x31104d2 in SkTextBlobBuilder::make() /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:605:11
     #4 0x31175c1 in SkTextBlob::MakeFromText(void const*, unsigned long, SkFont const&, SkTextEncoding) /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:782:20
     #5 0x1920415 in UserFontGM::onOnceBeforeDraw() /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/gm/userfont.cpp:65:17


Original change's description:
> custom typeface
> 
> - only paths implemented at the moment
> 
> Seems if we want to serialize/deserialize these, we will need to
> register a factory with skia, so it can sniff the beginning of the
> font "file", to know how to recreate it.
> 
> Lots of follow-on things to explore:
> - do we need to even store/know advance widths?
> - should we also (optionally) support a CMAP? names? others?
> 
> Change-Id: If9fa99b7b8f6e265f06eb3ba2ca4fcb073275250
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287157
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: Iee93db8d0f94d706f0b97566d2d15e2ad2407601
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288463
Reviewed-by: Mike Reed <reed@google.com>
2020-05-07 16:51:09 +00:00
Mike Reed
3a79f33eca custom typeface
- only paths implemented at the moment

Seems if we want to serialize/deserialize these, we will need to
register a factory with skia, so it can sniff the beginning of the
font "file", to know how to recreate it.

Lots of follow-on things to explore:
- do we need to even store/know advance widths?
- should we also (optionally) support a CMAP? names? others?

Change-Id: If9fa99b7b8f6e265f06eb3ba2ca4fcb073275250
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287157
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-07 15:50:16 +00:00
Michael Ludwig
46d9138f17 Don't access resource cache limit on indirect contexts
Bug: chromium:1077355
Change-Id: Ie7a8310c07f6ba473e7937aa4c3cb435d488ef17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288459
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-05-07 15:22:08 +00:00
Ben Wagner
edea19858c Fix loaders for DW variable fonts.
This fixes several issues introduced with DirectWrite and onMakeClone.
The primary issue is that the font file loader and collection loader
need to remain registered until the last font using them is no longer
in use. Prior to onMakeClone this was just the original font, so
unregistration was simple. However, when cloning a new font is brought
into existence using the same loaders as the original. All clones need
to keep a reference to the loaders so that the last can unregister them.

In addition variable fonts complicated the concept of equality of fonts.
As a result when variable font support was introduced an Equal method
was provided to make comparison easier. Use it when available to avoid
issues when comparing two system fonts which differ only by their
variation design position.

Change-Id: I6aa8d8cc3240f1244d16f661f6fbfd17ff0f7412
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288159
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-05-07 14:45:45 +00:00
Brian Salomon
88d04cb51a Revert "Fix tile modes in SkGpuBlurUtils."
This reverts commit 9c4fa1e9cd.

Reason for revert: breaking things, maybe?

Original change's description:
> Fix tile modes in SkGpuBlurUtils.
> 
> Expand direct GM testing of SkGpuBlurUtils.
> 
> Decimate in SkGpuBlurUtils using GrSurfaceContext::rescale.
> GrSurfaceContext::rescale() works on recording context and
> uses approximate textures (to avoid memory issues for blurs
> of many different sizes).
> 
> Don't preserve contents to the top/left of the source bounds
> in the rescaled image.
> 
> GrGaussianConvolutionFragmentProcessor applies wrap mode to
> both axes.
> 
> Rely on GrTextureEffect to omit subset enforcement in shader
> by providing a domain rect rather than turning off tiling in
> caller.
> 
> Change-Id: I73e09b4fcbcbed590dd3599091c38d5de65f48c4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285099
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ifdbfd9bdc67a082bf99e62371a7037e9544cf12a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288269
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-05-06 21:47:17 +00:00
Greg Daniel
16032b33d9 Split apart creating and updating GrBackendTextures internally.
This change does not any public APIs but just pulls apart the create and
update steps inside of createBackendTexture. A future CL will allow just
calling update from the public API with an already create texture.

This change only splits apart the work for non compressed textures.
Compressed support can be added at a future time, but for many backends
it should be fairly trivial since the update call handles compressed and
uncompressed already.

Change-Id: Iae99e9f140c347effe66b5d669c6f39bce023115
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287856
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-06 20:02:04 +00:00
Robert Phillips
43e7e4f3e1 Add a work indication to SkDeferredDisplayList::ProgramIterator::compile
Chrome hopes to use this as a heuristic for when to yield. I.e., if no work is done, keep going but yield after each compile that did work.

Change-Id: I9524ca03078af3cd60f0042b2e8b0ec4c628e5f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288176
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-05-06 19:49:40 +00:00
Michael Ludwig
29c2f71cb8 Fix false positive in SkRRectPriv::ConservativeIntersect
Change-Id: I754fde671fcbaa2acf6443eb0a737b546e5c6f7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287889
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-05-06 19:49:39 +00:00
Brian Salomon
9c4fa1e9cd Fix tile modes in SkGpuBlurUtils.
Expand direct GM testing of SkGpuBlurUtils.

Decimate in SkGpuBlurUtils using GrSurfaceContext::rescale.
GrSurfaceContext::rescale() works on recording context and
uses approximate textures (to avoid memory issues for blurs
of many different sizes).

Don't preserve contents to the top/left of the source bounds
in the rescaled image.

GrGaussianConvolutionFragmentProcessor applies wrap mode to
both axes.

Rely on GrTextureEffect to omit subset enforcement in shader
by providing a domain rect rather than turning off tiling in
caller.

Change-Id: I73e09b4fcbcbed590dd3599091c38d5de65f48c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285099
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-05-06 19:44:35 +00:00
Adlai Holler
6d12c66653 Fix out-of-bounds read for matrix convolution effects with 25 size kernels
Bug: skia:10225
Change-Id: Iac111632868d064a8ff5ae9d7b4f6ad6731d4675
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288262
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-05-06 19:44:34 +00:00
Chris Dalton
041232a789 Remove usage of SkPath::RawIter in SkScan_Hairline.cpp
Change-Id: I09bf4a6cf1b3fa7ee3fc1074d9617bd6fd3a36c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287892
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-06 18:41:34 +00:00