Commit Graph

24 Commits

Author SHA1 Message Date
Michael Ludwig
7c12e28cf4 Reland "GrClips provided as pointers to GrRTC"
This reverts commit 074414fed5.

Reason for revert: updated to guard against nullptr before calling
quickContains(rrect).

Original change's description:
> Revert "GrClips provided as pointers to GrRTC"
>
> This reverts commit 226b689471.
>
> Reason for revert: Breaks Android roller
>
> Original change's description:
> > GrClips provided as pointers to GrRTC
> >
> > A null clip represents no high-level clipping is necessary (the implicit
> > clip to the render target's logical dimensions is fine).
> >
> > This also removes GrNoClip and GrFixedClip::Disabled() since they are
> > replaced with just nullptr.
> >
> > By allowing nullptr to represent no intended clipping, it makes it easier
> > to require GrClip and GrAppliedClip objects to know about the dimensions
> > of the device. If we required a non-null clip object to represent no
> > clipping, we'd have to have an instance for each device based on its
> > size and that just became cumbersome.
> >
> > Bug: skia:10205
> > Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
>
> Change-Id: I42c4828bcf016ee3d30d5c20b771be96e125817b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10205
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292856
> Reviewed-by: Weston Tracey <westont@google.com>
> Commit-Queue: Weston Tracey <westont@google.com>

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

# Not skipping CQ checks because this is a reland.

Bug: skia:10205
Change-Id: I5715a4de3b7c8847b73020dc4937d3816d879803
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292876
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-05-29 15:09:54 +00:00
Weston Tracey
074414fed5 Revert "GrClips provided as pointers to GrRTC"
This reverts commit 226b689471.

Reason for revert: Breaks Android roller

Original change's description:
> GrClips provided as pointers to GrRTC
> 
> A null clip represents no high-level clipping is necessary (the implicit
> clip to the render target's logical dimensions is fine).
> 
> This also removes GrNoClip and GrFixedClip::Disabled() since they are
> replaced with just nullptr.
> 
> By allowing nullptr to represent no intended clipping, it makes it easier
> to require GrClip and GrAppliedClip objects to know about the dimensions
> of the device. If we required a non-null clip object to represent no
> clipping, we'd have to have an instance for each device based on its
> size and that just became cumbersome.
> 
> Bug: skia:10205
> Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I42c4828bcf016ee3d30d5c20b771be96e125817b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10205
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292856
Reviewed-by: Weston Tracey <westont@google.com>
Commit-Queue: Weston Tracey <westont@google.com>
2020-05-29 12:55:44 +00:00
Michael Ludwig
226b689471 GrClips provided as pointers to GrRTC
A null clip represents no high-level clipping is necessary (the implicit
clip to the render target's logical dimensions is fine).

This also removes GrNoClip and GrFixedClip::Disabled() since they are
replaced with just nullptr.

By allowing nullptr to represent no intended clipping, it makes it easier
to require GrClip and GrAppliedClip objects to know about the dimensions
of the device. If we required a non-null clip object to represent no
clipping, we'd have to have an instance for each device based on its
size and that just became cumbersome.

Bug: skia:10205
Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-28 18:55:13 +00:00
Greg Daniel
0a2464f51f Update internal skia uses to use flushAndSubmit and submit calls.
Bug: skia:10118
Change-Id: Ieb7c0eece56d3d9df56ecb52e00e76c01f038de8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289888
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-14 20:26:44 +00:00
Robert Phillips
e19babf996 Remove GrAtlasManager.h from all other .h files
Having GrAtlasManager.h in GrContextPriv.h was needlessly propagating dependence on that header.

Change-Id: Idf5836f1e217ecd2da91f751b488a63a884c02ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281739
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-04-07 12:43:46 +00:00
Brian Salomon
df1bd6dd0a Remove texture swizzle from GrSurfaceProxy.
Bug: skia:9556


Change-Id: I2c450c51e1a0987aacebdfcf32ef76cd31f0e80b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279656
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-27 17:01:07 +00:00
Greg Daniel
3a36511f21 Remove origin from GrSurfaceProxy.
Bug: skia:9556
Change-Id: Ic95a3a6b11e1ff8a6f6b2f5c5aeb9037b72aae90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270840
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-14 16:52:58 +00:00
Brian Salomon
a56a746b7e Remove GrSurfaceDesc
Replace with SkISize.
Also change some const SkISize& params to just SkISize.

Change-Id: I3c72d961662eefeda545fba17d63e877cd5ca813
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269374
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-02-07 19:48:13 +00:00
Greg Daniel
b58a3c7331 Remove fConfig from GrSurfaceDesc.
Bug: skia:6718
Change-Id: I586e10c828d5d0a0b3e46d8efd7400991b98d5c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265978
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-01-23 15:53:36 +00:00
Greg Daniel
47c20e81bc Pass swizzle into createProxy instead of inferring from GrPixelConfig.
This whole change is basically work that will all get reverted shortly
when GrSurfaceProxy no longer stores swizzle. But for now this helps
get rid of a use of pixel config.

Bug: skia:6718
Change-Id: If911360a8a9d2c52a58b5795386484634885b3f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265579
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-01-21 20:58:32 +00:00
Greg Daniel
e20fcad156 Reland "Move makeDeferredRenderTargetContext calls to factory on RTC."
This reverts commit a4f207eb67.

Reason for revert: Landing with fix

Original change's description:
> Revert "Move makeDeferredRenderTargetContext calls to factory on RTC."
>
> This reverts commit 1c16b43033.
>
> Reason for revert: Red on tree
> Original change's description:
> > Move makeDeferredRenderTargetContext calls to factory on RTC.
> >
> > Change-Id: Iaa8f5829d9f8650ff27a60f75fb2216f016ab85e
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262058
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com
>
> Change-Id: I9e3c9d13c66b5437c87ad7136d283fa4ac81df1f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263019
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

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

Change-Id: If4ec8316a952fb482471c22273f4724f9b30a998
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263022
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-01-08 19:13:14 +00:00
Jim Van Verth
a4f207eb67 Revert "Move makeDeferredRenderTargetContext calls to factory on RTC."
This reverts commit 1c16b43033.

Reason for revert: Red on tree
Original change's description:
> Move makeDeferredRenderTargetContext calls to factory on RTC.
> 
> Change-Id: Iaa8f5829d9f8650ff27a60f75fb2216f016ab85e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262058
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I9e3c9d13c66b5437c87ad7136d283fa4ac81df1f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263019
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-01-08 13:31:21 +00:00
Greg Daniel
1c16b43033 Move makeDeferredRenderTargetContext calls to factory on RTC.
Change-Id: Iaa8f5829d9f8650ff27a60f75fb2216f016ab85e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262058
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-01-07 21:14:13 +00:00
Michael Ludwig
379e4961fd Merge consecutive entries that share proxy in bulk texture op
Previously, a batch draw that reused the same proxy consecutively
would create a ViewCountPair for each set entry, with its count == 1.
This turned into 1 draw per entry, so although there'd still be a single
pipeline, it didn't take advantage of merging those consecutive entries
into a larger draw to reduce draw count as well.

Initially, the thinking for the batch API was that it was for tilers
that used unique images for each tile or render pass. However, Chrome's
compositor is also responsible for rendering 9 patches as part of the UI.
These appear as 9 consecutive entries in the image set that all refer to
the same texture. With this CL the texture op will automatically merge
such occurrences into one ViewCountPair with a count of 9.

The bulkrect_1000_[grid|random]_sharedimage_batch leverages this case.
Before this CL its op would hold 1000 view count pairs that each drew
one quad. Now its op will hold 1 view count pair with a count of 1000.
On my linux workstation, the bulkrect_1000_grid_sharedimage_batch time
went from 377us to 206us. For reference, the _ref variant (which already
was a 1 view count pair with ct == 1000 due to merging of each op) has
a time of 497us. The difference between 497us and 206us represents the
overhead of calling through SkCanvas, op creation, quad optimization
analysis 1000x.

Interestingly the bulkrect_1000_random_sharedimage_batch benchmark did not
change on my workstation. My conjecture is that it is bottlenecked by
overdraw of the many overlapping rectangles.

Change-Id: Icc4195de0bcb2219f424fdaa79728281c0418558
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258418
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-12-06 18:49:35 +00:00
Brian Salomon
fc118442f6 Reland "Revert "Revert "Make FP optimizations helpers use SkAlphaType not GrColorType"""
This is a reland of 997b37fdb9

Layout tests have been suppressed.

Original change's description:
> Revert "Revert "Make FP optimizations helpers use SkAlphaType not GrColorType""
>
> This reverts commit 078e8faa26.
>
> Change-Id: I67b2970584db5a1afbf9928b77c5444947ef71a3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255897
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Change-Id: I6db4cff8b71ef1f29ac47f7729b9514d009f730a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256225
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-11-25 15:46:35 +00:00
Robert Phillips
50299de399 Reland "Revert "Make FP optimizations helpers use SkAlphaType not GrColorType""
This reverts commit 997b37fdb9.

Reason for revert: May be blocking Chrome roll

Original change's description:
> Revert "Revert "Make FP optimizations helpers use SkAlphaType not GrColorType""
> 
> This reverts commit 078e8faa26.
> 
> Change-Id: I67b2970584db5a1afbf9928b77c5444947ef71a3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255897
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I0d2754ac7f4672f0758e4d00cd9e06998637846a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256196
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-23 15:21:08 +00:00
Brian Salomon
997b37fdb9 Revert "Revert "Make FP optimizations helpers use SkAlphaType not GrColorType""
This reverts commit 078e8faa26.

Change-Id: I67b2970584db5a1afbf9928b77c5444947ef71a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255897
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-11-23 00:51:03 +00:00
Michael Ludwig
fe13ca3e67 Move textureop fallback code out of GrRTC and into AddTextureSetOps
(also renames CreateTextureSetOps to AddTextureSetOps, to match naming of
GrFillRectOp::AddFillRectOps).

Now that GrTextureOp can add more than one op to the GrRTC, it can take
over ownership of its fallback code for the texture set. It already had
taken over the code for non src-over blends when drawing a single texture.

Besides consolidating where the logic of converting TextureSetEntries into
op data lives, this makes the fallback case more consistent in terms of
performance. Previously, it would go through GrRTC::drawTexturedQuad,
which attempts to merge the clip with the draw for correctness reasons.
A batch never attempted these optimizations, so now even when one op per
quad is required, there won't be the overhead of comparing clips.

Change-Id: I30883e3bd45ed4386f81584e3d68229c46b17e47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255781
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-11-22 16:13:03 +00:00
Brian Salomon
078e8faa26 Revert "Make FP optimizations helpers use SkAlphaType not GrColorType"
This reverts commit 7a538b1eec.

Reason for revert: ios failures

Original change's description:
> Make FP optimizations helpers use SkAlphaType not GrColorType
> 
> Change-Id: I3b7cde6e7f68192af5419fb09c7d59e7a803a4d5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255818
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: Id41daa47fb3ccac434bb9d71a697f32e36c87367
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255835
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-11-22 04:10:34 +00:00
Brian Salomon
7a538b1eec Make FP optimizations helpers use SkAlphaType not GrColorType
Change-Id: I3b7cde6e7f68192af5419fb09c7d59e7a803a4d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255818
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-11-22 03:30:32 +00:00
Robert Phillips
8bc157e216 Reduce max # of AA Quads that can be merged or chained into a single GrTextureOp (take 2)
It is, arguably, not a good metric but the max number of AA Quads that are merged or chained together across all Skia's GMs and SKPs is 276.

This should also reduce the memory consumed from 245,760 bytes to 30,720 bytes.

Bug: b/143572065 skia:9601
Change-Id: I86f3ae2830d8a64ebcc6f5b7da8c0a4dac8761d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254916
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-15 18:51:16 +00:00
Robert Phillips
e837e61b5a Respect the max indexBuffer limits in the bulk texture draw API (take 2)
This is required before we can lower the max AA quad count (again).

Bug: b/143572065 skia:9601
Change-Id: Ibd029a59f6589e1ae6c66d072e5039f0e9de06dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254581
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-11-15 16:57:33 +00:00
Robert Phillips
ae01f62009 Revert "Respect the max indexBuffer limits in the bulk texture draw API"
This reverts commit dd947ceb55.

Reason for revert: CL isn't getting any respect from Android

Original change's description:
> Respect the max indexBuffer limits in the bulk texture draw API
> 
> This is required before we can lower the max AA quad count (again).
> 
> Bug: b/143572065 skia:9601
> Change-Id: Id34123476ad49a57dc9ce7fe13f941c06f721b74
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252603
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: Ibe396fe5a0351190c214ed54611ce72b7928cadd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/143572065 skia:9601
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254437
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-13 15:56:43 +00:00
Robert Phillips
dd947ceb55 Respect the max indexBuffer limits in the bulk texture draw API
This is required before we can lower the max AA quad count (again).

Bug: b/143572065 skia:9601
Change-Id: Id34123476ad49a57dc9ce7fe13f941c06f721b74
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252603
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-11-13 15:32:02 +00:00