Commit Graph

384 Commits

Author SHA1 Message Date
Brian Salomon
ab32f65653 Add SkSurface::asyncReadPixels()
Initial version. Current limitations: No Metal support, no color space
conversions, for each src color type only one dst color type is legal (
which may or may not be the src color type), no alpha type conversions.

Bug: skia:8962

Change-Id: I6f046a32342b8f5ffb1799d67d7ba15c250ef9bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212981
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-05-10 19:13:07 +00:00
Chris Dalton
8610e9c9de ccpr: Add a GrOctoBounds class
Encapsulates all the various code dealing with 45-degree bounding
boxes into a central GrOctoBounds class.

Bug: skia:
Change-Id: Ibc8ac4371af8f310e711579c3c77e0b3a53aff0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212563
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-09 18:00:11 +00:00
Brian Osman
ac9be9dbc5 Remove shader text trace events and simplify the SKSL/GLSL printing code
- Moves the pretty-printer and line-by-line printer into a new GrShaderUtils.
- Maintain strings as SkSL::String longer, to avoid possibly re-converting
  from char* when we need to print them.
- GL shader compilation doesn't need the SkSL settings, so stop plumbing that.
- Converting SkSL to GLSL was taking the GL enum to specify the kind of shader,
  but only used it to convert to a SkSL::Program::Kind. Just take that. To make
  this simpler, move the GLSL printing code into that function, clumped with
  the SkSL printing code. Reuse that banner printer in GrGLPrintShader, too.

Change-Id: I4536547604612a6fa1596e5a8e97f6322e12a1fb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211583
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-05-01 15:12:18 +00:00
Jim Van Verth
75c5326bae Cache some more Metal state.
Caches MTLSamplerStates and MTLDepthStencilStates.

Bug: skia:8243
Change-Id: Id362507caedb3453b53d17f77dfbcee42ec52578
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209811
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-04-29 14:17:06 +00:00
Jim Van Verth
75c3ae4c2e Add GrMtlCommandBuffer
Used to encapsulate encoder creation. Bundles blitencoder
commands into a single encoder.

Bug: skia:8243
Change-Id: I53a4303678bb4f4e6667a3655cfe414b2e50615d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209435
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-04-23 16:20:26 +00:00
Brian Salomon
c0d79e525f Avoid multiplication by alpha in fragment shader when known to be 1.
Implemented for image shaders, image draws, and gradient shaders.

Reimplement GrFragmentProcessor::OverrideInput as GrOverrideInputFragmentProcessor.fp.
It allows specification of whether the replacement input color should be
a literal in the shader code or a uniform. For above use case use with literal white.

Make key in variables in fp files work for 4f colors.

Fix issue in CPP code gen from .fp where when + key vars that pushed multiple values
into the shader key only skipped the first key value when the when condition is not
true.

Bug: skia:7722

Change-Id: Id7c865132d620e8cdea8b00f2a627103eef171ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201985
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2019-04-16 14:03:04 +00:00
Ethan Nicholas
21a9b56fc2 moved files generated from .fp files into generated/ directories
Bug: skia:
Change-Id: I8605cdfcc0b1c56c23a6075c7fe188ab7384681c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207221
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-04-10 18:02:02 +00:00
Ethan Nicholas
ff4fb3335b ComposeShader GPU implementations
Bug: skia:
Change-Id: I007b46ead1900a8f5cce82dec33b6d662fc63d8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206918
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-04-09 21:04:15 +00:00
Brian Osman
fbe2406693 Reland "Remove the NullGL interface (and associated test context)"
This reverts commit 215da624d1.

Reason for revert: Blink issues ironed out.

Original change's description:
> Revert "Remove the NullGL interface (and associated test context)"
> 
> This reverts commit de206c75c2.
> 
> Reason for revert: Chrome is having issues with the switch to Mock in blink tests.
> 
> Original change's description:
> > Remove the NullGL interface (and associated test context)
> > 
> > Bug: skia:
> > Change-Id: Ie3c9ee39fc1e0a4406de085c60d8433ffb4419df
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203708
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com
> 
> Change-Id: Iff0cbf29dcea26957efc800a8c33d0ad8285de0a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205343
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:
Change-Id: I1f4fbbcb00f302c5d830cb1392badd6ec7a33c69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205832
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-03 16:38:10 +00:00
Brian Osman
215da624d1 Revert "Remove the NullGL interface (and associated test context)"
This reverts commit de206c75c2.

Reason for revert: Chrome is having issues with the switch to Mock in blink tests.

Original change's description:
> Remove the NullGL interface (and associated test context)
> 
> Bug: skia:
> Change-Id: Ie3c9ee39fc1e0a4406de085c60d8433ffb4419df
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203708
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: Iff0cbf29dcea26957efc800a8c33d0ad8285de0a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205343
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-02 12:48:37 +00:00
Brian Osman
de206c75c2 Remove the NullGL interface (and associated test context)
Bug: skia:
Change-Id: Ie3c9ee39fc1e0a4406de085c60d8433ffb4419df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203708
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-01 14:56:23 +00:00
Chris Dalton
2c5e01104f Split GrCCCoverageProcessor into subclasses
Makes separate subclasses for geometry and vertex shaders.

Bug: skia:
Change-Id: Ifced79af3092090a71d03fe252fb4da76738cf08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204545
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-29 18:59:43 +00:00
Kevin Lubick
3902628e35 Support WebGL 1.0 with caps
There is some logic in here for 2.0 as well, just as a
"as long as I was looking at the specs", but only 1.0
is really supported.

This seems to resolve the bug where some GPUs weren't
advertising correctly that they had vertex array object
support, by checking for both extension names (with and
without "GL_" prefix)

Of note, this saves about 18 Kb (5.5 Kb gzipped) of code size
by compiling out the unneeded GLES checks/functionality.

Bug: skia:8378
Change-Id: I773bf4dbf231b991051d2a9f640b8047a9010e7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203461
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-28 17:21:23 +00:00
Kevin Lubick
5509dac4cc Reland "Generate GrGLInterface and GrGlAssembleInterface* from table"
This reverts commit 573cb87a07.

Reason for revert: Marking failing validation as optional and filing bug for follow up in Chrome.

Original change's description:
> Revert "Generate GrGLInterface and GrGlAssembleInterface* from table"
> 
> This reverts commit 93b3dce89d.
> 
> Revert "Delete old assembleInterface code"
> 
> This reverts commit 7b1cf20d47.
> 
> Revert "Delete in favor of autogenerated file"
> 
> This reverts commit 0223bd01d8.
> 
> Bug: skia:8474
> NOTRY:true
> Change-Id: I23a904347f9d6cefd1710a2de056c39d52f4b178
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203463
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>

TBR=kjlubick@google.com,stani@google.com

Change-Id: I85adb302eb093fe9b7a4ec2c984323c191278a43
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8474
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203177
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-03-26 10:55:00 +00:00
Kevin Lubick
573cb87a07 Revert "Generate GrGLInterface and GrGlAssembleInterface* from table"
This reverts commit 93b3dce89d.

Revert "Delete old assembleInterface code"

This reverts commit 7b1cf20d47.

Revert "Delete in favor of autogenerated file"

This reverts commit 0223bd01d8.

Bug: skia:8474
NOTRY:true
Change-Id: I23a904347f9d6cefd1710a2de056c39d52f4b178
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203463
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
2019-03-25 19:03:29 +00:00
Kevin Lubick
93b3dce89d Generate GrGLInterface and GrGlAssembleInterface* from table
This CL creates a go program that takes a JSON file of
GPU functions and creates the assemble and validate code
based on that.

This approach will hopefully will lessen the need for
"shotgun surgery" anytime a new function/extensions is added.

Additionally, it should be easier to add a new standard
(concretely, WebGL) using this technique.

There are a few potential bugs/mismatches in the current
implementation that this has identified, for example,
Requiring GL 3.x for adding a feature, but only verifying
it is there on GL 4.x - I did not attempt to correct these
bugs in the old version, as we will hopefully be able to delete
that version and use the generated files.

Bug: skia:8474, skia:8378
Change-Id: Ie8144bbab8e03f2c815fd942fa9f7f91dedba101
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202137
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-25 15:03:48 +00:00
Brian Osman
4d92b89454 Revert "Remove GrDrawAtlasOp"
This reverts commit 97d957d1db.

Reason for revert: Looking at perf, desktop GPUs get better, many mobile GPUs get worse.

Original change's description:
> Remove GrDrawAtlasOp
> 
> The base device turns drawAtlas into drawVertices, which ends
> up being *faster* (in my tests) than our specialized code.
> 
> It's certainly possible to write a custom version that's better,
> but for now, it seems better to just do this.
> 
> Bug: skia:
> Change-Id: I247f0c0a24fb21c8206f4e3ea9fecac85679ba73
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203163
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,brianosman@google.com,reed@google.com

Change-Id: Idfb3dd7d33a3905644aafdefc99e7814b08d7c7b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203053
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-24 00:53:33 +00:00
Brian Osman
97d957d1db Remove GrDrawAtlasOp
The base device turns drawAtlas into drawVertices, which ends
up being *faster* (in my tests) than our specialized code.

It's certainly possible to write a custom version that's better,
but for now, it seems better to just do this.

Bug: skia:
Change-Id: I247f0c0a24fb21c8206f4e3ea9fecac85679ba73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203163
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-23 23:11:00 +00:00
Chris Dalton
82eb9e75d1 Rename GrAAFillRRectOp to GrFillRectOp
Next up are changes to support non-aa and MSAA.

Bug: skia:
Change-Id: I944af201d92b1391f7937aabddf774e79fef8dc2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202920
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-21 21:19:29 +00:00
Kevin Lubick
bbb9281ab8 Break out GrGLAssembleInterface into a few files
one for GL, one for GLES, and one (soon) for WebGL

Bug: skia:8378
Change-Id: Ib13699b7432ed56cce99ac568840e5575bb4d2e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201654
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-18 18:57:18 +00:00
Brian Salomon
876a017e53 Reland "Reintroduce deinstantiate lazy proxy types and use for promise images."
This is a reland of 8b40ac35b2

Original change's description:
> Reintroduce deinstantiate lazy proxy types and use for promise images.
> 
> This reverts a fraction of b2c5dae65d to
> restore the deinstantiate lazy proxy type, supporting implementation,
> and tests.
> 
> Use them for promise images to avoid thread safety issues for promise
> image resources. Makes promise image instantiation callbacks do a thread
> safe unref of their fulfilled GrTexture in GrResourceCache. The
> GrResourceCache mechanism for receiving unref messages is extended to
> allow multiple pending unrefs. All this is new.
> 
> 
> Bug: skia:8800
> Change-Id: I7b1d4fea13c053b6fbbd39c0c6eaf567b8bf81f1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199002
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:8800
Change-Id: Ib939fc5c19edf0c6b965c9f6adf0afedd4267703
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201220
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-14 15:07:10 +00:00
Brian Salomon
d0e1ceffcc Revert "Reintroduce deinstantiate lazy proxy types and use for promise images."
This reverts commit 8b40ac35b2.

Reason for revert: breaks viz_unittests

Original change's description:
> Reintroduce deinstantiate lazy proxy types and use for promise images.
> 
> This reverts a fraction of b2c5dae65d to
> restore the deinstantiate lazy proxy type, supporting implementation,
> and tests.
> 
> Use them for promise images to avoid thread safety issues for promise
> image resources. Makes promise image instantiation callbacks do a thread
> safe unref of their fulfilled GrTexture in GrResourceCache. The
> GrResourceCache mechanism for receiving unref messages is extended to
> allow multiple pending unrefs. All this is new.
> 
> 
> Bug: skia:8800
> Change-Id: I7b1d4fea13c053b6fbbd39c0c6eaf567b8bf81f1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199002
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Iba960efba4290a284294c62d0470ad7e932c174a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-12 13:37:21 +00:00
Brian Salomon
8b40ac35b2 Reintroduce deinstantiate lazy proxy types and use for promise images.
This reverts a fraction of b2c5dae65d to
restore the deinstantiate lazy proxy type, supporting implementation,
and tests.

Use them for promise images to avoid thread safety issues for promise
image resources. Makes promise image instantiation callbacks do a thread
safe unref of their fulfilled GrTexture in GrResourceCache. The
GrResourceCache mechanism for receiving unref messages is extended to
allow multiple pending unrefs. All this is new.


Bug: skia:8800
Change-Id: I7b1d4fea13c053b6fbbd39c0c6eaf567b8bf81f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199002
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-11 20:48:22 +00:00
Chris Dalton
d7291ba7a1 Restore support for multisample locations
Bug: skia:
Change-Id: I971455867e54d431cc1094fca041f773f78748ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196218
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-07 22:00:48 +00:00
Florin Malita
6041d315c7 Reland "SkMixerColorFilter GPU impl"
This reverts commit c2949ec67b.

Reason for revert: not related to crossfade

Original change's description:
> Revert "SkMixerColorFilter GPU impl"
> 
> This reverts commit e80f7eb9d6.
> 
> Reason for revert: break crossfade in chrome roll?
> 
> Original change's description:
> > SkMixerColorFilter GPU impl
> > 
> > Bug: skia:
> > Change-Id: Ia1e25e0c99737d9720c17f92f0d76a1cb7897ea8
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/193163
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,ethannicholas@google.com,fmalita@chromium.org,reed@google.com
> 
> Change-Id: Ib9464fcabc649b95ba131146690d6208af728436
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197760
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=bsalomon@google.com,ethannicholas@google.com,fmalita@chromium.org,reed@google.com

Change-Id: Ie96e80e153aeab16c4ea35d5f1350372060228aa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197763
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-05 15:03:34 +00:00
Mike Reed
c2949ec67b Revert "SkMixerColorFilter GPU impl"
This reverts commit e80f7eb9d6.

Reason for revert: break crossfade in chrome roll?

Original change's description:
> SkMixerColorFilter GPU impl
> 
> Bug: skia:
> Change-Id: Ia1e25e0c99737d9720c17f92f0d76a1cb7897ea8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/193163
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,ethannicholas@google.com,fmalita@chromium.org,reed@google.com

Change-Id: Ib9464fcabc649b95ba131146690d6208af728436
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197760
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-05 14:45:08 +00:00
Brian Salomon
b2c5dae65d Simplify promise image lazy instantiation callbacks.
Now that we never re-fulfill a promise image we no longer need to deinstantiate
promise image proxies. They now can use kSingleUse callback semantics.

This was the only usage of the kDeinstantiate lazy callback type so it is
removed. The DeinstantiateProxyTracker is also no longer required and is
removed.

The GrTexture idle callback mechanism now uses GrReleaseProcHelper, which has
been extended to support chaining multiple callbacks together and an abandon()
method that aborts calling the callback in the destructor. It has been renamed
GrRefCntedCallback to reflect its more general usage.

Bug: skia:8800
Change-Id: I857c9eec57fdf706631a266ec8bea682d6657a7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196500
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-05 13:18:22 +00:00
Florin Malita
e80f7eb9d6 SkMixerColorFilter GPU impl
Bug: skia:
Change-Id: Ia1e25e0c99737d9720c17f92f0d76a1cb7897ea8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/193163
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-05 11:35:47 +00:00
Robert Phillips
e8345793c6 Make room for shifting GrContext to GrDirectContext
Change-Id: I6291b0c513c641c3bb49260031b501da42b11ede
Reviewed-on: https://skia-review.googlesource.com/c/190002
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-07 19:24:07 +00:00
Brian Salomon
dbf7072a59 Use different classes for client side arrays and GPU buffer objects.
GrBuffer is a base class for GrGpuBuffer and GrCpuBuffer. GrGpuBuffer is a
GrGpuResource and the others are not. This allows GrCpuBuffers to exist
outside of the GrGpuResourceCache.

Also removes flags from GrResourceProvider buffer factory function. The
only flag still in use was kRequireGpuMemory. Now CPU buffers are made
without using GrResourceProvider.

Change-Id: I82670d1316e28fd6331ca36b26c8c4ead33846f9
Reviewed-on: https://skia-review.googlesource.com/c/188823
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-07 18:04:15 +00:00
Greg Daniel
173464da34 Add support for importing AHardwareBuffers into SkSurfaces.
Bug: skia:
Change-Id: I0a3b3d607e1b74787480b03520a07839c87486dc
Reviewed-on: https://skia-review.googlesource.com/c/189980
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-02-07 15:03:50 +00:00
Robert Phillips
dbaf317cd4 Move GrContextPriv methods to their own .cpp file
Centralize these for my sanity. Most will also be parceled out to other contexts.

Change-Id: If0e7e98bcf66c4d8a3391f9b04e643ccc91af4ad
Reviewed-on: https://skia-review.googlesource.com/c/189488
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-06 21:15:58 +00:00
Robert Phillips
4217ea7ee5 Add outline of new GrContext hierarchy
This begins the process of splitting GrContext into:

GrContext_Base, GrImageContext, GrRecordingContext and GrDirectContext.

Change-Id: I3c43045f2a5549b049e95791d65f74d4e16de36f
Reviewed-on: https://skia-review.googlesource.com/c/186878
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-01-30 18:36:11 +00:00
Robert Phillips
a0bc39dce3 Split GrContextThreadSafeProxy into its own files (take 2)
This just shuffles stuff around.

Change-Id: I90e24a73bf44dd3e88fc121a0528bf94e4fdead4
Reviewed-on: https://skia-review.googlesource.com/c/187786
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-01-29 19:26:47 +00:00
Robert Phillips
ea8b4fc950 Revert "Split GrContextThreadSafeProxy into its own files"
This reverts commit f8397f2b3f.

Reason for revert: Breaking Flutter build!

Original change's description:
> Split GrContextThreadSafeProxy into its own files
> 
> This just shuffles stuff around.
> 
> Change-Id: Ieab35f50945efe87512d7077cb994132f0e0b6ef
> Reviewed-on: https://skia-review.googlesource.com/c/186874
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I236add95d8a0066037854b5532a7db131d93d603
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/187783
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-01-29 14:39:19 +00:00
Robert Phillips
f8397f2b3f Split GrContextThreadSafeProxy into its own files
This just shuffles stuff around.

Change-Id: Ieab35f50945efe87512d7077cb994132f0e0b6ef
Reviewed-on: https://skia-review.googlesource.com/c/186874
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-01-29 14:03:47 +00:00
Herb Derby
081e6f3754 Rename GrGlyphCache -> GrStrikeCache
Change-Id: Ie6fdcc6ce1f2265783ebb4dcd1b1ce087a296ddf
Reviewed-on: https://skia-review.googlesource.com/c/184500
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-01-16 20:15:04 +00:00
Greg Daniel
bc84adceaa Move GrVkSecondaryCBDrawContext header into src to hide it.
We want to hide this API from general public use. Chromium can dig into
skia to include it as it does with other Skia API's that are in src

Bug: skia:
Change-Id: I00dc36d181237ea0785eefb31ad6c2d4e50e3c68
Reviewed-on: https://skia-review.googlesource.com/c/180648
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-01-02 22:58:58 +00:00
Greg Daniel
b46add81de Add initial support for creating a vulkan secondary command buffer drawing context.
This sets up the context and adds support for creating RTContexts, RTProxies, RTs,
and GrVkRenderPass's that wrap the external secondary command buffer.

Bug: skia:
Change-Id: I80ebbb690a5fe464f775c5fcad651dfe2a150418
Reviewed-on: https://skia-review.googlesource.com/c/178926
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-02 20:39:23 +00:00
Greg Daniel
acc763e879 Fix gn file for moved vulkan file.
Bug: skia:
Change-Id: Ie37416dd4b248a6831b1948bb78cc75a5d5aba81
Reviewed-on: https://skia-review.googlesource.com/c/179997
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2018-12-27 21:26:39 +00:00
Brian Salomon
b4ba8269b2 Move GrResourceKey.h to include/private.
Change-Id: I87cebe1ba69afe3ff51e4f7b504e8caa0ade063f
Reviewed-on: https://skia-review.googlesource.com/c/179733
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
2018-12-21 15:26:18 +00:00
Brian Salomon
f391d0f771 Reduce the number of backend->pixelconfig GrCaps virtuals.
Moves method to get GrBackendFormat from GrBackendTexture from GrCaps
to GrBackendTexture so that a GrContext is not required.

Uses kUnknown_GrPixelConfig as failure return from GrCaps functions
rather than an GrPixelConfig* out param and bool result.

Having the texture type be part of GrBackendFormat made removing the
GrCaps function that goes from GrBackendRenderTarget to GrPixelConfig
awkward so that was left alone for now.

Change-Id: If9be0f898c538be4a7b24022b6011f63441a0317
Reviewed-on: https://skia-review.googlesource.com/c/175991
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-12-14 17:12:36 +00:00
Ethan Nicholas
8e265a7520 Re-land "Perform Vulkan resets in a background thread"
Bug: skia:
Change-Id: I1c7ec365a370137ca64d9091cb60e6430c3f1c28
Reviewed-on: https://skia-review.googlesource.com/c/177069
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2018-12-13 20:24:22 +00:00
Ethan Nicholas
bff4e07398 Revert "Perform Vulkan resets in a background thread"
This reverts commit 30e6343b35.

Reason for revert: occasional failures

Original change's description:
> Perform Vulkan resets in a background thread
> 
> Bug: skia:
> Change-Id: I90783dc9ac2fcae560cd54e6c8c6df11d7195ac0
> Reviewed-on: https://skia-review.googlesource.com/c/168488
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: Iab0d65331c44fa8976bd35e5efea4b42174836b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/177061
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2018-12-12 18:17:33 +00:00
Ethan Nicholas
30e6343b35 Perform Vulkan resets in a background thread
Bug: skia:
Change-Id: I90783dc9ac2fcae560cd54e6c8c6df11d7195ac0
Reviewed-on: https://skia-review.googlesource.com/c/168488
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-12-11 21:43:13 +00:00
Brian Salomon
9f7d9a2776 Revert "Move some Gr headers from include/gpu to include/private and src/gpu."
This reverts commit 3bdc3f5f9c.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Move some Gr headers from include/gpu to include/private and src/gpu.
> 
> Bug: skia:
> Change-Id: I341dd3bff63cc99d3be830e21673073645a9cfec
> Reviewed-on: https://skia-review.googlesource.com/c/176220
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ia7082f66abb969b20dd5d1f12c3c8d09cd84c241
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/176587
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-12-11 19:01:41 +00:00
Michael Ludwig
72ab3461b7 Consolidate stroke-rect ops and use GrFillRectOp instead of GrNonAA/AARectOp
Bug: skia:
Change-Id: Iee57bc970a026de2ad5a0758153e9cbb20753fa1
Reviewed-on: https://skia-review.googlesource.com/c/173105
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-12-11 16:33:35 +00:00
Brian Salomon
3bdc3f5f9c Move some Gr headers from include/gpu to include/private and src/gpu.
Bug: skia:
Change-Id: I341dd3bff63cc99d3be830e21673073645a9cfec
Reviewed-on: https://skia-review.googlesource.com/c/176220
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-12-11 15:23:48 +00:00
Brian Salomon
967df200bd Deuninstantiate
Uninstantiated: a state of not being instantiated.

Deinstantiate: transition from instantiated to uninstantiated state.

Change-Id: Id7b6b295267674a9915f95105d73fabfcc3555de
Reviewed-on: https://skia-review.googlesource.com/c/175586
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-12-07 16:54:52 +00:00
Greg Daniel
7e000220c3 Reland "Add support for Ycbcr Conversion Samplers in vulkan."
This is a reland of 6cd74900da

Original change's description:
> Add support for Ycbcr Conversion Samplers in vulkan.
> 
> The only thing missing from this CL is that we need to bake the
> ycbcr conversion samplers into the VkPipeline when we create it. As that
> is a larger change, that will be broken up into a few follow on CLs.
> 
> Currently this only supports ycbcr conversion samplers when used with
> external textures.
> 
> Bug: skia:
> Change-Id: I23e95b19469093072589ebbbfb7926ab79dcdea9
> Reviewed-on: https://skia-review.googlesource.com/c/164602
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: skia:
Change-Id: I943398077775ef6396fbe5cb9196d23a29128669
Reviewed-on: https://skia-review.googlesource.com/c/173986
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-12-03 16:16:55 +00:00