Commit Graph

16 Commits

Author SHA1 Message Date
Adlai Holler
a069304560 Rename GrContextPriv to GrDirectContextPriv
Change-Id: I3fccadd8a2860dbee73f93f995738146373f8a39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326196
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-14 16:46:01 +00:00
Robert Phillips
c8ae494401 Clean up more tests wrt GrContext
Change-Id: I70189e316be19f28d70c2fae832a868101fd3329
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303998
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-20 17:52:33 +00:00
Robert Phillips
6d344c3069 Update unit tests to accept GrDirectContext
This CL makes it explicit that the unit tests always get a direct context.

It is mainly a mechanical CL.

Change-Id: I49e0628851d9c81eb47386ef978edf905c6469d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299866
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-06 15:45:12 +00:00
Greg Daniel
ce9f016ed3 Remove unused GrFlushFlags.
This also adds back default flush() calls which simply do a flush
without any submit.

Change-Id: Ia8c92bbdecd515d871abfa6364592f502e98656b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298818
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-06-30 19:39:31 +00:00
Greg Daniel
d4928d03e2 Implement flush finish proc support for d3d backend.
This also adds a GPUTEST_FOR_D3D_CONTEXT macro to help with debugging
tests.

Change-Id: I72db01d148755c3bbbbb4d948d441a31dcf9482b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297717
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-19 16:28:33 +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
Stephen White
af564a5d0b Dawn: implement fences, callbacks and Finish (syncGpu) semantics.
Change-Id: I04e6c829fb122dc8b2192911bda94e5106927bff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275437
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-04-17 16:05:43 +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
Jim Van Verth
f2f0e1b8cc Add TransferBuffer and AsyncRead support to Metal.
* Implements onTransferPixelsFrom, onTransferPixelsTo, onFinishFlush and
checkFinishProcs.
* Adds a bind() method for allocating dynamic buffer memory that can
be used by the GPU prior to mapping on the CPU

Bug: skia:8243
Change-Id: I366ec47bf1155797d9a9b0c9f33870e50c95e914
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244301
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-10-01 14:37:51 +00:00
Brian Salomon
f9a1fdf01f Reland "Add flush() to SkImage."
This reverts commit 693bc2bae5.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Add flush() to SkImage."
>
> This reverts commit d0503a72ac.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Add flush() to SkImage.
> >
> > This allows a client to ensure all uses of a texture-backed image have
> > been flushed.
> >
> > Does nothing if the image isn't texture-backed.
> >
> > The implementation adds support for triggering a flush if any of a set
> > of proxies are used rather than just a single proxy.
> >
> > Change-Id: I358882d9737e63c6e69b924c0767f49b8f8f36ec
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212405
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: Ie376bf4225307f45b8fb3eb4a63bf84702365797
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212884
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Idcba378ce2e3af0af9d0eef35737670055539ec5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212960
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-05-09 15:07:51 +00:00
Brian Salomon
693bc2bae5 Revert "Add flush() to SkImage."
This reverts commit d0503a72ac.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Add flush() to SkImage.
> 
> This allows a client to ensure all uses of a texture-backed image have
> been flushed.
> 
> Does nothing if the image isn't texture-backed.
> 
> The implementation adds support for triggering a flush if any of a set
> of proxies are used rather than just a single proxy.
> 
> Change-Id: I358882d9737e63c6e69b924c0767f49b8f8f36ec
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212405
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ie376bf4225307f45b8fb3eb4a63bf84702365797
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212884
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-05-09 13:48:08 +00:00
Brian Salomon
d0503a72ac Add flush() to SkImage.
This allows a client to ensure all uses of a texture-backed image have
been flushed.

Does nothing if the image isn't texture-backed.

The implementation adds support for triggering a flush if any of a set
of proxies are used rather than just a single proxy.

Change-Id: I358882d9737e63c6e69b924c0767f49b8f8f36ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212405
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-09 13:36:07 +00:00
Brian Salomon
b0d8b76c4f Make finish flush procs work with GL.
This will be required for async readback support.

This is implemented using sync objects when available and otherwise
calls glFinish.

Relaxes the unit test requirement that providing a callback with no
work to flush always calls the proc immediately.

Bug: skia:8962
Change-Id: Ieefcab6dccc3924e50260343f01904e7303bb12b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212198
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-07 10:35:38 +00:00
Mike Klein
c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00
Greg Daniel
e6bfb7daf0 Add struct to wrap all the gpu flush options.
Bug: skia:8802
Change-Id: Ia92807034a8f54067cead59e29c233f91e11f175
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208674
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-04-17 20:03:29 +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