Commit Graph

249 Commits

Author SHA1 Message Date
Nathaniel Nifong
7635013ad1 Deserialize MultiPictureDocument based SKP files (with image sharing proc) in wasm debugger.
Change-Id: I73affae3cd05a2aa6ac1c75c8e049d352bbf3a85
Bug: 9176
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217135
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-06-20 17:33:04 +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
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
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
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
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
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
Brian Salomon
e2826ab59c Add API to invalidate GL texture parameters from GrBackendTexture.
This is modeled on how we coordinate VkImage layout changes between
GrContext and clients.

A type GrGLTextureParameters is used to track the current parameter
state.

When a client creates a GrBackendTexture in order to wrap a resource
they created a new GrGLTextureParameters is created and the wrapped
GrGLTexture will share ownership.

When GrContext creates a non-wrapped GrGLTexture, the GrGLTexture
creates a new GrGLTextureParameters and any GrBackendTextures created
from that GrGLTexture will share ownership.

Clients indicate parameter changes by calling
GrBackendTexture::glTextureParametersModified().

We still assume all texture parameters may have changed after a call
to GrContext::resetContext() (for now). The "timestamp" that is used
to implement this has been moved from GrGpu to GrGLGpu as there were
no other use cases.

Change-Id: Ic24e00488fad254a29d5eec6890278b67df6efae
Bug: skia:7966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217385
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-05 13:50:25 +00:00
Mike Klein
68c50d015b sketch an skvm
With all the thinking around a stack-based interpreter,
I figured I'd sketch out some ideas for a register VM too.

I kind of have the hunch that this is the direction that
will actually let us replace large amounts of Skia's CPU
backend with an efficient interpreter or JIT.

Change-Id: Ia2b5ba4a3fc27556f5b6ba95cd1ace46d3217403
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216665
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-06-03 19:53:48 +00:00
Robert Phillips
0c6daf034b Direct backend object allocation API
Change-Id: Ie8733a4db8061c67678a41cf239ce4407e967df7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212965
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-05-17 12:14:48 +00:00
Ben Wagner
5162a74b0a Remove GpuLayerCacheTest
The gpu code doesn't have a layer cache anymore to test.

Change-Id: Iec931112e5e12c90f2cad0c6012dfd1d0f14ad25
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213665
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-05-14 19:28:44 +00:00
Mike Klein
a705cb93c7 remove SkLiteDL
It's been dead code since it was inlined into Android last summer.

Change-Id: I252f6392d9436ef357f22a54bab8a33c9d1b3ea9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213625
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-05-14 18:55:44 +00:00
Chris Dalton
a6fcb761d8 ccpr: Clip path octo bounds by the scissor
Finds the (octagonal) intersection of the path's bounding octagon and
the scissor, and draws that octagon instead. This allows us to avoid
ever using the scissor when drawing paths to the main canvas. It will
also let us use that same octagon without scissor when resolving the
stencil buffer to coverage in MSAA mode.

Bug: skia:
Change-Id: Ia7fe60343424bc77532fa9919d3fa108337a5d63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212840
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-13 15:32:43 +00:00
Hal Canary
ac55784e33 Tests: re-sort gni, file name convention
Change-Id: I47c4b91805770bd68101e1503a8630243ef16c21
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212022
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2019-05-04 02:17:09 +00:00
Herb Derby
09db9d2175 Reland "SkShaper JSON output with cluster visualization"
This is a reland of 53610832a0

Fixes conversion of size_t to int.

Original change's description:
> SkShaper JSON output with cluster visualization
>
> A simple JSON output for diagnostic purposes.
> If the run is not 1:1 code points to glyphs, then
> break the run into clusters.
>
> Change-Id: I06980e0bac2cdca8a69b5b5ba0759a021fd4eb3b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209740
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Julia Lavrova <jlavrova@google.com>

Change-Id: I712293c4820eb23234d64fa019d28bac8b105637
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211986
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-05-03 15:48:46 +00:00
Hal Canary
fd24b1fe84 Shaper : new unit test
Bug: skia:9050
Change-Id: I4edc6528c4d625f95ce42b1f96fb0c419ce45134
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211831
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-05-03 15:02:35 +00:00
Mike Reed
670c6ec66e Revert "SkShaper JSON output with cluster visualization"
This reverts commit 53610832a0.

Reason for revert: trying to fix flutter roll

Original change's description:
> SkShaper JSON output with cluster visualization
> 
> A simple JSON output for diagnostic purposes.
> If the run is not 1:1 code points to glyphs, then
> break the run into clusters.
> 
> Change-Id: I06980e0bac2cdca8a69b5b5ba0759a021fd4eb3b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209740
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Julia Lavrova <jlavrova@google.com>

TBR=herb@google.com,jlavrova@google.com

Change-Id: I19f8e40032378a856453d059fb5dcdb2f117b75c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211940
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-05-03 11:30:37 +00:00
Herb Derby
53610832a0 SkShaper JSON output with cluster visualization
A simple JSON output for diagnostic purposes.
If the run is not 1:1 code points to glyphs, then
break the run into clusters.

Change-Id: I06980e0bac2cdca8a69b5b5ba0759a021fd4eb3b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209740
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2019-05-02 19:22:13 +00:00
Brian Osman
6c431d5202 Towards a simpler SkSL -> GLSL pipeline (and better shader reflection)
The pretty printer didn't actually need the original (separate) strings,
so make it just operate on a single SkSL::String. Also remove the unused
line numbering, and the unit test. (Testing of test code, yay!)

With that done, cut down on passing around arrays of char* + length, and
just do the compaction to a single SkSL::String in the program builder.

Change-Id: Ieef9d9a8e3c5620c011b17477f1b0f9a9faa6273
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208226
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-16 13:49:17 +00:00
Greg Daniel
a3aa75ab29 Add callback to flush for knowing when gpu is finished work.
Bug: skia:8802
Change-Id: I093c2a4e879b635b169a849d9af3e9f7a3d84a88
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207870
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-04-15 13:52:28 +00:00
Mike Reed
e3f17b911f remove SkMixer, since we have explicit lerps/blends in SkShader
Change-Id: I937861df9d8ae89c0587ea59dd740989bebd35a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207305
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-10 20:59:30 +00:00
Ethan Nicholas
0e9401dafe Initial checkin of new SkSL interpreter.
Not quite feature complete yet, but at a point where it's worth checking
in.

Bug: skia:
Change-Id: I21141d30e8582a79e94450d84e56bacc067249e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201685
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-21 15:41:10 +00:00
Adrienne Walker
08b0c97aa9 Add validation to reading kRec_SkDescriptorTags
Bug: chromium:940284, chromium:940843
Change-Id: Id6ce237781c6515f52341d3e56614e13e8ba76d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200045
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Adrienne Walker <enne@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-12 21:14:04 +00:00
Mike Reed
c723b70d91 Initial add SkMixers
Just using with composeshader for now, plan to try that sort of generalization
for colorfilters and imagefilters in follow-on cls.

Bug: skia:
Change-Id: Ic9650b8ea6f6278e6bfd657e90befbf9e71f383c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198823
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-12 20:27:12 +00:00
Brian Osman
e938c92fe7 Remove SkToSRGBColorFilter (now unused)
This was another stop-gap color management "solution".

Bug: skia:
Change-Id: I7c0c362840dd35aad51ad8780f2dab591c42a7e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199720
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-12 13:19:28 +00:00
Chris Dalton
d7291ba7a1 Restore support for multisample locations
Bug: skia:
Change-Id: I971455867e54d431cc1094fca041f773f78748ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196218
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-07 22:00:48 +00:00
Greg Daniel
39847ccfd0 Add unit test to check if we can create a VkDevice using global priority extension.
Bug: b/126595186
Change-Id: I0a23ca2a7cc47bd02bb535566aa37627899249ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197201
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-03-05 18:57:13 +00:00
Brian Salomon
1f05d459e2 Add GrContext::resetGLTextureBindings().
This function binds texture ID 0 to any texture unit/target combo that
Skia has modified.

Bug: chromium:926017
Change-Id: I3ac8f8050c863232886102886e60d3b91a5380c9
Reviewed-on: https://skia-review.googlesource.com/c/190663
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-08 21:26:51 +00:00
Mike Klein
455c74797b sketch SkVx
Change-Id: I1cb8113af243ed6327179d295835295834a752aa
Reviewed-on: https://skia-review.googlesource.com/c/189581
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-02-06 16:06:32 +00:00
Mike Reed
fdb876d4ee remove breakText, and all utf cache accessors
Bug: skia:
Change-Id: Ib7219e0844a4401f12f89d91eab60dbb7dda0121
Reviewed-on: https://skia-review.googlesource.com/c/188580
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-01 15:20:23 +00:00
Greg Daniel
24d861d8bf Add hardware buffer unit test from old skqp to skia.
This copies the hardware buffer unit test from, which was cherry picked
straight into skqp last year, into Skia proper.

There are not functional changes, but a few of the APIs have been updated
to work with newer Skia.

Bug: skia:
Change-Id: I2d7b2ed8b0b9314ca3e03e703a6a5ac53805275e
Reviewed-on: https://skia-review.googlesource.com/c/188034
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-01-31 17:44:52 +00:00
Mike Klein
ac262a0368 remove Sk4x4f.h -- dead code
Change-Id: I03d15a563eeb7ea187c7d48deffe00357dc55177
Reviewed-on: https://skia-review.googlesource.com/c/188032
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-01-30 19:00:21 +00:00
Mike Reed
5f528e5fd8 Revert "Reland "Revert "remove legacy code for text attributes on paint"""
This reverts commit 3c03c851ad.

Modification was to copy/assign fBitfieldsUInt rather than fBitfields,
since fBitfields might be smaller, and therefore ignore some bits that
we do use in hashing, etc.

Bug: skia:
Change-Id: I5965d5d64bd22bd60f0da797fdfeeffb730588ea
Reviewed-on: https://skia-review.googlesource.com/c/187307
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-28 18:27:26 +00:00
Mike Reed
3c03c851ad Reland "Revert "remove legacy code for text attributes on paint""
This reverts commit fd0bba81c0.

Reason for revert: PaintTest.cpp:150 failing

Original change's description:
> Revert "Revert "remove legacy code for text attributes on paint""
> 
> This reverts commit fb0e2aa8fd.
> 
> Bug: skia:
> Change-Id: I16bf3c999233f7498a4d76dfbcfb26be725e88f5
> Reviewed-on: https://skia-review.googlesource.com/c/187261
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: Ic52282f36841b7402a3a5466b93ef56ecdb6f51b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/187306
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-28 15:02:08 +00:00
Mike Reed
fd0bba81c0 Revert "Revert "remove legacy code for text attributes on paint""
This reverts commit fb0e2aa8fd.

Bug: skia:
Change-Id: I16bf3c999233f7498a4d76dfbcfb26be725e88f5
Reviewed-on: https://skia-review.googlesource.com/c/187261
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-28 13:56:24 +00:00
Mike Reed
fb0e2aa8fd Revert "remove legacy code for text attributes on paint"
This reverts commit 80f4adf98f.

Reason for revert: breaking PaintTest

Original change's description:
> remove legacy code for text attributes on paint
> 
> Bug: skia:2664
> Change-Id: I09f9d1401410d7ca338d7acde5a9660921c74da9
> Reviewed-on: https://skia-review.googlesource.com/c/185460
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

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

Change-Id: If9bbb92d6eb064aba30cfa9069051ff60585a269
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:2664
Reviewed-on: https://skia-review.googlesource.com/c/187260
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-28 00:18:09 +00:00
Mike Reed
80f4adf98f remove legacy code for text attributes on paint
Bug: skia:2664
Change-Id: I09f9d1401410d7ca338d7acde5a9660921c74da9
Reviewed-on: https://skia-review.googlesource.com/c/185460
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-27 23:54:45 +00:00
Ethan Nicholas
842d31b141 fixed Metal matrix constructors
Bug: skia:8544
Change-Id: Ie1e96ab1ef6e8c032fa510be36c035f91a1f6851
Reviewed-on: https://skia-review.googlesource.com/c/185687
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-01-25 18:37:34 +00:00
Chris Dalton
945ee652d7 Enforce non-overlap constraint from GrRenderTargetOpList
Enforces this constraint from one central location, rather than
relying on each Op to remember to check if overlap is allowed from its
onCombineIfPossible method.

Fixes an issue where we need to check the total bounds of both chains
for overlap (not the bounds of individual Ops).

Bug: skia:8671
Change-Id: I163651c868847884459acfc00d13ffdfca3a27c3
Reviewed-on: https://skia-review.googlesource.com/c/185815
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-01-23 16:48:15 +00:00
Michael Ludwig
c96fc37f23 Reland "Use specialized quad lists in rectangle ops"
This is a reland of 5820b0c3f3
It is updated in patchset 2 to clean up pointers passed into memcpy, and to
optimize the bounds calculation in GrPerspQuad. This should fix a performance
regression caused by the move away from caching 1/w. The Sk4f::invert() does not
always preserve 1/1 == 1, which led to bounds slightly outside of clips and
thus forced Skia to keep the scissor test enabled. The fix also restores the
optimization of skipping the 1/w division when the quad is known to be 2D.

Original change's description:
> Use specialized quad lists in rectangle ops
>
> Hopefully reduces memory footprint of GrFillRectOp and GrTextureOp
>
> The original rect code (GrAAFillRectOp) stored 2 SkMatrices (18 floats), 2
> SkRects (8 floats) an SkPMColor4f (4 floats) and a flag (1 int) for a total
> of 124 bytes per quad that was stored in the op.
>
> The first pass at the rectangle consolidation switched to storing device and
> local quads as GrPerspQuads (32 floats), an SkPMColor4f (4 floats) and a flag
> (1 int) for a total of 148 bytes per quad. After landing, several memory
> regressions appeared in Chrome and our perf monitor.
>
> Several intertwined approaches are taken here. First, GrPerspQuad no longer
> caches 1/w, which makes a quad 12 floats instead of 16. Second, a specialized
> list type is defined that allows storing the x, y, and extra metadata together
> for quads, but keeps the w components separate. When the quad type isn't
> perspective, w is not stored at all since it is implicitly 1 and can be
> reconstituted at tessellation time. This brings the total per quad to either
> 84 or 116 bytes, depending on if the op list needs perspective information.
>
> Bug: chromium:915025
> Bug: chromium:917242
> Change-Id: If37ee122847b0c32604bb45dc2a1326b544f9cf6
> Reviewed-on: https://skia-review.googlesource.com/c/180644
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Bug: chromium:915025, chromium:917242
Change-Id: I98a1bf83fd7d393604823d567c57d7e06fad5e55
Reviewed-on: https://skia-review.googlesource.com/c/182203
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2019-01-08 21:36:31 +00:00
Michael Ludwig
23d8943e5b Revert "Use specialized quad lists in rectangle ops"
This reverts commit 5820b0c3f3.

Reason for revert: Unanticipated gold image differences and performance regressions

Original change's description:
> Use specialized quad lists in rectangle ops
> 
> Hopefully reduces memory footprint of GrFillRectOp and GrTextureOp
> 
> The original rect code (GrAAFillRectOp) stored 2 SkMatrices (18 floats), 2
> SkRects (8 floats) an SkPMColor4f (4 floats) and a flag (1 int) for a total
> of 124 bytes per quad that was stored in the op.
> 
> The first pass at the rectangle consolidation switched to storing device and
> local quads as GrPerspQuads (32 floats), an SkPMColor4f (4 floats) and a flag
> (1 int) for a total of 148 bytes per quad. After landing, several memory
> regressions appeared in Chrome and our perf monitor.
> 
> Several intertwined approaches are taken here. First, GrPerspQuad no longer
> caches 1/w, which makes a quad 12 floats instead of 16. Second, a specialized
> list type is defined that allows storing the x, y, and extra metadata together
> for quads, but keeps the w components separate. When the quad type isn't
> perspective, w is not stored at all since it is implicitly 1 and can be
> reconstituted at tessellation time. This brings the total per quad to either
> 84 or 116 bytes, depending on if the op list needs perspective information.
> 
> Bug: chromium:915025
> Bug: chromium:917242
> Change-Id: If37ee122847b0c32604bb45dc2a1326b544f9cf6
> Reviewed-on: https://skia-review.googlesource.com/c/180644
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I6067b6c0e103d08787626a0a8eff753a0f0c97b6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:915025, chromium:917242
Reviewed-on: https://skia-review.googlesource.com/c/181167
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-01-04 14:51:48 +00:00
Michael Ludwig
5820b0c3f3 Use specialized quad lists in rectangle ops
Hopefully reduces memory footprint of GrFillRectOp and GrTextureOp

The original rect code (GrAAFillRectOp) stored 2 SkMatrices (18 floats), 2
SkRects (8 floats) an SkPMColor4f (4 floats) and a flag (1 int) for a total
of 124 bytes per quad that was stored in the op.

The first pass at the rectangle consolidation switched to storing device and
local quads as GrPerspQuads (32 floats), an SkPMColor4f (4 floats) and a flag
(1 int) for a total of 148 bytes per quad. After landing, several memory
regressions appeared in Chrome and our perf monitor.

Several intertwined approaches are taken here. First, GrPerspQuad no longer
caches 1/w, which makes a quad 12 floats instead of 16. Second, a specialized
list type is defined that allows storing the x, y, and extra metadata together
for quads, but keeps the w components separate. When the quad type isn't
perspective, w is not stored at all since it is implicitly 1 and can be
reconstituted at tessellation time. This brings the total per quad to either
84 or 116 bytes, depending on if the op list needs perspective information.

Bug: chromium:915025
Bug: chromium:917242
Change-Id: If37ee122847b0c32604bb45dc2a1326b544f9cf6
Reviewed-on: https://skia-review.googlesource.com/c/180644
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-03 21:31:52 +00:00
Greg Daniel
d207345456 Add cap to number of oplists we execute before flushing to the gpu.
This fixes a crash we saw when we switch vulkan copies as draws to creating
their own secondary command buffer. The crash came from the perf blendmode
tests when using an advanced blend mode. They would do 1000 draws which forced
us into creating 2000 command buffers (since the dst copies and the normal draws
each used them). I tested without the copies as draws change and just increasing
the total number of draws we do and was able to repro the crash.

Besides fixing the above OOM crash, I am also seeing a 5-10% perf gain on the
blendmode micro benches which is nice

Bug: skia:
Change-Id: I9266ea0ba02a755f54dabd4ee804963ab0c9b684
Reviewed-on: https://skia-review.googlesource.com/c/175436
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-12-07 17:57:07 +00:00
Mike Klein
ef4709b785 move blend-row routines to SkBlitter_ARGB32.cpp
SkBlend::RowFactory is only ever used to pass these function
pointers from SkBlitMask_D32.cpp to SkBlitMask_ARGB32.cpp,
so let's eliminate the middleman.

Change-Id: If74af775bb3cdc3eec9dc4ebeb180ac42b184a54
Reviewed-on: https://skia-review.googlesource.com/c/170062
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-09 15:41:21 +00:00
Mike Klein
4c683fce8f remove unused SkReadBuffer features
No need to keep the list of all those old unsupported version tags.

Everything related to SkDeduper.h was dead code.

fMemoryPtr was just an always null pointer.

SkReadBuffer::clone() doesn't do anything interesting.

DEBUG_NON_DETERMINISTIC_ASSERT doesn't do anything at all.

The whole custom factory feature was unused except by its unit test
and one other, which was using it to avoid a race to register those
types as deserializable.  I think some good old fashioned static
initialization can come to our rescue here...

Change-Id: Ie99dc957fc1035886bb55eaa3fc3339e73f9c320
Reviewed-on: https://skia-review.googlesource.com/c/163984
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-20 12:05:58 +00:00
Greg Daniel
64cc9aaaf1 Add drawDrawable support to GrRenderTargetContext.
This also includes adding drawable Op and plumbing it through to the GPU.

BUG=skia:

Change-Id: I0b2464c5a458c2fbf05b9528e47b9e6e3ac27d57
Reviewed-on: https://skia-review.googlesource.com/c/9645
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-10-19 19:48:03 +00:00
Mike Klein
36528e91c2 clean up SkPipe
One less SkCanvas subclass to deal with...

Change-Id: I21e81648026be5d732e8d9a28baed55015492a04
Reviewed-on: https://skia-review.googlesource.com/c/161584
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-12 16:50:21 +00:00
Dominic Mazzoni
656cefe65d Add initial support for generating tagged PDFs.
Adds an interface for the document creator to pass in a tree
of tags indicating the structure of the document, each with a type
(from a predetermined enum of possible types) and a node ID.
It also adds a setNodeId function to SkCanvas so that page content
can be associated with a particular tag. If both the tag tree and
marked content are present, Skia can now output a properly tagged
PDF.

An example program is included. When used properly, the PDF generated
by this patch is valid and the tags are parsed properly by Adobe
Acrobat. It handles many corner cases like content that spans more
than one page, or tags that don't correspond to any marked content, or
marked content that doesn't correspond to any tags.

However, it doesn't implement all of the features of PDF accessibility
yet, there are some additional attributes that can be associated with
some tags that need to be supported, too, in order to properly tag
things like figures and tables.

Bug: skia:8148
Change-Id: I2e448eca8ded8e1b29ba685663b557ae7ad7e23e
Reviewed-on: https://skia-review.googlesource.com/141138
Reviewed-by: Hal Canary <halcanary@google.com>
2018-09-27 19:35:40 +00:00