Commit Graph

605 Commits

Author SHA1 Message Date
Robert Phillips
26f3aebf01 Add initial GrThreadSafeUniquelyKeyedProxyViewCache implementation
This is by no means perfect or complete but does break up the review.

Bug: 1108408
Change-Id: Ib1826cd40975c7e84b5fdfc16d1ecbec97dab237
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317201
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-16 16:07:27 +00:00
Michael Ludwig
a195d101f9 New GrClipStack supporting only intersect/difference
Overview doc: https://docs.google.com/document/d/1ddIk74A1rL5Kj5kGcnInOYKVAXs3J2IsSgU5BLit0Ng/edit?usp=sharing

This is the new clip stack that will replace GrClipStackClip. The doc
link in the CL description has a much more detailed overview of what the
strategy of the new clip stack is, but at a very high level:

1. Add a temporary #define that lets SkGpuDevice switch between the old
stack and the new stack. For the new GrClipStack, it extends SkBaseDevice
directly and has to implement all of the device clipping virtuals.
   - If you look from patchset 5 and earlier, the define defaults to on
     so I can test it on the bots, etc. but the plan will be for it to
     default to off when this lands so it's only running on unit tests.
     Then in a follow up, I'll turn it on for our bots but keep it off in
     chrome and android. If everything looks good, chrome can then be
     turned on. There is a more extensive migration plan for android
     because of the expanding clip ops, but that is covered at the end of
     the overview doc.

2. GrClipStack manages save/restore logic of the stack and extends GrClip,
so the cpp file also includes code to apply a GrAppliedClip. At the moment
the apply strategy is as close to that in GrReducedClip and
GrClipStackClip as I could make it. Down the road, I think we can explore
other analytic coverage options and a clip atlas that replaces the unified
SW mask.
   - Once GrClipStack is enabled everywhere, it means GrReducedClip and
     GrClipStackClip can be deleted, so I'm not too worried about sharing
     code between the two. A lot is already shared through the use of
     GrSWMaskHelper and GrStencilMaskHelper.
   - SkClipStack and SkClipStackDevice are still used by the PDF and SVG
     backends, so they aren't necessarily deletable.

3. The GrClipStack only handles intersect and difference ops. It
represents all geometric clip operations as an element. The stack itself
is controlled by the "save record", which tracks aggregate bounds, valid
elements, and the non-geometric clip shader.
   - When a new save record is pushed on the stack, older elements are
     inactive. This means they cannot be modified, since they may need to
     be activated again when the current save is popped off the stack.
     However, they can still affect the clip during application.
   - When a new element is pushed on the stack, older elements may be
     invalidated. This means they don't need to be considered any more
     because they are redundant with the new clip shape (e.g. nested round
     rect clips only have to keep the innermost valid).


Bug: skia:10205
Change-Id: I68ccfd414033aa9014b102efaee3ad50a806f793
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308283
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-09-15 19:27:11 +00:00
Greg Daniel
10c4213c22 Remove GrRenderTargetProxyPriv class and setGLRTFBOIDIs0 call.
With the removal of the unused set call, I really don't see a reason to
have the Priv class just for glRTFBOIDIs0 getter. Especially since all
other similar getters related to surface flags are exposed on the main
class. So I've removed the priv class since I don't think it really
adds much to hide such a function from ourselves.

Change-Id: I834fae036b63cc66732d32d7c74b0ed08438f870
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313419
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-08-26 16:34:33 +00:00
Robert Phillips
5b68ed4c51 Remove GrStyledShape.h from GrSmallPathShapeData.h
This refactoring was requested during an earlier code review.

Change-Id: I93184e2bc936b3c8c69f84e475be2c234845ee81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309120
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-08-10 19:48:14 +00:00
Robert Phillips
46a324a16c Move GrSmallPathAtlasMgr to its own file and out-line
There are no intentional behavioral changes in this CL. It should
purely be cut, paste, re-shuffle & get re-compiling.

Bug: 1108408
Change-Id: Ic8457d0af76861f2ea881177f2b2c0fe0bf85146
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309040
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-08-10 18:05:54 +00:00
Robert Phillips
34949e35f0 Pull ShapeData into its own header file and rename to GrSmallPathShapeData
This is just a mechanical cut & paste.

When the atlasing is separate from the small path renderer both the
atlas manager and the path renderer need to share these objects.

This is pulled out of the omnibus CL:

https://skia-review.googlesource.com/c/skia/+/307776 (Split the small path renderer into record-time and flush-time pieces)

Change-Id: Ibae9d785fa8a3934fa81f9e98d7e1027d48dc5a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308276
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-08-06 12:12:16 +00:00
John Stiles
4b9b34558f Migrate GrGetIntelGpuFamily into a cpp file.
Putting the entire body of the function into a header risks an ODR
violation.

Change-Id: I6d32df195049058f781defc2aace23a2bbd66150
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307559
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-08-03 15:36:30 +00:00
John Stiles
1cf1593781 Remove GrTextureGradientColorizer and use GrTextureEffect instead.
Gradient colorizers are now sampled via explicit coordinates instead of
by passing coordinate data in a color channel. This change caused the
GrTextureGradientColorizer to become a no-op/passthrough effect.

Change-Id: I5233c93914716cac186b0ea8f5a3698746a89742
Bug: skia:10548
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307298
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-07-31 21:29:03 +00:00
Chris Dalton
078f875477 Rename GrTessellateStroke* -> GrStrokeTessellate* and friends
Almost half the files in src/gpu/tessellate were beginning with
"GrTessellat*". This CL reorders the camel case words for more
efficient tab completion and better grouping of related files.

Bug: skia:10419
Change-Id: I3df0ddbb2367cdbd880807a8aef2dd88ec12f830
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306659
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-07-31 02:24:05 +00:00
Brian Salomon
f7f5433a45 Remove GrSurfacePriv and GrRenderTargetPriv
No longer needed as GrSurface and GrRenderTarget are private.

Change-Id: I2ec653b2d9daa115233bb7eaa1f2b7f880772c0a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305730
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-28 13:52:07 +00:00
Jim Van Verth
711b0397d7 Reland "Make GrRingBuffer more generic so it can be used over all backends"
This is a reland of b6d4ad92ad

Original change's description:
> Make GrRingBuffer more generic so it can be used over all backends
> 
> * Removes the spinlock (should no longer be necessary)
> * Uses GrGpuBuffer and creation through GrResourceProvider
>   instead of internal native creation
> * Changes the SubmitData to pass up all buffers used over a given submit
> so the backend can track that better
> 
> Bug: skia:10530
> Change-Id: I0d3a686b950dd5cb5f720f827b573238386b9524
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305567
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

Bug: skia:10530
Change-Id: If75ef583fbed65617cd5be56ee40c937e7325b21
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305722
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-07-24 20:05:40 +00:00
Brian Salomon
e888fb2bc6 Remove GrYUVProvider.
This abstraction had one subclass. That subclass was used only as
an implementation detail of SkImage_Lazy. Move the functionality
into SkImage_Lazy.

Change-Id: Icd8754114dc33ae957e542b372086e8caa0408a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305724
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-07-24 17:06:29 +00:00
Jim Van Verth
c8bc99ff6a Revert "Make GrRingBuffer more generic so it can be used over all backends"
This reverts commit b6d4ad92ad.

Reason for revert: Breaking the bots

Original change's description:
> Make GrRingBuffer more generic so it can be used over all backends
> 
> * Removes the spinlock (should no longer be necessary)
> * Uses GrGpuBuffer and creation through GrResourceProvider
>   instead of internal native creation
> * Changes the SubmitData to pass up all buffers used over a given submit
> so the backend can track that better
> 
> Bug: skia:10530
> Change-Id: I0d3a686b950dd5cb5f720f827b573238386b9524
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305567
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

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

Change-Id: Ief7df521f66e85d9bfb85508e5a5f8223d7d6725
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10530
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305720
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-07-24 14:49:11 +00:00
John Stiles
f743d4eb53 Rename Xfermode fragment processor to Blend.
Change-Id: Iaa0829d72d0da1469df2da23102ff0e3572b641b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305556
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-07-24 13:34:00 +00:00
Brian Salomon
4cfae3bc24 Remove GrTexturePriv
This existed because GrTexture used to be public.

Change-Id: I5e507084ae12058a20481b517b9130b41c793d29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305521
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-07-24 13:26:07 +00:00
Jim Van Verth
b6d4ad92ad Make GrRingBuffer more generic so it can be used over all backends
* Removes the spinlock (should no longer be necessary)
* Uses GrGpuBuffer and creation through GrResourceProvider
  instead of internal native creation
* Changes the SubmitData to pass up all buffers used over a given submit
so the backend can track that better

Bug: skia:10530
Change-Id: I0d3a686b950dd5cb5f720f827b573238386b9524
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305567
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-07-24 13:21:02 +00:00
Chris Dalton
f617b4d9c2 Rename GrStrokeGeometry -> GrStrokePatchBuilder
Bug: skia:10419
Change-Id: Iffd139c2d489deb9d57fa860c20158ee398b7c11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305561
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-07-24 04:39:57 +00:00
Michael Ludwig
cc848b59f8 Rename GrTAllocator to GrTBlockList
GrTAllocator implies relatively limited use cases, while GrTBlockLinkedList
helps clarify the underlying data structure (and its associated advantages
and disadvantages). I am not beholden to the name, so am happy to have
a discussion on alternatives like GrTLinkedList or GrTBlockList or
GrTBlockArray.

Change-Id: I5b10801d8593991d5e804c4074a81efb1dd110ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304396
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-22 21:58:31 +00:00
Robert Phillips
07531a0f97 Switch the DDLRecorder over to holding a GrRecordingContext ...
and related changes. This is another CL in the series that is replacing
GrContext with the GrDirectContext/GrRecordingContext pair.

Change-Id: Id0a3cfd5a5f92f7680d9c58f3a1753322311221c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302637
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-15 23:17:03 +00:00
Greg Daniel
a58db7f87e Add GrStagingBufferManager and use GrGpuBuffers to manage caching.
With this change if a backend Gr*Gpu wants to using staging buffers
they just add a generic GrStagingBufferManager member object. This
object can be used to get slices of upload buffers. Then they just need
to implement the virtual for taking ownership of buffers during submit.

We rely on our GrResourceCache to handle caching and reuse of these
buffers.

This change allows us to remove all other virtuals on GrGpu around
managing staging buffers.

Change-Id: I5db9a3c52133978ea89d6c0de440f434fbf91a51
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300226
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Stephen White <senorblanco@google.com>
2020-07-15 14:17:50 +00:00
John Stiles
85894305bf Replace ModulateRGBA effect with Xfermode using modulate blend.
This reduces our code size by reusing existing components to perform
the same blend, and generates a shader that should be conceptually
equivalent (although it gives the inliner a bit more work to do).

Change-Id: Ie2203f7613503476fa9d045aba58d9ef39f3ea26
Bug: skia:10457
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302264
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-13 16:16:50 +00:00
John Stiles
7bf2600475 Replace ModulateAlpha effect with Xfermode using src-in blend.
This reduces our code size by reusing existing components to perform
the same blend, and generates a shader that should be conceptually
equivalent (although it gives the inliner a bit more work to do).

Change-Id: Ie81e8b82d9b9c441533760d4e9f7e149bc0d969d
Bug: skia:10457
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302262
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-07-13 16:12:50 +00:00
John Stiles
7c1967700b Split GrConstColorProcessor into three separate .fp effects.
ConstColorProcessor contained three separate InputModes with their own
unique behaviors, but every (non-test) call site simply hardcoded one of
the InputModes.

This change also allows the actual const-color processor to remove the
inputFP entirely; it is never sampled.

The GM slide has been split into three separate slides as well.

Change-Id: I2b77f4eab4d655f06e3704fb6fde8d4f8c70a075
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301987
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-13 15:07:12 +00:00
John Stiles
8c7c709aaa Convert GLHighContrastFilterEffect to an .fp file.
The fuzzer detected a bug in our handling of null child processors.
Rather than attempt to further tweak a hand-rolled effect, it seemed
more productive to convert it into a full-fledged .fp file. This
provides a very high degree of confidence that the basics are done
properly, for a relatively low amount of effort.

Contrast calculation has also been optimized slightly. The original
shader calculated (1+c/1-c) separately for every pixel. This is now done
once, in Make(). Also, if contrast adjustment is set to zero, the
contrast block is fully omitted.

Change-Id: I2af4708536b249e03c3ebede9b10fc1125eadb7b
Bug: oss-fuzz:24039
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301942
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-07-10 20:54:33 +00:00
John Stiles
a9c9b53007 Convert the arithmetic runtime effect to a regular .fp effect.
The .fp effect has support for passing values to a child processor.
Runtime effects do not support passing a color to a processor, which is
needed to properly implement `ArithmeticImageFilterImpl` without relying
on multiple `addColorFragmentProcesor` calls and/or `RunInSeries`.

Change-Id: I47446897f857ce849a8e734ab81ee7aec80734e7
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301657
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-07-10 18:42:39 +00:00
Jim Van Verth
d342cc9df1 Add indirect draws to D3D.
Adds GrD3D12CommandSignature, needed to pass to ExecuteIndirect().

Change-Id: I24aa395d710414eba0464aa4e2cb0a87721bcb12
Bug: skia:10482
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301378
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-07-09 21:21:12 +00:00
John Stiles
53ee0fcac7 Convert the dither runtime effect into a regular .fp effect.
This was previously implemented as a runtime effect in order to dogfood
runtime effects when they were new. However, runtime effects do not
support passing a color to a FP via `sample(fp, inputColor)`, which
is needed to properly implement SkPaintToGrPaint.

Change-Id: Ic826860ab06038f13633be677d79a9138d41db85
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301547
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-07-09 20:05:22 +00:00
Herb Derby
60a4986d4c Remove GrTextTarget and GrRenderTargetContext::TextTarget
Change-Id: I501f2fc365c0d2f2faff6ffaf4ad09635e4c3cdf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301452
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-07-09 19:34:20 +00:00
Michael Ludwig
362245e6ed Remove unused GrTRecorder
Change-Id: I9fa9f8785f48e884cf296a638347003d1687e7c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301536
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-09 16:13:20 +00:00
Brian Osman
9cf98dcb49 Remove GrCoordTransform entirely
Bug: skia:10416
Change-Id: I0ca7535a0e6507e6b2a9f4682788826972c5f3b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300296
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-07-07 20:06:04 +00:00
Chris Dalton
b750806543 Combine GrTessellateStrokeOps when possible
Bug: skia:10419
Change-Id: Ifd93b6cd8acffa78675b3e45134dfa52062b4f7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300102
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-07-06 17:17:02 +00:00
Robert Phillips
b7bfbc299a Move GrRecordingContext.h and GrDirectContext.h into include/gpu
External clients will need access to these classes once GrContext
goes away.

This is a purely mechanical CL.

Bug: skia:10441
Change-Id: I7ffeb29d88bcc0f012412fba911e8362d046e24a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300206
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-01 17:32:14 +00:00
Chris Dalton
1c62a7b034 Implement stroking with GPU tessellation
Bootstraps tessellated stroking using GrStrokeGeometry mostly as
written. Strokes get decomposed into tessellation patches that
represent either a "cubic" (single stroked bezier curve with butt
caps) or a "join". The patches get drawn directly to the canvas
without any intermediate stencil steps. For the first revision, only
opaque, constant-color strokes are supported.

Bug: skia:10419
Change-Id: I601289189b93ebdf2f1efecd08628a6e0d9acb01
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299142
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-06-30 16:19:36 +00:00
Robert Phillips
ad2484520d Make the GrDirectContext a thing and move it to include/private
This is somewhat of a departure from the original context refactoring
plan (i.e., keep GrLegacyDirectContext hidden and switch GrContext over
to be the GrDirectContext at some point). Having a GrDirectContext
earlier will allow us to change some important signatures earlier
(e.g., asDirectContext) and, hopefully, clarify some of the confusion
about the context class hierarchy.

Additionally, this will let us make onGpuSetup take a direct context -
clarifying its purpose vis a vis onDraw (which now takes a recording
context).

Change-Id: I8298a0649bc95843d20bee33ba7fe1d7e73bb839
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299768
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-30 14:57:24 +00:00
Robert Phillips
c7ed7e6fde Revert "Add storage on the surface for its last render task"
This reverts commit ca5b36c474.

Reason for revert: This may be blocking the Chrome roll

Original change's description:
> Add storage on the surface for its last render task
> 
> Let's land this and see if it gets us back to baseline on the
> lastRenderTask regression from the bug. If it doesn't, we'll revert it
> since the extra complexity won't have been worth it.
> 
> Bug: skia:10372
> Change-Id: I9d5ae93435b833d575afdc7f219dc8e7c453c92b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297836
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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

Change-Id: Id418d042d1123d946cd99b7b1ba438211cb628ec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10372
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299763
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-29 20:05:06 +00:00
Adlai Holler
ca5b36c474 Add storage on the surface for its last render task
Let's land this and see if it gets us back to baseline on the
lastRenderTask regression from the bug. If it doesn't, we'll revert it
since the extra complexity won't have been worth it.

Bug: skia:10372
Change-Id: I9d5ae93435b833d575afdc7f219dc8e7c453c92b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297836
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-06-29 16:10:46 +00:00
Jim Van Verth
c1a67b5b15 Implement Direct3D semaphores
Change-Id: Iadfa14965bbe11cfea556ade5d46e264f0ace61a
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298752
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-06-25 20:07:21 +00:00
Adlai Holler
6c9bb62a28 Have the drawing manager ref & unref DDLs on playback
Change-Id: I95f6dbfed9bb3ce75ecb260137d11b72e3953d75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298820
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-06-25 17:38:01 +00:00
Herb Derby
a08bde606a GrTextContext::Options -> GrSDFTOptions
Rename GrTextContext::Options to GrSDFTOptions. Remove GrTextContext.

TBR=reed@google.com

Change-Id: Ic89966cfe630cc6ee757977a6d63ae1da9e39ef0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296176
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-15 17:14:04 +00:00
Greg Daniel
01f278c834 Better handle backendFormat to CompressionType.
We also fix getReadSwizzle with this change.

Change-Id: I1989d8347dc97d7a4c75aa9094a0146419c6d8fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295819
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-12 21:47:14 +00:00
Adlai Holler
1bdbe55135 Cache last-accessed entry in lastRenderTask table.
This table is really hot during drawing and we saw a regression when
it was introduced. This change provides wins locally but I don't have
the regressed hardware handy.

Additionally, we change from SkGoodHash to the MixCheap function used by
some other small tables in the library.

Bug: skia:10372
Change-Id: Ic2dfbf41649515245e82cbcc9765cb29270eb5cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295878
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-12 16:11:19 +00:00
Chris Dalton
f26e596822 Duplicate ccpr/GrCCStrokeGeometry to tessellate/GrStrokeGeometry
CCPR stroking is not enabled by default and will eventually be
removed. This CL is a step toward migrating it to an MSAA version.

Change-Id: I565bea1c91c51bcd1ea3766aee6e4702adf3b09e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295608
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-06-11 21:59:23 +00:00
Jim Van Verth
f43da14878 Add D3D descriptor tables and bind to command list.
This CL adds a new descriptor heap manager that handles creation of
descriptor tables, or ranges of shader-visible descriptors. These
are used to set the descriptors that match the setup of the root
signature. Data from non-shader-visible descriptors are copied into
these tables, and then they are bound to the command list.

Change-Id: Ia9fc24cae602244525a196025c044df3c2435d9f
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294300
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-06-10 01:05:03 +00:00
John Stiles
fe64410954 Remove PremulInput and GrPremulInputFragmentProcessor.fp from Skia.
This FP was unused and not referenced anywhere in the codebase.

Change-Id: I27f963d7c26382101b585f356a75d84cef5ab237
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295080
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-08 21:04:46 +00:00
Michael Ludwig
9cced93b7a Handle color and stencil clears in GrClearOp
With prior changes, it became "clear" that GrClearOp and
GrClearStencilClipOp behaved very similarly, except that the stencil
op did not have any onCombine logic.

This just combines them in to a single clear op that will call the
render pass's clear and stencil clear functions as needed. I also
implemented combine logic to apply color and stencil clears in a single
op if the scissor state was compatible (although there's no render pass
API to combine the two clears into a single GPU function).

Change-Id: I8aa749fe64cc487d187854fd0acf6b03b86f1356
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290822
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2020-06-08 14:05:16 +00:00
Herb Derby
64aa5138c7 Remove SkAtlasTextTarget
I can find no references to SkAtlasTextTarget in AOSP or in Chromium.
With google3 CL/314226466 there are no more uses in Google3.

Change-Id: I60b5f06fc17c0e4f8d008886c96645475e3d48e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293839
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-06-04 03:52:35 +00:00
Jim Van Verth
3eadce263c Create ring buffer for managing D3D uniforms.
* Adds a base class for the ring buffer (to be used by Metal as well),
  which tracks the current available space. APIs will need to
  implement creation of the buffer in the subclass.
* The API implementation will need to store SubmitData on command buffer
  submit, and then pass it to finishSubmit when the command buffer
  finishes.

Change-Id: I4cc5e4a72d259ee9d15dac0e964819d4562da3d7
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291936
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-06-01 20:38:40 +00:00
Brian Osman
273944ac7c Convert GrMatrixEffect to pure CPP/H
Prelude to adding situational optimizations

Change-Id: Ie7994a87380ba6135398c9a1d4b26cea6bf32fa8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292972
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-06-01 14:33:57 +00:00
Greg Daniel
6c6caf420a Add GrBackendMutableState object to handle shared texture state.
This is will be the main struct used to synchronize changes of certain
texture/image between clients and Skia. With this change we
implement support for the Vulkan shared state as POC.

Bug: skia:10254
Change-Id: I10543357635c347838b193874e4da4496a0dcf06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292311
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-29 16:53:08 +00:00
Jim Van Verth
afd4113bc3 Change D3DAttachmentViewManager to handle all CPU descriptors
Change-Id: I6af3673a9dedf0a5acfbd588bfbbb447b5c68013
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292576
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-05-28 15:34:59 +00:00