Commit Graph

4017 Commits

Author SHA1 Message Date
Brian Salomon
d628747dfb Make GrColorSpaceInfo store GrColorType.
This is largely redundant with GrPixelConfig. However, we intend to
remove GrPixelConfig.

Bug: skia:7580

Change-Id: I03d92303be832711f7821f8a97d36387c9b04a9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222883
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-25 14:29:09 +00:00
Brian Salomon
e7499c7e8a GrColorSpaceInfo stores SkAlphaType.
This means GrSurfaceContext's know their alpha type.
All GrRenderTargetSurfaceContexts are kPremul.

Make GrTextureProducer store GrColorSpaceInfo.

Bug: skia:7580
Change-Id: I5ff321ef52c0edd32e5fac99dff95d44aa66f592
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223184
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-24 17:48:01 +00:00
Emircan Uysaler
23ca4e7dc5 Enable creating protected vulkan backend
This CL allows user to indicate that they have a protected content in
GrVkBackendContext creation which results in protected CommandPool and Queue
usage.

Bug: skia:9016
Change-Id: I6a478d688b6988c2c5e5e98f18f58fb21f9d26ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210067
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Emircan Uysaler <emircan@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-24 16:04:00 +00:00
Chris Dalton
6ce447a4ec Eliminate mixed samples as an FBO type or AA type
From now on, sample counts always refer to the number of actual color
samples, and render targets don't have separate color and stencil
sample counts.

If mixed samples support is available when making a
"GrAAType::kCoverage" draw, then an op may attach and use a mixed
sampled stencil buffer internally. But this will all be invisible to
the client.

After this CL, we temporarily won't have a mode to use nvpr with mixed
samples. That will soon be fixed by a follow-on CL that enables nvpr
with mixed samples in the normal "gl" and "gles" configs.

Bug: skia:
Change-Id: I1cb8277f0d2d0d371f24bb9f39cd473ed5c5c83b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221878
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-24 04:08:45 +00:00
Michael Ludwig
b4580351c7 Fix subset behavior in makeWithFilter.
Most image filters were fixed with just the changes to SkImage::makeWithFilter
and the changes to SkSpecialImage's subset handling (particularly the
raster backend that could read from a bitmap view, or ganesh impls that relied
SkSpecialImage::draw).

The gpu implementation for alpha threshold, blurs, matrix convolutions,
and displacement maps have been updated to account for the special image's
offset when it reads from the backing texture.

Change-Id: I8778aa373e60e9268961305057b2bf6da2bdb3af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221121
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-06-21 21:00:17 +00:00
Robert Phillips
712f0a7bd3 Fix up wacky_yuv_formats GM
This makes NV12 and NV21 toggle on/off as a pair.

Bug: skia:9155
Change-Id: Ie0d3f2b3c0aba9a1777a722190bcf6aa5b5e85c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222460
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-21 16:47:42 +00:00
Michael Ludwig
fa97463793 Add lighting, alpha threshold, and tile image filters to GM
Bug: skia:
Change-Id: I43f723f617602de5ba2bf82ff2fe1286527a8cc6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222500
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-20 20:39:16 +00:00
Mike Reed
3fd3cc94c3 runtime shaders
This extends the runStriped to all for return data.
GPU impl not done yet, will be done in a follow-on CL.

Change-Id: Ib107d2945f6fdb34ce1b5405a6c88a5ae7e9f7ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221539
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-06-20 17:11:05 +00:00
Robert Phillips
6b973876ba Fix up wacky_yuv_formats GM and GL caps
This CL:
  enables the Y416 row (i.e., uses RGBA_16161616)
  spruces up the GL caps configuration of R16, RG16, RGBA16 and RG16F

Change-Id: I405c5acaf3f31b7ab0e9797e6f5df1d4c41d70d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220535
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-20 15:58:34 +00:00
Stephen White
1e1ad8dda9 Rename a shader variable to please MSL.
"vertex" is a reserved word in MSL. Rename the variable to "position".

Change-Id: I20a8bdd443cbdb1a41496728fc1ff388a02e1d24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222105
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-06-20 14:30:57 +00:00
Greg Daniel
2c3398dc26 Switch from querying swizzle on caps to using swizzles stored on proxies.
Change-Id: I03f4a3affd6dda7a83bee8eec768dcaa93a6b801
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220534
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-20 13:38:05 +00:00
Michael Ludwig
613282042d Reland "Consolidate quad optimizations into single internal function."
This reverts commit 7694b90eb0.

Reason for revert: suppression: https://chromium-review.googlesource.com/c/chromium/src/+/1666472
Original change's description:
> Revert "Consolidate quad optimizations into single internal function."
>
> This reverts commit 646616a78f.
>
> Reason for revert: Suspected as cause of layout test changes.
>
> Original change's description:
> > Consolidate quad optimizations into single internal function.
> >
> > Routes all non-textured quad draws through single internal function
> >
> > Change-Id: Ief66864a0ad2d598982c5bf500c8a84ecbf84387
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215455
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=robertphillips@google.com,michaelludwig@google.com
>
> Change-Id: I0dc6a0d948c0f5e9221ff6c9fbbbbbb9bc3d9bc0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221737
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I4e5d39d603d32b18c48db291fb1650fe33e9ba11
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222096
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-06-19 18:26:10 +00:00
Michael Ludwig
8d3e279ed9 Fix GM for preAbandonGpuContext flag
Bug: skia:
Change-Id: If54356b57b6aeba73857ab7d9ff5f78b51303910
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222101
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-19 18:16:08 +00:00
Michael Ludwig
d5fad8cc18 Overhaul makewithfilter gm to better show subset/clipping errors.
Tests more filter types since their implementations may differ in how
they access the underling SkSpecialImages.

Includes reference slides that use saveLayer with filters instead of
makeWithFilter+draw.

Bug: skia:9177

Change-Id: Ic40e2fb2c81ab72b2999ed3dbd9b06870d95d31e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221117
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-06-19 15:14:35 +00:00
Brian Salomon
7694b90eb0 Revert "Consolidate quad optimizations into single internal function."
This reverts commit 646616a78f.

Reason for revert: Suspected as cause of layout test changes.

Original change's description:
> Consolidate quad optimizations into single internal function.
> 
> Routes all non-textured quad draws through single internal function
> 
> Change-Id: Ief66864a0ad2d598982c5bf500c8a84ecbf84387
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215455
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I0dc6a0d948c0f5e9221ff6c9fbbbbbb9bc3d9bc0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221737
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-18 21:00:32 +00:00
Michael Ludwig
646616a78f Consolidate quad optimizations into single internal function.
Routes all non-textured quad draws through single internal function

Change-Id: Ief66864a0ad2d598982c5bf500c8a84ecbf84387
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215455
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-18 18:20:09 +00:00
Greg Daniel
f91aeb259e Move a bunch of gpu files out of include/private and into src/gpu.
In GrRecordingContext I moved the auditTrail onto the heap and only there
when compiling for tests. This allowed us to move a lot of files out of
include private.

Change-Id: Ib76ac211c0c6fd10bacaccf0c5f93f21a59f35d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221344
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2019-06-18 14:24:42 +00:00
Mike Reed
51cae01fd7 cache sksl in runtime colorfilter
With the modified gm, the time (on imac pro) goes from 2.4 to 1.6

Change-Id: I9f940220c129f74771f3b17126657bcf3739044f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221176
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2019-06-17 14:41:08 +00:00
Stephen White
0c72ed3057 GrTessellator: fix for even/odd fill type and path holes.
When extracting contours for the even/odd fill type, connected holes
in the interior of a shape don't get rendered correctly.

The fix is to extract the subcontours separately from the outer contour.
To do this, we abort contour extraction the first time we re-encounter
the starting vertex.  This causes the hole to be extracted as a
separate contour.

Bug: 908646
Change-Id: I047b77c74605987c40c12a228fd2898c9aa74e55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220776
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2019-06-13 21:09:45 +00:00
Mike Reed
d62d406aa2 Revert "Revert "try resolver pattern""
This reverts commit 2bafb64ed3.

Change-Id: I46f29284546a8978fd0005a0937e28410e5ac0da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220518
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-06-12 14:46:56 +00:00
Brian Salomon
cd5caa34fb Allow async read back GM to YUV to fail. Skip on DDL.
Currently fails on GrContext's that don't support transfer buffers.
TODO: fallback to synchronous read pixels.

Bug: skia:8962
Change-Id: I464ea00519013a371ba29912a0220fa42b252243
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220299
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>
2019-06-11 21:50:29 +00:00
Brian Salomon
024bd0058b Initial implementation of SkSurface::asyncRescaleAndReadPixelsYUV420.
Rescales a pixel rectangle from a SkSurface and then converts to YUV
planes. Currently only implemented on GPU.

Supports the same rescaling options as asyncRescaleAndReadPixels. The
RGB->YUV conversion is specified by a SkYUVColorSpace.

Y, U, and V are always separate planes. The U and V planes are
subsampled in X and Y by a factor of 2.

Currently fails if either the width or height of the rectangle is
not even.

Bug: skia:8962
Change-Id: I33237849a9ccf9b66cab13dc56785496f4ce556a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217123
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-11 16:04:03 +00:00
Herb Derby
2bafb64ed3 Revert "try resolver pattern"
This reverts commit a716809d5a.

Reason for revert: breaks google3

Original change's description:
> try resolver pattern
> 
> Change-Id: I32c5dbf4cacce9112df42a6f29800859625dc4a9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218965
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

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

Change-Id: Ib6facd0fda07762ed394b7b2c84771d7a93edae0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219488
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-11 16:01:14 +00:00
Mike Reed
a716809d5a try resolver pattern
Change-Id: I32c5dbf4cacce9112df42a6f29800859625dc4a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218965
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-06-11 12:35:38 +00:00
Robert Phillips
bb74990a11 Add P016 and P010 examples to wacky_yuv_formats GM
These formats are for HDR YUV.

This CL also adds partial support for Y416 but, without Ganesh support for RGBA_16161616, it can't be displayed.

Change-Id: I4218a104f2935d1395ee6c7c6792105092e1eeb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214220
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-10 22:04:14 +00:00
Robert Phillips
cb1adb40d0 Add srcData version of createBackendTexture API
Change-Id: I9679774d69e087a4ceb24de78e98585382bf8593
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218553
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-10 19:39:33 +00:00
Robert Phillips
d1d869d96e Make GL & Vk backends create uninitialized backend textures
We want the non-color, non-pixel-data version of createBackendTexture to truly create uninitialized textures.

Change-Id: I08867508ea181b7ba3685638cc7a3ea11d527a24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218396
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-10 16:27:07 +00:00
Ben Wagner
53ae936b84 Make rasterallocator test a bit better.
This cleans up some of the names to make it easier to understand.
Unfortunately, this also disables the 'common' code since it has issues
with pic-8888 and serialize-8888 configs.

Change-Id: I059d7594c357ba588daeb29643d242f7f510ecc1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218968
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
2019-06-07 19:31:22 +00:00
Greg Daniel
46cfbc67f6 Reland "Reland "Remove support for copyAsDraw in gpu copySurface.""
This reverts commit 4c6f9b7670.

Reason for revert: Landing with neuxs 7 and androind one fixes

Original change's description:
> Revert "Reland "Remove support for copyAsDraw in gpu copySurface.""
>
> This reverts commit 84ea04949c.
>
> Reason for revert: nexus 7 and android one broken
>
> Original change's description:
> > Reland "Remove support for copyAsDraw in gpu copySurface."
> >
> > This reverts commit c5167c053b.
> >
> > Reason for revert: fixed
> >
> > Original change's description:
> > > Revert "Remove support for copyAsDraw in gpu copySurface."
> > >
> > > This reverts commit 6565506463.
> > >
> > > Reason for revert: seems to break things?
> > >
> > > Original change's description:
> > > > Remove support for copyAsDraw in gpu copySurface.
> > > >
> > > > The major changes on a higher lever are:
> > > > 1) The majority of all copies now go through GrSurfaceProxy::Copy which
> > > > takes in a proxy and returns a new one with the data copied to it. This
> > > > is the most common use case within Ganesh.
> > > >
> > > > 2) The backend copy calls no longer do draws, require origins to be the
> > > > same, and won't do any swizzling or adjustment of subrects. They are
> > > > all implemented to be dumb copy this data to this other spot.
> > > >
> > > > 3) The GrSurfaceContext copy call has now been moved to priv and renamed
> > > > copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.
> > > >
> > > > 4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
> > > > of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
> > > > call the priv methods on GrSurfaceContext.
> > > >
> > > > Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > >
> > > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> > >
> > > Change-Id: Id43aa8aa1451e794342e930441d9975b90e6b59f
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218549
> > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> >
> > Change-Id: I1a96f85ae2ff7622a6b57406755d478e7fbcf56e
> > No-Presubmit: true
> > No-Tree-Checks: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218797
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: I310930a9df30535f45a065263a40239141e15562
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219384
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I88df4f19aa26ed77b5af4e25d138387cbabd1934
No-Presubmit: true
No-Tree-Checks: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219386
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-07 17:38:33 +00:00
Ben Wagner
2b4dcd381c Remove duplicate simple samples, make one a gm.
SampleBigBlur is super simple and now covered by gms and AnimBlur
sample.

SampleBigGradient now has a gm shallow_gradient_linear.

SampleConcavePaths has a more complete gm concavepaths.

SamplePoints now has an almost exact gm.

RasterAllocatorSample is made into a gm so that it will be run by d. It
appears to be the only test of SkRasterHandleAllocator, so it should
probably run.

Change-Id: Iad7b99d0f92898fc4b2fdccc5aae35d0277f2fff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219400
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-06-07 01:39:32 +00:00
Greg Daniel
4c6f9b7670 Revert "Reland "Remove support for copyAsDraw in gpu copySurface.""
This reverts commit 84ea04949c.

Reason for revert: nexus 7 and android one broken

Original change's description:
> Reland "Remove support for copyAsDraw in gpu copySurface."
>
> This reverts commit c5167c053b.
>
> Reason for revert: fixed
>
> Original change's description:
> > Revert "Remove support for copyAsDraw in gpu copySurface."
> >
> > This reverts commit 6565506463.
> >
> > Reason for revert: seems to break things?
> >
> > Original change's description:
> > > Remove support for copyAsDraw in gpu copySurface.
> > >
> > > The major changes on a higher lever are:
> > > 1) The majority of all copies now go through GrSurfaceProxy::Copy which
> > > takes in a proxy and returns a new one with the data copied to it. This
> > > is the most common use case within Ganesh.
> > >
> > > 2) The backend copy calls no longer do draws, require origins to be the
> > > same, and won't do any swizzling or adjustment of subrects. They are
> > > all implemented to be dumb copy this data to this other spot.
> > >
> > > 3) The GrSurfaceContext copy call has now been moved to priv and renamed
> > > copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.
> > >
> > > 4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
> > > of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
> > > call the priv methods on GrSurfaceContext.
> > >
> > > Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> >
> > Change-Id: Id43aa8aa1451e794342e930441d9975b90e6b59f
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218549
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: I1a96f85ae2ff7622a6b57406755d478e7fbcf56e
> No-Presubmit: true
> No-Tree-Checks: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218797
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I310930a9df30535f45a065263a40239141e15562
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219384
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-06 17:42:02 +00:00
Mike Klein
4b432fa87b run rewrite_includes.py
Just your basic periodic cleanup.

Change-Id: I04d9ca5cfff05e6e2c29dd9caef3ce12cda45247
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219340
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-06-06 17:11:02 +00:00
Greg Daniel
84ea04949c Reland "Remove support for copyAsDraw in gpu copySurface."
This reverts commit c5167c053b.

Reason for revert: fixed

Original change's description:
> Revert "Remove support for copyAsDraw in gpu copySurface."
>
> This reverts commit 6565506463.
>
> Reason for revert: seems to break things?
>
> Original change's description:
> > Remove support for copyAsDraw in gpu copySurface.
> >
> > The major changes on a higher lever are:
> > 1) The majority of all copies now go through GrSurfaceProxy::Copy which
> > takes in a proxy and returns a new one with the data copied to it. This
> > is the most common use case within Ganesh.
> >
> > 2) The backend copy calls no longer do draws, require origins to be the
> > same, and won't do any swizzling or adjustment of subrects. They are
> > all implemented to be dumb copy this data to this other spot.
> >
> > 3) The GrSurfaceContext copy call has now been moved to priv and renamed
> > copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.
> >
> > 4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
> > of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
> > call the priv methods on GrSurfaceContext.
> >
> > Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: Id43aa8aa1451e794342e930441d9975b90e6b59f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218549
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I1a96f85ae2ff7622a6b57406755d478e7fbcf56e
No-Presubmit: true
No-Tree-Checks: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218797
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-06 13:56:31 +00:00
Chris Dalton
5b5403e75b ccpr: Preserve fill rules for cached paths
Fixes a bug where even-odd fill rule was not being preserved on paths
that were reused from a stashed fp16 coverage count atlas.

Bug: skia:8782
Change-Id: I6698498a6f4c8df8eff10b19beb80e49663a577c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218047
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-06-05 18:24:08 +00:00
Greg Daniel
c5167c053b Revert "Remove support for copyAsDraw in gpu copySurface."
This reverts commit 6565506463.

Reason for revert: seems to break things?

Original change's description:
> Remove support for copyAsDraw in gpu copySurface.
> 
> The major changes on a higher lever are:
> 1) The majority of all copies now go through GrSurfaceProxy::Copy which
> takes in a proxy and returns a new one with the data copied to it. This
> is the most common use case within Ganesh.
> 
> 2) The backend copy calls no longer do draws, require origins to be the
> same, and won't do any swizzling or adjustment of subrects. They are
> all implemented to be dumb copy this data to this other spot.
> 
> 3) The GrSurfaceContext copy call has now been moved to priv and renamed
> copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.
> 
> 4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
> of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
> call the priv methods on GrSurfaceContext.
> 
> Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Id43aa8aa1451e794342e930441d9975b90e6b59f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218549
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-05 17:37:11 +00:00
Greg Daniel
6565506463 Remove support for copyAsDraw in gpu copySurface.
The major changes on a higher lever are:
1) The majority of all copies now go through GrSurfaceProxy::Copy which
takes in a proxy and returns a new one with the data copied to it. This
is the most common use case within Ganesh.

2) The backend copy calls no longer do draws, require origins to be the
same, and won't do any swizzling or adjustment of subrects. They are
all implemented to be dumb copy this data to this other spot.

3) The GrSurfaceContext copy call has now been moved to priv and renamed
copyNoDraw, and a new priv copyAsDraw was added to GrRenderTargetContext.

4) WritePixels and ReplaceRenderTarget both need to specifiy the destination
of copies. They are the only users (besides the GrSurfaceProxy::Copy) which
call the priv methods on GrSurfaceContext.

Change-Id: Iaf1eb3a73ccaf39a75af77e281dae594f809186f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217459
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-05 17:04:31 +00:00
Robert Phillips
4bdd36f625 Make color initialization version of createBackendTexture public
Mechanical.

Change-Id: I48be78a12684fc5243ee509e391984daa190fb7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218182
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-04 20:12:22 +00:00
Robert Phillips
806267973f Switch all internel uses of GrContext::createBackendTexture over to initialized versions
For Skia's testing we always want an initialized backend texture. Except for the
BackendAllocationTests of course.

Change-Id: I47b5e4c9845b3f58ebad5ba052780a69d6cd6954
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216348
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-04 14:42:27 +00:00
Michael Ludwig
663afe501a Move GrPathUtils, GrRect, and GrShape into src/gpu/geometry/
Change-Id: I864d3c2452f3affdc744bf8b11ed3b3e37d6d922
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216602
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-04 13:36:05 +00:00
Michael Ludwig
aa1b6b36a4 Make stencilRect() in GrRTCPriv more flexible.
All GrFillRectOps in core code go through a GrRTC call.

Also adds a utility constructor for non-AA rects since this simplifies clears
and tests/GMs that called GrFillRectOp directly. This helps preserve
readability without forcing them to go through the full rect drawing pipeline.

Change-Id: I6694c1aded3b89d773a897c483f7f2a51b06e6e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215089
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-29 19:30:31 +00:00
Brian Salomon
c7e9f78d10 Change async rescale and read GM to test diff number of x/y bicubic steps
Change-Id: I18db9602aa7d158aebd9549f393740229057b92b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216500
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-05-29 12:37:31 +00:00
Mike Reed
6a5f7e29a8 split RGB into YUV planes
Change-Id: Ifd1d010068691e187561a25aff45d8b67ae62c39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215442
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-23 19:57:30 +00:00
Robert Phillips
08ba085253 Revert "De-GL-ify tests, gm and tools"
This reverts commit 89fb346d2b.

Reason for revert: Google3 failure

Original change's description:
> De-GL-ify tests, gm and tools
> 
> Change-Id: Id15a3a4b2c8b80b9dc7ecdab1cf1af1f9282f442
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215447
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I155b033ac48d9fea15f66b22a090fb34f3bb81fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215521
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-22 20:23:56 +00:00
Robert Phillips
89fb346d2b De-GL-ify tests, gm and tools
Change-Id: Id15a3a4b2c8b80b9dc7ecdab1cf1af1f9282f442
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215447
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-22 19:24:17 +00:00
Stephen White
c4dbc3758f GrTessellator: improved straight skeleton implementation.
This patch improves the straight skeleton implementation used by
GrTessellator to collapse overlap regions in the alpha gradient border.
The resulting quality improvement can be seen in the
"thinconcavepaths" GM, for example, where the coverage values of
the "thin right angle", "thin rect and triangle" and "skinny snake"
are now lower and match the raster backend more closely. It also improves
correctness, such as on the linked Chromium bugs below.

Previously, the straight skeleton was performed using the same Vertex
and Edge classes used for tessellation, but this led to fragility in
maintaining the connectivity and ordering required by those classes.
Instead, that functionality has been moved to new SSEdge and SSVertex
classes. Their construction results in alternating SSVertex and
SSEdges around the boundary of the each overlap region, shrunk by one
SSEdge as the boundary collapses.

Applying events may now also create further events (chained events),
as intersections between newly-adjacent bisectors change the structure
of the skeleton. This is always calculated from the bisectors of
original boundary, not the shrunk boundary of the straight skeleton,
which is why each SSEdge points at its originating Edge. If the edges
are parallel or near-parallel, the bisector may be infinite. This is
handled by a new flavour of create_event(), which does a Line/Line
intersection (rather than an Edge/Edge intersection) to find the
intersection between the infinite bisector and an adjacent bisector.

Several ancillary bugs were fixed: the priority queue used to represent
edge events was sorting the inner edges incorrectly. These need to be
sorted in descending not ascending order of coverage. Its implementation
was moved from Skia's TDPQueue to std::priority_queue(), which is more
flexible in specifying a comparator.

check_for_intersection()'s partner synthesis code was moved into a new
function, compute_bisector(), also used by the chained skeleton events
code.

Degenerate edges are now removed during the simplify_boundary() pass.
They were previously detected but ignored, causing incorrect inner and
outer tangents to be computed in stroke_boundary().

An fSynthetic flag was added to Vertex, in order to detect vertices
which cannot be moved by an edge collapse event (e.g., intersections
with non-boundary edges, merged vertices, straight skeleton vertices).

More raw implementation notes:
Connect straight skeleton vertices as we find them, so we don't
have to use partnering (ss_connect()).
Only disconnect edges which are still alive after event application.
Add a check for near-parallel lines in compute_bisector().
Don't use edge type to determine direction to offset for bisectors.
The winding should already include this information.
Move Event ownership to SSEdge.
If we're down to the last two edges in a skeleton, don't check for events.
Add concave_arc_and_circle GM.
Add a collapsepaths GM.

Bug: 941429, 913349, 929915, 945853

Change-Id: Ib89e231d0e8611f8735fd3592db6391da096369d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215094
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-22 16:16:59 +00:00
Chris Dalton
1706cbffc7 Remove VisitorType from GrOp::visitProxies
We are planning to start detecting mipmaps and MSAA resolves during
the "gather" step now, so all visits should behave the same at this
point. (And it appears there might not have been any GrOps that
actually changed their behavior based on this flag at the moment.)

Bug: skia:
Change-Id: I7a7a1c9c47cbe03683c42025bf6d0ecb32a57ba1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215145
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-05-22 15:13:50 +00:00
Robert Phillips
f0313ee3c1 Rename createTestingOnlyBackendTexture to createBackendTexture
and other cruft from https://skia-review.googlesource.com/c/skia/+/214445 (Expand backend allocation API to allow an initialization color)

Change-Id: I33f53fde2bda6ed44e2eaf0772c629288adc00a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215120
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-21 18:42:55 +00:00
Brian Salomon
9be911cc0f return kSkip in async read GMs when context is abandoned
Change-Id: I78d076fe0bc0c49f57734b2b517f39407d92feea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214693
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2019-05-20 18:32:57 +00:00
Brian Salomon
af9b7b9f09 Fix async_rescale_and_read_no_bleed with --preAbandonGpuContext
Change-Id: Id2f2d76dfc7ba6865c7bd5c87960ff50b1ebd774
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214690
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-20 16:52:26 +00:00
Brian Salomon
286b5575d3 Reland "Make SkSurface::asyncRescaleAndRead use kStrict constraint"
This is a reland of 451b01fe09

Original change's description:
> Make SkSurface::asyncRescaleAndRead use kStrict constraint
> 
> Also fix crash if SkSurface has no color space.
> 
> Bug: skia:8962
> Change-Id: I5826ddb10daa46f286d2405b7229ea4f0aefa8f2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214306
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: skia:8962
Change-Id: I05713351f62cc738ec8a4bba6377e9aa7a044975
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214684
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-05-20 16:02:06 +00:00