Commit Graph

372 Commits

Author SHA1 Message Date
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
Greg Daniel
f4bf973592 Revert "Add support for Ycbcr Conversion Samplers in vulkan."
This reverts commit 6cd74900da.

Reason for revert: breaking win vulkan bots

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>

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

Change-Id: Ib56905821cbfd40cf30ec89269b551ce01605a1a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/173982
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-12-03 14:34:45 +00:00
Greg Daniel
6cd74900da 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>
2018-12-03 14:13:42 +00:00
Michael Ludwig
6985853f88 Reland "Initial definition of fill rect op"
This reverts commit 1a2476d294.

Reason for revert: Fixes printf signatures and asserts.

Original change's description:
> Revert "Initial definition of fill rect op"
> 
> This reverts commit d3c92d9a36.
> 
> Reason for revert: printf build failure on gcc, assert failures on CQ
> 
> Original change's description:
> > Initial definition of fill rect op
> > 
> > Bug: skia:
> > Change-Id: Ie0c99eb5163501853d1adc885bd3841f90a71924
> > Reviewed-on: https://skia-review.googlesource.com/c/163486
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
> 
> Change-Id: Ib32f91a39d91aeb87982a7b19719485e4a1bf8ae
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/173233
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: I415913a269ba5bcdebd169b5ebc3510673247bfd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/173234
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2018-11-28 20:38:25 +00:00
Michael Ludwig
1a2476d294 Revert "Initial definition of fill rect op"
This reverts commit d3c92d9a36.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Initial definition of fill rect op
> 
> Bug: skia:
> Change-Id: Ie0c99eb5163501853d1adc885bd3841f90a71924
> Reviewed-on: https://skia-review.googlesource.com/c/163486
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: Ib32f91a39d91aeb87982a7b19719485e4a1bf8ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/173233
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-11-28 19:58:33 +00:00
Michael Ludwig
d3c92d9a36 Initial definition of fill rect op
Bug: skia:
Change-Id: Ie0c99eb5163501853d1adc885bd3841f90a71924
Reviewed-on: https://skia-review.googlesource.com/c/163486
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-11-28 19:08:34 +00:00
Greg Daniel
54bfb18dad Privately include our version of vulkan header file in all our src files.
This should allow clients to include Skia and their vulkan files in any
order. However, it does require that when clients are building their
files that include skia with vulkan, they must have vulkan/vulkan_core.h
on their include path somewhere.

Bug: skia:
Change-Id: I969db396c92127be7c8df754926d175f38b8aafa
Reviewed-on: https://skia-review.googlesource.com/c/172147
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-11-26 15:15:44 +00:00
Chris Dalton
133944a14f Add a dedicated Op for analytic round rects
Adds a GrAAFillRRectOp class that can draw any round rect, including
complex. The Op makes use of instanced rendering and fwidth().

Bug: chromium:860021
Change-Id: I3d8818a003899b56c33d35babe22cd15d3f8e110
Reviewed-on: https://skia-review.googlesource.com/c/170729
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-11-19 19:26:12 +00:00
Michael Ludwig
460eb5e746 Reland "Extract per-edge quad vertex tesselation code into reusable interface"
This is a reland of fc3784bd6c

Original change's description:
> Extract per-edge quad vertex tesselation code into reusable interface
> 
> This moves the vertex templates and the edge outset/tessellation code into a new GrPerEdgeAAQuadHelper h/cpp file. The vertex template hierarchy has been expanded to include an optional local coordinate type: void, SkPoint, or SkPoint3. The texture op only uses SkPoint for its local coordinates but the regular rect op will need void and SkPoint3 as well.
> 
> A large part of the added code is providing the tessellation specializations for those new local coordinate types.
> 
> Bug: skia:
> Change-Id: Id8cf2a17342f30b299b16be95e341d4991951c38
> Reviewed-on: https://skia-review.googlesource.com/c/164611
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Bug: skia:
Change-Id: I9cf9fe2e3ccdacc396290b39f839e790a117fa8c
Reviewed-on: https://skia-review.googlesource.com/c/165781
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2018-10-29 16:11:27 +00:00
Brian Osman
ff78aaa431 Revert "Extract per-edge quad vertex tesselation code into reusable interface"
This reverts commit fc3784bd6c.

Reason for revert: persp_images gold images look bad.

Original change's description:
> Extract per-edge quad vertex tesselation code into reusable interface
> 
> This moves the vertex templates and the edge outset/tessellation code into a new GrPerEdgeAAQuadHelper h/cpp file. The vertex template hierarchy has been expanded to include an optional local coordinate type: void, SkPoint, or SkPoint3. The texture op only uses SkPoint for its local coordinates but the regular rect op will need void and SkPoint3 as well.
> 
> A large part of the added code is providing the tessellation specializations for those new local coordinate types.
> 
> Bug: skia:
> Change-Id: Id8cf2a17342f30b299b16be95e341d4991951c38
> Reviewed-on: https://skia-review.googlesource.com/c/164611
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,rmistry@google.com,brianosman@google.com,michaelludwig@google.com

Change-Id: I6d7b1b46a98d8c5ab7b159439b861d5d4dfcb58d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/165661
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-27 13:02:42 +00:00
Michael Ludwig
fc3784bd6c Extract per-edge quad vertex tesselation code into reusable interface
This moves the vertex templates and the edge outset/tessellation code into a new GrPerEdgeAAQuadHelper h/cpp file. The vertex template hierarchy has been expanded to include an optional local coordinate type: void, SkPoint, or SkPoint3. The texture op only uses SkPoint for its local coordinates but the regular rect op will need void and SkPoint3 as well.

A large part of the added code is providing the tessellation specializations for those new local coordinate types.

Bug: skia:
Change-Id: Id8cf2a17342f30b299b16be95e341d4991951c38
Reviewed-on: https://skia-review.googlesource.com/c/164611
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-26 16:31:56 +00:00
Cary Clark
b46c4d0925 remove extra include
a duplicate include messes up msvs sometimes

R=egdaniel@google.com

Bug: skia:
Change-Id: I3f16c4896064e00213aaf640575c694d1c59a462
Reviewed-on: https://skia-review.googlesource.com/c/164603
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-10-23 15:32:56 +00:00
Greg Daniel
64cc9aaaf1 Add drawDrawable support to GrRenderTargetContext.
This also includes adding drawable Op and plumbing it through to the GPU.

BUG=skia:

Change-Id: I0b2464c5a458c2fbf05b9528e47b9e6e3ac27d57
Reviewed-on: https://skia-review.googlesource.com/c/9645
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-10-19 19:48:03 +00:00