Commit Graph

86 Commits

Author SHA1 Message Date
Greg Daniel
f6ed96d1c2 Revert "Move GrGpuResource GrSurface and GrTexture into src."
This reverts commit e5a06ce678.

Reason for revert: Need to make change in google3 first

Original change's description:
> Move GrGpuResource GrSurface and GrTexture into src.
> 
> Must land https://chromium-review.googlesource.com/c/chromium/src/+/2087980
> before this can land.
> 
> Bug: skia:7966
> Change-Id: I60bbb1765bfbb2c96b2bc0c9826b6b9d57eb2a03
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275077
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Id39e0a351e49a87209de88a6ad9fadb0219db72c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7966
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275216
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-03-05 01:46:51 +00:00
Greg Daniel
e5a06ce678 Move GrGpuResource GrSurface and GrTexture into src.
Must land https://chromium-review.googlesource.com/c/chromium/src/+/2087980
before this can land.

Bug: skia:7966
Change-Id: I60bbb1765bfbb2c96b2bc0c9826b6b9d57eb2a03
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275077
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-03-04 23:01:31 +00:00
Brian Salomon
201cdbb646 Make GrSamplerState.h and GrRenderTarget.h private
Change-Id: Id7a270f5a528e1a4a6d94474fa092545252753b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234667
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-15 12:22:11 +00:00
Robert Phillips
62221e768c Delete GrBackendSurface's GrPixelConfig
This member variable is no longer used

TBR=bsalomon@google.com
Bug: skia:6718
Change-Id: I84680c8c3bc36eefa603f5be7f3c15b496a79948
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229478
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-25 15:18:08 +00:00
Robert Phillips
c80b0e9541 Make rest of GrGpu::wrapBackend* methods take a GrColorType (take 2)
This CL is intended to further wean Ganesh off of using the GrBackendTexture's pixel config

TBR=bsalomon@google.com
Bug: skia:6718
Change-Id: Iedaa7811f9c4aac552f219c702627bc476325317
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228338
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-23 16:13:30 +00:00
Robert Phillips
dd39980115 Revert "Make rest of GrGpu::wrapBackend* methods take a GrColorType"
This reverts commit 9725638fb1.

Reason for revert: Chrome roll

Original change's description:
> Make rest of GrGpu::wrapBackend* methods take a GrColorType
> 
> This CL is intended to further wean Ganesh off of using the GrBackendTexture's pixel config
> 
> Bug: skia:6718
> Change-Id: I593c0c73922fb76045e379214e20adb1f17ea215
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227780
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: Id71acf1dec63c288a858fccd7109c84cf3cc6f0a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228337
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-18 12:28:17 +00:00
Robert Phillips
9725638fb1 Make rest of GrGpu::wrapBackend* methods take a GrColorType
This CL is intended to further wean Ganesh off of using the GrBackendTexture's pixel config

Bug: skia:6718
Change-Id: I593c0c73922fb76045e379214e20adb1f17ea215
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227780
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-17 20:00:05 +00:00
Robert Phillips
0902c98825 Pass GrColorType to the GrGpu::wrapRenderableBackendTexture chain of calls (take 2)
This is a step towards reducing our reliance-on/use-of the GrPixelConfig stored in the GrBackendTexture.

TBR=egdaniel@google.com
Bug: skia:6718
Change-Id: I316a98416c51f273e6ab578f9cbaea5f7adfe331
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227639
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-16 13:07:06 +00:00
Greg Daniel
fe88bf67c2 Revert "Pass GrColorType to the GrGpu::wrapRenderableBackendTexture chain of calls"
This reverts commit 5572737d95.

Reason for revert: Adreno 4xx bots hitting compatibility assert in InitialTextureClear test

Original change's description:
> Pass GrColorType to the GrGpu::wrapRenderableBackendTexture chain of calls
> 
> This is a step towards reducing our reliance-on/use-of the GrPixelConfig stored in the GrBackendTexture.
> 
> Bug: skia:6718
> Change-Id: I2170032bfbbb57423c4bb0d901ad014c61d38131
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223701
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: I24cf6b3aa0dfca2e935a36592860ad91171b21a7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227637
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-16 00:33:13 +00:00
Robert Phillips
5572737d95 Pass GrColorType to the GrGpu::wrapRenderableBackendTexture chain of calls
This is a step towards reducing our reliance-on/use-of the GrPixelConfig stored in the GrBackendTexture.

Bug: skia:6718
Change-Id: I2170032bfbbb57423c4bb0d901ad014c61d38131
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223701
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-15 20:40:09 +00:00
Jim Van Verth
658d499afc New approach to fixing Vulkan MSAA.
MakeFromBackendTextureAsRenderTarget is planned to be deprecated, so we
should use MakeFromBackendTexture with a sampleCount parameter instead.
On Vulkan, this ran into issues because we assumed an allocation for the
VkImage and the swapchain doesn't provide us with one. Fixed so we don't
need an allocation for Borrowed textures.

Bug: skia:
Change-Id: Ib26888020e093f4a734a4159eae898539c2273b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226839
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-07-11 18:34:19 +00:00
Robert Phillips
da2e67a357 Add GrProtected parameter to all createBackendTexture variants
Change-Id: I667bc730e321b579bef98f3d6003f7a7b29c9890
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/224957
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-01 19:46:18 +00:00
Robert Phillips
4bdd36f625 Make color initialization version of createBackendTexture public
Mechanical.

Change-Id: I48be78a12684fc5243ee509e391984daa190fb7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218182
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-04 20:12:22 +00:00
Robert Phillips
806267973f Switch all internel uses of GrContext::createBackendTexture over to initialized versions
For Skia's testing we always want an initialized backend texture. Except for the
BackendAllocationTests of course.

Change-Id: I47b5e4c9845b3f58ebad5ba052780a69d6cd6954
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216348
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-06-04 14:42:27 +00:00
Robert Phillips
5c7a25bd2f Move explicit backend object allocation API to GrContext
This initial portion of the API should be ready to go. Follow on CLs will add the other entry points.

Change-Id: Ia9c708046ba08b16f9a71558e2bf2c38279abe5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-20 15:31:56 +00:00
Robert Phillips
9b16f81858 Switch over to using new direct allocation API in our tests (as much as possible at least)
To fully switch over we need the entry point that uploads data but most of the old call
sites can be switched over now.

Change-Id: I362b1dfde7d88bf8d3f8f90155f53d9ac442a329
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214300
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-17 15:41:50 +00:00
Robert Phillips
9dbcdcc8ba Alter createTestingOnlyBackendTexture methods
This intended to bring this API more into line with the proposed GrBackendObject API with an eye towards replacing the former with the latter.

TBR=bsalomon@google.com
Change-Id: I4367f03fb10fff788749f21c4843060111a6df1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213220
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-13 15:39:33 +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
Robert Phillips
9da87e0e98 Rename GrContext::contextPriv to priv
Mechanical. This makes the priv() accessor the same for all the context types.

Change-Id: I40850eb05a33b8d7cc3eabdd42226d24b2ba58aa
Reviewed-on: https://skia-review.googlesource.com/c/189164
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-04 22:13:14 +00:00
Brian Salomon
aa6ca0a8bf Require explicit GrWrapCacheable specification in more places.
Make all wrapped resources be kUnbudgetedUncacheable except those
created by AHardwareBuffer image generators and as backings for promise
images.

Make all non-wrapped unbudgeted resources be kUnbudgetedUncacheable.

Update unit tests to mostly use GrWrapCacheable::kNo except where they
are testing the distinction.

Update unit tests for new expectations.
Bug: chromium:922851
Change-Id: I4d3bdaa161ffc76390f26334bcb7e2b47dd9319d
Reviewed-on: https://skia-review.googlesource.com/c/185004
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-25 00:29:27 +00:00
Brian Salomon
fa2ebeaf33 Replace bool purgeImmediately with enum GrWrapCacheable.
Store budgeted status as a tri-state enum on GrGpuResource:
kBudgeted
kUnbudgetedCacheable
kUnbudgetedUncacheable

Uncacheable vs. Cacheable captures the current distinction between
wrapped resources created with purgeImmediately or !purgeImmediately.

Non-wrapped and unbudgeted resources are all kUnbudgetedCacheable to
match current behavior.

This change just introduces the new types. No behavior is changed.

Bug: chromium:922851

Change-Id: Ic2387bf321cf9b56b4c9ffd9dbef8ade60f9cb98
Reviewed-on: https://skia-review.googlesource.com/c/185003
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-24 21:26:24 +00:00
Brian Salomon
c67c31ced1 Revert "Revert "Mark wrapped textures imported into SkImages as "read only".""
This reverts commit ff4ccaa9fc.

Bug: skia:8509
Change-Id: If4a059d6e6e412ec1d6be2c70663d59c362e91d2
Reviewed-on: https://skia-review.googlesource.com/c/175249
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-12-06 15:34:31 +00:00
Brian Salomon
ff4ccaa9fc Revert "Mark wrapped textures imported into SkImages as "read only"."
This reverts commit 796693af3c.

Reason for revert: texture flags assertion in DDL config

Original change's description:
> Mark wrapped textures imported into SkImages as "read only".
> 
> Read only textures and proxies fail writePixels, as copy dsts, and mip
> regeneration.
> 
> Bug: skia:8509
> 
> Change-Id: Iaa0b473cc9a9930fde3ef0e91373d5040650de35
> Reviewed-on: https://skia-review.googlesource.com/c/174316
> 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: If5cb36e83795656185ff8d26e4ef2c52a2695a09
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8509
Reviewed-on: https://skia-review.googlesource.com/c/174846
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-12-05 21:35:40 +00:00
Brian Salomon
796693af3c Mark wrapped textures imported into SkImages as "read only".
Read only textures and proxies fail writePixels, as copy dsts, and mip
regeneration.

Bug: skia:8509

Change-Id: Iaa0b473cc9a9930fde3ef0e91373d5040650de35
Reviewed-on: https://skia-review.googlesource.com/c/174316
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-12-05 20:12:42 +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
Greg Daniel
2268ad23fe Add flag to force purge resources from cache as soon as possible.
Bug: skia:
Change-Id: Ibd636b9e1bf932033c3161c862523f841cb85e79
Reviewed-on: https://skia-review.googlesource.com/c/171005
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-11-15 16:45:30 +00:00
Robert Phillips
646f637f4c Add rowBytes to createTestingOnlyBackendTexture
This is pulled out of:

https://skia-review.googlesource.com/c/skia/+/151983 (Test YUV images in DDL)

The YUV images seem to like to have row padding.

Change-Id: I517d2b63678beeafef88f86148fca15862176780
Reviewed-on: https://skia-review.googlesource.com/156367
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-09-25 13:48:29 +00:00
Herb Derby
d3895d867c Centralize the predicate for a glyph being too large for the atlas
Centralize the calculation to SkGlyphCacheCommon. This allows this
function to be used with NO_GPU.

In addition, this was used in the last remaining function in GrTest.
That function was used in a single place. I made the function a static
and remove GrTest.h. This had massive knock-on effects.

Change-Id: I80f874a988f9af4383a83acf7c273d23b8d67c22
Reviewed-on: https://skia-review.googlesource.com/151480
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-09-05 19:25:29 +00:00
Greg Daniel
108bb23277 Reland "Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors."
This reverts commit 34aa059c15.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors."
> 
> This reverts commit ff2181e62e.
> 
> Reason for revert: suspect it's behind Chrome roll failure
> 
> Original change's description:
> > Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors.
> > 
> > Bug: skia:
> > Change-Id: I1466668e3502cd1e6e1f6aed4105e0f626d293dd
> > Reviewed-on: https://skia-review.googlesource.com/138987
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: I4cba44858aafffbadc45e18349b93c741d7cfc66
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/139220
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

Bug: skia:
Change-Id: Ib1fd10c126862824f3e31c420c697ac749c637f5
Reviewed-on: https://skia-review.googlesource.com/139221
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-07-03 20:46:27 +00:00
Ethan Nicholas
34aa059c15 Revert "Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors."
This reverts commit ff2181e62e.

Reason for revert: suspect it's behind Chrome roll failure

Original change's description:
> Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors.
> 
> Bug: skia:
> Change-Id: I1466668e3502cd1e6e1f6aed4105e0f626d293dd
> Reviewed-on: https://skia-review.googlesource.com/138987
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I4cba44858aafffbadc45e18349b93c741d7cfc66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/139220
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2018-07-03 16:38:45 +00:00
Greg Daniel
ff2181e62e Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors.
Bug: skia:
Change-Id: I1466668e3502cd1e6e1f6aed4105e0f626d293dd
Reviewed-on: https://skia-review.googlesource.com/138987
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-07-03 13:41:13 +00:00
Brian Osman
c7ad40f76f Remove SK_SUPPORT_GPU checks in tool-only code
Most of this is (obviously) not necessary to do, but once
I started, I figured I'd just get it all. Tools (nanobench,
DM, skiaserve), all GMs, benches, and unit tests, plus support
code (command line parsing and config stuff).

This is almost entirely mechanical.

Bug: skia:
Change-Id: I209500f8df8c5bd43f8298ff26440d1c4d7425fb
Reviewed-on: https://skia-review.googlesource.com/131153
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-05-31 18:59:44 +00:00
Greg Daniel
52e16d9848 Update getBackendInfo calls on GrBackendTexture to support VkImageLayout better.
The big api level change here is that the getBackendInfo calls now return by value
instead of a pointer. These changes are being made in support of Vulkan so that
the client can update the VkImageLayout on the GrBackendTexture and have that
update get reflected in our internal tracking of the image. This is done by storing
a ref counted GrVkImageLayout object on the GrBackendTexture and the GrVkImage.

Bug: skia:
Change-Id: I8c6158fd3a66eb61fef97ebf09ea5364bca3f1ae
Reviewed-on: https://skia-review.googlesource.com/119101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-04-10 14:20:22 +00:00
Greg Daniel
8a3f55c659 Revert "Improve handling of GrPixelConfig in GrBackendTex/RT ctors"
This reverts commit 7d2b16ad13.

Reason for revert: Maybe breaking chrome?

Original change's description:
> Improve handling of GrPixelConfig in GrBackendTex/RT ctors
> 
> Make sure that no client facing code was relying on what we set as the
> default value for fConfig by making in kUnkown.
> 
> Bug: skia:
> Change-Id: Ie52ff08ba8deeacc16fe06eb0dd0c7292b2edf91
> Reviewed-on: https://skia-review.googlesource.com/114261
> Reviewed-by: Robert Phillips <robertphillips@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: I91e190d72407f9c4bee93a031a557f740bb49b66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/114423
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-14 17:32:41 +00:00
Greg Daniel
7d2b16ad13 Improve handling of GrPixelConfig in GrBackendTex/RT ctors
Make sure that no client facing code was relying on what we set as the
default value for fConfig by making in kUnkown.

Bug: skia:
Change-Id: Ie52ff08ba8deeacc16fe06eb0dd0c7292b2edf91
Reviewed-on: https://skia-review.googlesource.com/114261
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-14 14:12:42 +00:00
Brian Salomon
26102cb604 Make GrGpu::deleteTestingOnlyBackendTexture() take const GrBackendTexture&
Change-Id: Ibd00d0dc6d8c73628f26851e102defdbafab149b
Reviewed-on: https://skia-review.googlesource.com/113164
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-09 18:20:40 +00:00
Brian Salomon
e64b064f87 Remove abandon param from GrGpu::deleteTestingOnlyBackendTexture.
Prior to the existence of GrBackendTexture this was required to delete a backend-specific blob. Now it's a no-op.

Change-Id: Iba0e4233e4d07235626f0ae14b0f7e77c073d8c0
Reviewed-on: https://skia-review.googlesource.com/112569
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-07 17:56:30 +00:00
Greg Daniel
8385a8a44b Revert "Revert "Fixes to alignment issues with regards to mapped vulkan memory.""
This reverts commit 88fdee9bde.

Reason for revert: Pre Fixes landed in other repos

Original change's description:
> Revert "Fixes to alignment issues with regards to mapped vulkan memory."
> 
> This reverts commit 9fb6cf4c49.
> 
> Reason for revert: breaks fuchsia
> 
> Original change's description:
> > Fixes to alignment issues with regards to mapped vulkan memory.
> > 
> > Bug: skia:
> > Change-Id: Ida9813fe774580a6d157b8eb8d330488c8e8c4bc
> > Reviewed-on: https://skia-review.googlesource.com/109483
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> 
> TBR=djsollen@google.com,egdaniel@google.com,jvanverth@google.com
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: skia:
> Change-Id: If1223313cab27737ada401d1f3fe4b7ab849d03f
> Reviewed-on: https://skia-review.googlesource.com/110040
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: skia:
Change-Id: Ifeebf535c3617674846f7ef25e686ee11ceee65c
Reviewed-on: https://skia-review.googlesource.com/110160
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-02-26 18:59:38 +00:00
Greg Daniel
88fdee9bde Revert "Fixes to alignment issues with regards to mapped vulkan memory."
This reverts commit 9fb6cf4c49.

Reason for revert: breaks fuchsia

Original change's description:
> Fixes to alignment issues with regards to mapped vulkan memory.
> 
> Bug: skia:
> Change-Id: Ida9813fe774580a6d157b8eb8d330488c8e8c4bc
> Reviewed-on: https://skia-review.googlesource.com/109483
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

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

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

Bug: skia:
Change-Id: If1223313cab27737ada401d1f3fe4b7ab849d03f
Reviewed-on: https://skia-review.googlesource.com/110040
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-02-25 14:00:39 +00:00
Greg Daniel
9fb6cf4c49 Fixes to alignment issues with regards to mapped vulkan memory.
Bug: skia:
Change-Id: Ida9813fe774580a6d157b8eb8d330488c8e8c4bc
Reviewed-on: https://skia-review.googlesource.com/109483
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-02-23 20:17:16 +00:00
Brian Salomon
bdecacfbe4 Revert "Revert "Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend.""""""
This reverts commit 3a2cc2c2ec.

Fix code with samplecnt=0 that slipped in between trybots/CQ and landing of previous version

Change-Id: Iab19f2e8d1e9901601c8c76244d7a88c5d707fab
Reviewed-on: https://skia-review.googlesource.com/103181
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-03 01:59:59 +00:00
Brian Salomon
3a2cc2c2ec Revert "Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""""
This reverts commit 5bb82cbecd.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend.""""
> 
> This reverts commit 18c52a7b52.
> 
> Also relands "More sample count cleanup:" and "Add new GrContext queries for imagability, surfacability, and max sample count of color types"
> 
> 
> Bug: skia:
> Change-Id: I4028105a3a1f16ce3944e134619eb6245af6b947
> Reviewed-on: https://skia-review.googlesource.com/102940
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Idee23be2f1719f0bdc9305043e95a2d589bee8d1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/103220
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-03 00:25:20 +00:00
Brian Salomon
5bb82cbecd Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend.""""
This reverts commit 18c52a7b52.

Also relands "More sample count cleanup:" and "Add new GrContext queries for imagability, surfacability, and max sample count of color types"


Bug: skia:
Change-Id: I4028105a3a1f16ce3944e134619eb6245af6b947
Reviewed-on: https://skia-review.googlesource.com/102940
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-02 23:37:59 +00:00
Brian Salomon
18c52a7b52 Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""
This reverts commit d0d7270fcc.

Revert "More sample count cleanup:"

This reverts commit d653cac70e.

Revert "Add new GrContext queries for imagability, surfacability, and max sample count of color types"

This reverts commit 85ae7159c9.


Need to understand NVPR perf changes before relanding

Change-Id: I0db075fb42438ef2a1f9885df184dce52892ac4b
Reviewed-on: https://skia-review.googlesource.com/102780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-02 12:19:52 +00:00
Brian Salomon
d0d7270fcc Revert "Revert "Redefine the meaning of sample counts in GPU backend.""
Fixes gpu config default samples to be 1 and updates config parsing test accordingly.

This reverts commit c1ce2f7966.

Bug: skia:
Change-Id: I456973b1f52ced85a2011ea10fc49449bfc5846f
Reviewed-on: https://skia-review.googlesource.com/102147
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-01 21:15:39 +00:00
Brian Salomon
c1ce2f7966 Revert "Redefine the meaning of sample counts in GPU backend."
This reverts commit 48825b11ad.

Reason for revert: nanobench

Original change's description:
> Redefine the meaning of sample counts in GPU backend.
> 
> Old: 0  -> nonMSAA
>      1+ -> MSAA
> 
> New:
>      0  -> error/unsupported
>      1  -> nonMSAA
>      2+ -> MSAA
> 
> We still allow 0 to mean nonMSAA in three sets of public APIs for backwards compatibility:
> 
> 1) SkSurface factories
> 2) GrBackendRenderTarget constructors
> 3) GrCaps::getSampleCnt()'s requestedCount parameter
> 
> However, we immediately clamp to 1 and treat 0 as invalid/non-renderable internally.
> 
> This also changes the behavior when using a large sample count. We now fail in that case rather than using the largest sample available sample count. GrCaps::getSampleCount() will return 0 in this case.
> 
> 
> Bug: skia:
> Change-Id: Ida22c6b22c1365e563c9046b611e88bf5eb3ff33
> Reviewed-on: https://skia-review.googlesource.com/101560
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ic257619a8a5ee9ac15419ecf10259e42daed7f82
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/102662
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-01 18:34:40 +00:00
Brian Salomon
48825b11ad Redefine the meaning of sample counts in GPU backend.
Old: 0  -> nonMSAA
     1+ -> MSAA

New:
     0  -> error/unsupported
     1  -> nonMSAA
     2+ -> MSAA

We still allow 0 to mean nonMSAA in three sets of public APIs for backwards compatibility:

1) SkSurface factories
2) GrBackendRenderTarget constructors
3) GrCaps::getSampleCnt()'s requestedCount parameter

However, we immediately clamp to 1 and treat 0 as invalid/non-renderable internally.

This also changes the behavior when using a large sample count. We now fail in that case rather than using the largest sample available sample count. GrCaps::getSampleCount() will return 0 in this case.


Bug: skia:
Change-Id: Ida22c6b22c1365e563c9046b611e88bf5eb3ff33
Reviewed-on: https://skia-review.googlesource.com/101560
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-01 18:16:58 +00:00
Robert Phillips
f35fd8d2f2 Move more internal methods from GrContext to GrContextPriv (take 3)
Change-Id: Ied630e61cf95780bf85032867e6ce663e1ef9c2f
Reviewed-on: https://skia-review.googlesource.com/98000
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-01-22 16:53:17 +00:00
Leon Scroggins
2914555e00 Revert "Move more internal methods from GrContext to GrContextPriv (take 2)"
This reverts commit c22e50bd31.

Reason for revert: Speculative fix for Android roll

Original change's description:
> Move more internal methods from GrContext to GrContextPriv (take 2)
> 
> Change-Id: I47108910517d61edeb52f82793d384fdb5605d45
> Reviewed-on: https://skia-review.googlesource.com/97241
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: I3a77ac33c5f48529357cf9c683d5f4cacaa2379f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/97582
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-01-20 17:09:10 +00:00
Robert Phillips
c22e50bd31 Move more internal methods from GrContext to GrContextPriv (take 2)
Change-Id: I47108910517d61edeb52f82793d384fdb5605d45
Reviewed-on: https://skia-review.googlesource.com/97241
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-01-19 19:26:46 +00:00