Commit Graph

2856 Commits

Author SHA1 Message Date
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
Herb Derby
3005c4815f Make explicit SDF default values.
Change-Id: I08023209a263cc50be9a9cac70e7184fd2fb2379
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296037
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-06-12 15:46:59 +00:00
Greg Daniel
e8d3ccadfe Remove GrPrepareForExternalIORequests from flush.
Now that we have the GrContext setBackendTextureState calls we no longer
need these to be on flush.

Bug: skia:10254
Change-Id: I7c44667a327de11dd853e3e71b114959a7bcee86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295447
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-10 20:00:20 +00:00
Greg Daniel
1db8e7990a Add GrContext API to allow updating GrBackendSurfaceMutableState.
This is currently only supported for the Vulkan backend

Bug: skia:10254
Change-Id: I9274799098dc00dec5abcbcec95ce7cc23fec537
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293844
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-06-10 13:15:55 +00:00
Greg Daniel
288ecf60bd Use main command buffer for updateBackendTexture in vulkan.
Deletes support for the "side" temp command buffer

Bug: chromium:1087124
Change-Id: I97cda4e98faddd2d65f257613e19a825f52402c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294518
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-05 15:42:49 +00:00
Chris Dalton
b96995d05f Handle tessellated paths that require more segments than are supported
Adds a method to determine the worst-case number of tessellated line
segments that a path might require, and disables hardware tessellation
if it is more segments than are supported (falling back on indirect
draw shaders).

If the path requires even more segments than are supported by the
indirect draw shaders (1024), we crop the path to the viewport. The
required number of segments is proportional to the square root of the
bounding box's diagonal, so we won't start cropping paths until their
device-space bounding box diagonal is nearly 175,000 pixels long.

Change-Id: I8a9435e70bb93dda3464cc11a3e44fbe511744ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293691
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-06-05 15:33:19 +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
Adlai Holler
e219d1c94c Make GrContextThreadSafeProxy not a GrContext_Base
Once this API is retracted, we can rename it to something more sane.
The code base has some `fContextInfo` ivars of this type, suggesting it
was previously named ContextInfo. It could be a ContextGroup or something else.

Bug: skia:10318
Change-Id: I3471e2172f46163f98a94780f0d7eb3431894cda
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293556
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-06-02 16:14:48 +00:00
Greg Daniel
aa9d99ff6b Add support for vk image sharing mode and handle queues xfers correctly.
Change-Id: I9dbe6020d67cc452c9cbbdeace68f1d01275b419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293559
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-06-02 15:58:28 +00:00
Mike Klein
89c909efee Wsign-conversion for public headers
This is an Android request for our public headers,
much like warning about unused parameters.  See bug.

In general I've made two kinds of source changes:

   1) more commonly, explicitly cast to the type which
      is being implicitly cast to at head;

   2) less commonly, flip signedness of a value we're
      storing to match how it's used more smoothly.

Much of this is self inflicted inconsistent use of size_t, unsigned,
int, int32_t, uint32_t, etc.  SkTArray is particularly tricky because
of its std::vector half-compatibility.  E.g. resize() takes size_t,
but operator[] takes int.    ¯\_(ツ)_/¯

Bug: skia:9847
Change-Id: I64626a529e1662b3d3020bc03d477fc641eda544
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293436
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-06-02 12:34:54 +00:00
Adlai Holler
43b1579dac Make abandonment state of context thread-safe
The plan going forward is to centralize all thread-safe data in GrContextThreadSafeProxy, make it not derive from GrContext_Base, and have all the GrContext-derived classes share a pointer to a context group's shared GrContextThreadSafeProxy. And probably rename the proxy class after retracting it from public API (GrContextFamily?)

Bug: skia:10295
Change-Id: I9807ad0926f9b2d69a8694db974a3bcac9fd66b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292853
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-06-01 14:47:07 +00:00
Greg Daniel
cc7ec24ca8 Move backend surface vk getters and setters back out from behind compile flag.
Chrome uses these and they don't guard their code so we have to leave them
available.

Change-Id: I3bb1d0830a42e18adcf682062ec9fdf5594e7098
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292961
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-05-29 19:18:46 +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
Greg Daniel
895a2ad46c Fix up some comments in regards to gpu flush and submitting.
Change-Id: I54273609e17a0151c2c91d2775ccae3c5aadbc5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292568
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-28 19:02:03 +00:00
Greg Daniel
55822f17bd Add submittedProc to GrFlushInfo.
Bug: skia:10118
Change-Id: Iad848310d0f2fb22f19e9890209548fda103bd27
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291078
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-27 12:48:43 +00:00
Greg Daniel
04283f3f6f Reland "Implement submit API to GrContext."
This reverts commit 9ee15d7b57.

Reason for revert: relanding with fixes

Original change's description:
> Revert "Implement submit API to GrContext."
> 
> This reverts commit 40f288c72e.
> 
> Reason for revert: canvaskit breaking for some reason???
> 
> Original change's description:
> > Implement submit API to GrContext.
> > 
> > Change-Id: Ib813d42abb5f63e2ecdbf245d416658143853288
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289033
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,penghuang@chromium.org,vasilyt@chromium.org
> 
> Change-Id: Iee6c8342cccc601edf64ea011f1303e5d72559a9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290917
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,penghuang@chromium.org,vasilyt@chromium.org

# Not skipping CQ checks because this is a reland.

Change-Id: I5203676f88893cbbaba685301b8a713b40396b48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290960
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-20 19:00:25 +00:00
Greg Daniel
49de1031d4 Reland "Remove deprecated flush calls."
This reverts commit 5e6d789ce4.

Reason for revert: Relanding with fix landed in chrome

Original change's description:
> Revert "Remove deprecated flush calls."
> 
> This reverts commit d8fd0bf574.
> 
> Reason for revert: chrome roll
> 
> Original change's description:
> > Remove deprecated flush calls.
> > 
> > Bug: skia:10118
> > Change-Id: I13758b5416784c296b8b5be9f3228230ac1be05f
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290540
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: I49d35cdb258e632f645974c5ec62075d3392efe0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10118
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290834
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

# Not skipping CQ checks because this is a reland.

Bug: skia:10118
Change-Id: Ie24d7845a4ad75f95afe59037ea80a9f38082f13
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290918
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-20 15:48:46 +00:00
Greg Daniel
5e6d789ce4 Revert "Remove deprecated flush calls."
This reverts commit d8fd0bf574.

Reason for revert: chrome roll

Original change's description:
> Remove deprecated flush calls.
> 
> Bug: skia:10118
> Change-Id: I13758b5416784c296b8b5be9f3228230ac1be05f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290540
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I49d35cdb258e632f645974c5ec62075d3392efe0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10118
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290834
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-19 20:58:40 +00:00
Greg Daniel
9ee15d7b57 Revert "Implement submit API to GrContext."
This reverts commit 40f288c72e.

Reason for revert: canvaskit breaking for some reason???

Original change's description:
> Implement submit API to GrContext.
> 
> Change-Id: Ib813d42abb5f63e2ecdbf245d416658143853288
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289033
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,penghuang@chromium.org,vasilyt@chromium.org

Change-Id: Iee6c8342cccc601edf64ea011f1303e5d72559a9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290917
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-19 20:55:27 +00:00
Greg Daniel
40f288c72e Implement submit API to GrContext.
Change-Id: Ib813d42abb5f63e2ecdbf245d416658143853288
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289033
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-19 20:08:38 +00:00
Greg Daniel
d8fd0bf574 Remove deprecated flush calls.
Bug: skia:10118
Change-Id: I13758b5416784c296b8b5be9f3228230ac1be05f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290540
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-19 18:01:24 +00:00
Greg Daniel
b2365d81d0 Reland "Reland "Add api on GrContext to update the data of GrBackendTextures.""
This reverts commit ed219fe171.

Reason for revert: relanding with fix

Original change's description:
> Revert "Reland "Add api on GrContext to update the data of GrBackendTextures.""
> 
> This reverts commit 83c6626946.
> 
> Reason for revert: technospark is failing to upload pixmaps to non base mip levels
> 
> Original change's description:
> > Reland "Add api on GrContext to update the data of GrBackendTextures."
> > 
> > This reverts commit 93ca54e0ac.
> > 
> > Reason for revert: relanding with fix
> > 
> > Original change's description:
> > > Revert "Add api on GrContext to update the data of GrBackendTextures."
> > > 
> > > This reverts commit ac09f7cd7a.
> > > 
> > > Reason for revert: breaking bots, may need to use swizzled color for
> > > correctness test
> > > 
> > > Original change's description:
> > > > Add api on GrContext to update the data of GrBackendTextures.
> > > > 
> > > > Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > 
> > > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> > > 
> > > Change-Id: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
> > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > 
> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> > 
> > # Not skipping CQ checks because this is a reland.
> > 
> > Change-Id: I82283b2437e523b80acead71c5f7c651180620db
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288631
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: I5d6614db8db59a69ded511726507a186596cfbd4
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288907
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

# Not skipping CQ checks because this is a reland.

Change-Id: I35fa1ae7dc47a697bbc358655f5c821942033234
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288909
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-13 21:49:25 +00:00
Greg Daniel
da50cb84a4 A flush and submit apis to public headers.
We add a new flushAndSubmit() to replace the current flush() call. In
the future all other flush(GrFlushInfo) type calls will not do a
submission of work to the GPU. Instead an explicit submit call will have
to be made. flushAndSubmit will do a flush and submit.

Also adds a no-op submit call. This allows us to stage the flush submit
changes by updating all clients that use non simple flushes to add
a submit call immediately after each flush. Then we can change the logic
of where the submission happens from flush to submit without breaking
folks.

Bug: skia:10118
Change-Id: I4f02189a21912d52b888597c7734b4ca0baee792
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289478
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-13 18:43:54 +00:00
Greg Daniel
ed219fe171 Revert "Reland "Add api on GrContext to update the data of GrBackendTextures.""
This reverts commit 83c6626946.

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

Original change's description:
> Reland "Add api on GrContext to update the data of GrBackendTextures."
> 
> This reverts commit 93ca54e0ac.
> 
> Reason for revert: relanding with fix
> 
> Original change's description:
> > Revert "Add api on GrContext to update the data of GrBackendTextures."
> > 
> > This reverts commit ac09f7cd7a.
> > 
> > Reason for revert: breaking bots, may need to use swizzled color for
> > correctness test
> > 
> > Original change's description:
> > > Add api on GrContext to update the data of GrBackendTextures.
> > > 
> > > Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > 
> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> > 
> > Change-Id: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> 
> # Not skipping CQ checks because this is a reland.
> 
> Change-Id: I82283b2437e523b80acead71c5f7c651180620db
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288631
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I5d6614db8db59a69ded511726507a186596cfbd4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288907
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-11 15:48:40 +00:00
Greg Daniel
83c6626946 Reland "Add api on GrContext to update the data of GrBackendTextures."
This reverts commit 93ca54e0ac.

Reason for revert: relanding with fix

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

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

# Not skipping CQ checks because this is a reland.

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

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

Original change's description:
> Add api on GrContext to update the data of GrBackendTextures.
> 
> Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-08 15:38:21 +00:00
Greg Daniel
ac09f7cd7a Add api on GrContext to update the data of GrBackendTextures.
Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-08 15:15:00 +00:00
Greg Daniel
dddf709101 When creating with data, always set vk GrBackendTexture layout to sampled.
We won't lose much by not going to color attachment layout since when the
renderable GrBackendTexture gets wrapped in an SkSurface we still will put
in a barrier to protect from write after write. The barrier will now just
also include a layout change.

Change-Id: I91cddd0a4de415760c3e7e4382c243946f788301
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288136
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-06 17:56:14 +00:00
Greg Daniel
c1ad77cf48 Add finisehd proc to backend texture creation.
The callback lets the caller know when the data uploads to the texture
from the create call are finished. This is important since the caller
cannot delete the backend texture till the gpu is finished on vulkan
and d3d.

This change also removes the hard sync in vulkan during creation.

Change-Id: I660d142219474e22b1337d2b0c81cda66fe18a4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286517
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-05-06 16:50:33 +00:00
Chris Dalton
7f0b8973e9 Add CPU benchmarks for individual methods on GrTessellatePathOp
Change-Id: Ica5d3229fc602d17cf568a25742612c94b87ae9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285215
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-24 15:23:41 +00:00
Chinmay Garde
13b6cf697f Ensure correct SkSurfce::MakeFromCAMetalLayer availability.
CAMetalLayer is available on iOS versions above 8.0. However, when using the
simulator, this version is bumped up to 13.0. This is done via a separate header
altogether and there is no provision to specify simulator versions in
API_AVAILABLE. SK_API_AVAILABLE_CA_METAL_LAYER must be used to signal correct
API availability in all versions of iOS including simulators.

Change-Id: I628e3062fd9531869400dc8a29d42f96afb11d82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284988
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Chinmay Garde <chinmaygarde@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-04-24 14:15:54 +00:00
Chris Dalton
ed6e82796b Add a flag for suppressing tessellation shaders
Change-Id: Ic29618c5eac9b3eed92ce0321162745645240d6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285142
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-23 18:35:48 +00:00
Greg Daniel
c9624d5c73 Add sample quality to GrD3DTextureResourceInfo.
Change-Id: I3a33d2f80fcb243faec40b13960ea0310723e53e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283356
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-13 21:10:31 +00:00
Robert Phillips
4d932d170f Move the GrStrikeCache from the recording context to the direct context
This solidifies that the strike cache and, thus, GrStrikes can't be used when recording DDLs.

TBR=bsalomon@google.com
Bug: 1056730
Change-Id: I15ce3ac2c0a9db0f476c03ef855bd14d22551043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282536
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-09 18:47:27 +00:00
Brian Salomon
dc8fcdb735 Add getter for channels to GrBackendFormat
Bug: skia:10078

Change-Id: I0172a87d836a606a55e60b73ba255a41313e9c12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282266
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-04-08 19:54:27 +00:00
Greg Daniel
8561fc23c9 Update gpu flush semaphore contract.
From my scanning of clients this should not change how any of our main
users interact with semaphores. The biggest change here is that we don't
give up on submitted all the semaphores if a creation fails. We just
submit the semaphores we do have. It also makes it explicit that the
client is responsible for deleting any initialized semaphore regardless
if we were able to submit the semaphores or not or if the semaphore was
wrapped or created by Skia.

The motivation for this change is to more align the current API with
how things will work when we separate flushing and submit into different
calls.

Bug: skia:10118
Change-Id: I3e8b5d3a9852ddb2b5dc972fee21bf46ded7a36f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282265
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-08 17:30:16 +00:00
Chris Dalton
a77cdee048 Reland "Rename instanceAttribSupport -> drawInstancedSupport"
This is a reland of 17f05c737e

Original change's description:
> Rename instanceAttribSupport -> drawInstancedSupport
>
> Change-Id: I7d8ff8597849f2b910928867842857e25a12b4b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281582
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Change-Id: I2e15ac72d86747c30e71bb50d30da48a5a342772
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282118
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-07 16:54:37 +00:00
Chris Dalton
31c028c54b Revert "Rename instanceAttribSupport -> drawInstancedSupport"
This reverts commit 17f05c737e.

Reason for revert: chrome

Original change's description:
> Rename instanceAttribSupport -> drawInstancedSupport
> 
> Change-Id: I7d8ff8597849f2b910928867842857e25a12b4b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281582
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I2b28e3066f27b9d63713f93c0b44d7ba92fcdba9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281868
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-04-06 22:22:37 +00:00
Chris Dalton
17f05c737e Rename instanceAttribSupport -> drawInstancedSupport
Change-Id: I7d8ff8597849f2b910928867842857e25a12b4b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281582
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-06 18:53:57 +00:00
Greg Daniel
6e35a00916 Have GrContext abandoned call also check if the underlying device is lost.
Change-Id: Iba09b8f39138e99cbd987880b2da07fdec799248
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280638
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-04-01 18:33:23 +00:00
Jim Van Verth
9aa9a683d3 Implement local version of gr_cp and use for GrD3DTextureResourceInfo.
Bug: skia:9935
Change-Id: I4c2d70f69e30f78caca0f49629880565f178f495
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280609
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-01 16:06:17 +00:00
Ben Wagner
507e486219 Revert "Enable deprecated-copy-dtor warning."
This reverts commit e990fcc4b0.

Reason for revert: Build-Win-Clang-x86_64-Release-Shared

Original change's description:
> Enable deprecated-copy-dtor warning.
> 
> In C++11 a user declared destructor still requires the compiler to
> implicitly default the copy constructor and copy assignment operator,
> but this is deprecated. Note that a user declared destructor suppresses
> the move constructor and move assignment operator; a user declared
> destructor exists if any '~Foo' method declaration appears inside
> 'class Foo' (even if defaulted); if the copy and move operations are the
> same then copy operations that take 'const Foo&' will do fine double
> duty as move operations.
> 
> Clang seems to have an issue with this warning, in that it does not
> appear to distinguish between compiler defaulted and user defaulted
> destructors. As a result, it does not always warn when it should.
> There may yet be places in the code where a move operation is desired
> but may be suppressed because the implicitly defaulted  moves are not
> declared because a destructor has been declared.
> 
> This wraps dawn and shaderc configs in 'third_party' so that their
> headers will be included through '-isystem' in order to avoid the
> warnings generated by including their headers.
> 
> Change-Id: I681524cd890d86305aa99b6b765a52113b4dfa4b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280406
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

TBR=mtklein@google.com,bsalomon@google.com,bungeman@google.com

Change-Id: Icd6a2487637d21fcf7c4c7ab7cba7a8adfda5afd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280836
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-03-31 22:32:07 +00:00
Ben Wagner
e990fcc4b0 Enable deprecated-copy-dtor warning.
In C++11 a user declared destructor still requires the compiler to
implicitly default the copy constructor and copy assignment operator,
but this is deprecated. Note that a user declared destructor suppresses
the move constructor and move assignment operator; a user declared
destructor exists if any '~Foo' method declaration appears inside
'class Foo' (even if defaulted); if the copy and move operations are the
same then copy operations that take 'const Foo&' will do fine double
duty as move operations.

Clang seems to have an issue with this warning, in that it does not
appear to distinguish between compiler defaulted and user defaulted
destructors. As a result, it does not always warn when it should.
There may yet be places in the code where a move operation is desired
but may be suppressed because the implicitly defaulted  moves are not
declared because a destructor has been declared.

This wraps dawn and shaderc configs in 'third_party' so that their
headers will be included through '-isystem' in order to avoid the
warnings generated by including their headers.

Change-Id: I681524cd890d86305aa99b6b765a52113b4dfa4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280406
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-03-31 22:15:07 +00:00
Jim Van Verth
8e75147214 Allow GrD3DTextureResourceInfo to include declared D3D12 types.
Changes the GrD3DTextureResourceInfo member in GrD3DBackendSurfaceInfo
to be a unique_ptr<> so we can use forward refs.

This will allow us to use a shared_ptr variant to manage the
ID3D12Resource on GrD3DResourceResourceInfo, without polluting
client files with Windows definitions. Clients can use GrD3DTypes.h
to get the full declarations, GrD3DTypesMinimal.h for only the forward
references.

Bug: skia:9935
Change-Id: I075a3fc608bf6767dae202efd8cbf06cdd4a9457
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280602
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-03-31 19:06:09 +00:00
Michael Ludwig
dd205451a1 Declare SkString in GrContext
Fix flutter/mac bot builds.

Change-Id: I522f3ce52c01900b3f4e0007ace84975796c0dd3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280411
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-03-30 21:49:34 +00:00
Brian Osman
01e6d17fe8 Stop including SkCanvas.h from GrTypesPriv.h
It was too easy to get into circular include chains. Added static
asserts to ensure we keep our quad AA flags in sync. Also, IWYU.

Change-Id: I01aefa264aa56420ab5a46a8ecd9e63c021c79ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280405
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-03-30 20:43:34 +00:00
Jim Van Verth
aa90dada80 Fill in some D3D texture creation routines.
Adds some writepixels caps methods even though it's not implemented,
just to keep dm from crashing in unexpected places.

Bug: skia:9935
Change-Id: Ia76e5abd8a6c72987658af4f8369efe69f6b685c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279576
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-30 19:32:34 +00:00
Chris Dalton
80f865fa6d Use GL_ANGLE_base_vertex_base_instance
Adds the ANGLE extension to our list of options for
glDraw*BaseInstance.

Removes glDrawElementsInstancedBaseInstance since this method is not
supported by the ANGLE extension.

Change-Id: Ifd25324feeaad55a4d141b5064bcd8e059948ef7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280388
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-03-30 17:59:05 +00:00
Ben Wagner
833313b21a Add back deprecated warnings.
Unfortunately in clang 'deprecated' is both a set of warnings (at least
one of which we don't want) and a group of warnings (most of which we do
want). Leave the top level disabled, but re-enable all the warnings in
the group.

Most of the code changes are for the deprecated-copy diagnostic. In
C++11 implementing a copy constructor xor copy assignment operator
the default implementation of the other is still required to be the
default but is deprecated (the compiler can warn against doing this).
The idea is that if there was a need for a non-default copy constructor
or copy assignment operator then both should be implemented explicitly,
since it is unlikely that the default will do what is expected.

Note that the deprecated-copy-dtor has not yet been enabled as there
will need to be a lot more work to enable this diagnostic. Similar to
deprecated-copy, in C++11 when implementing a destructor the copy
constructor and copy assignment operator are still defaulted if not
declared, but this is also deprecated. The idea here is that if some
special handling is needed to destroy the object there is probably some
need to do something non-trivial when copying the object (or copying
should be disallowed).

Also, there are still some deprecated-declarations to clean up on
Android and Mac.

Change-Id: I5fc4b62713220e6f7d3724fd7342b4c8c74a3c67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278916
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-03-27 14:18:49 +00:00
Jim Van Verth
fd89e0bdd0 Add GrD3DRenderTarget and GrD3DTextureRenderTarget.
Bug: skia:9935
Change-Id: I91b6218946ba04e893adaec3c0077653a62efe2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279136
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-03-26 20:15:30 +00:00