Commit Graph

33 Commits

Author SHA1 Message Date
Brian Salomon
20f1b34628 Use ManagedBackendTexture in backend allocation tests
Change-Id: I96e598c989bea7d4ee08e12369fe1a5d83453ec3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344759
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-12-17 02:50:43 +00:00
Adlai Holler
a069304560 Rename GrContextPriv to GrDirectContextPriv
Change-Id: I3fccadd8a2860dbee73f93f995738146373f8a39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326196
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-14 16:46:01 +00:00
Brian Salomon
69100f05bb Rename GrCaps fields and methods from MipMap to Mipmap
Change-Id: I44d151dc80aca8fc6426735ee17224cb5b8aa576
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304603
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-21 15:56:21 +00:00
Brian Salomon
7e67dcaea6 Rename GrMipMapped GrMipmapped
Change-Id: Ia2cfbca8982b57399b6681cbb4501c2933ab4df7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304576
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-07-21 14:06:35 +00:00
Robert Phillips
fe4b481324 Clean up some uses of GrContext in tests
Change-Id: Ic1f2f4edb8bfa27fa28f5da22575e1280a51d37b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303641
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-07-17 19:55:23 +00:00
Robert Phillips
6d344c3069 Update unit tests to accept GrDirectContext
This CL makes it explicit that the unit tests always get a direct context.

It is mainly a mechanical CL.

Change-Id: I49e0628851d9c81eb47386ef978edf905c6469d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299866
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-06 15:45:12 +00:00
Greg Daniel
c1ad77cf48 Add finisehd proc to backend texture creation.
The callback lets the caller know when the data uploads to the texture
from the create call are finished. This is important since the caller
cannot delete the backend texture till the gpu is finished on vulkan
and d3d.

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

Change-Id: I660d142219474e22b1337d2b0c81cda66fe18a4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286517
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-05-06 16:50:33 +00:00
Robert Phillips
ef41d500cc Disable MTLPixelFormatBGR10A2Unorm on iOS
This is a bit overkill. Support for BGR10_A2 was added in iOS 11 but we support iOS 9 and up.

Bug: skia:10195
Bug: 1068416
Change-Id: I0b66c3ac676ef14d5bc2c7fcf194047b51017e83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286878
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-05-01 14:47:55 +00:00
Robert Phillips
9a30ee09b0 Add BGR_10A2 support to Ganesh (take 2)
This is no different from the first try but a Chrome-side bug fix has landed:

https://chromium-review.googlesource.com/c/chromium/src/+/2173388 (Map RGBA/BGRA_1010102 to their correct SkColorType equivalents)

TBR=bsalomon@google.com
Bug: 1068416
Change-Id: Ic6ee758b0f0537d83262b0d708f9b7b15a4cb1c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286036
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-30 15:25:20 +00:00
Robert Phillips
a50ce3c983 Revert "Add BGR_10A2 support to Ganesh"
This reverts commit 44fc53b7f5.

Reason for revert: Test to see if this is causing the linux-rel MediaColorTest.Yuv420pHighBitDepth failure on the Chrome roll

Original change's description:
> Add BGR_10A2 support to Ganesh
> 
> Bug: 1068416
> Change-Id: I40aa84b7f3f770ba550b7bea44c10173ae9a7ddf
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285356
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I0ad0197ebd8de9b8761f84ba808c9f90891b9238
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1068416
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285958
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-28 22:30:46 +00:00
Robert Phillips
44fc53b7f5 Add BGR_10A2 support to Ganesh
Bug: 1068416
Change-Id: I40aa84b7f3f770ba550b7bea44c10173ae9a7ddf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285356
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-28 17:07:57 +00:00
Brian Salomon
85c3d68f25 Some improvements to backend texture creation.
This initializes more formats correctly with solid colors and relies
less on GrPixelConfig.

It also includes the changes to get gray8 read pixels working
and almost everything to initialize GL_RGB8 textures with data. Minor
stuff to follow to get RGB8 fully working and update test expectations.

Bug: skia:8962
Bug: skia:6718
Bug: skia:9358

Change-Id: Ic044b4c4badc37f14fb46c898cd3b3c21a6fc7fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251199
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-11-04 20:37:41 +00:00
Brian Salomon
dcbc359a00 Remove vestiges of 32 float texture format support
Change-Id: I186b2ea83a0c41f0ff1ecfe4163704c71ed121fb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244881
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-09-27 19:40:54 +00:00
Robert Phillips
7f367983b5 Add mipmap support to SkPixmap flavor of createBackendTexture
Change-Id: I7a2dea9b0b8e6b985f2d56e587939266022c19e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234664
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-26 19:42:27 +00:00
Robert Phillips
d34691b513 Remove compressed format support from the GrGpu::createBackendTexture code path
The intent is to add a createCompressedBackendTexture code path. This will decouple the GPU's ability to create compressed textures from raster's support for compressed SkColorTypes.

Change-Id: I5fa5dded6d5013b524fe7f99f2ebe0bdee76b3c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243657
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-24 18:10:57 +00:00
Robert Phillips
a5d96bcc51 Remove "experimental" comments regarding RG_F16 and RGBA_16161616
These two formats are now exercised in the wacky_yuv_formats GM

Change-Id: I07a5649401b7928e8c4666e39793915ac1d45646
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242560
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-19 18:05:38 +00:00
Robert Phillips
429f0d380c Add kRG_1616 and kAlpha_16 SkColorTypes
This also switches GrColorType::kR_16 to kAlpha_16 to more closely match raster.

Bug: skia:9121
Change-Id: I03c6e6c52c90aa4223478c5ea6c8b2ed8558f677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239930
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-12 12:20:09 +00:00
Robert Phillips
d470e1b905 Add kRG_88_SkColorType
Bug: skia:9121

Change-Id: Id2a12a5d607b84ce393d2b58233bf8e23f646059
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235797
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-09-06 17:55:26 +00:00
Robert Phillips
143987ef8f Update Metal backend's createBackendTexture to initialize to a given color
Change-Id: Ia0cf04a1bc1df2a4dd2670b81f890fa8a2480ca6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218184
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-14 17:33:32 +00:00
Greg Daniel
900583a11e Update some gpu caps isFormatRenderable calls.
This adds an isFormatRenderable call that doesn't take a GrColorType
which will be used in future changes. Also renamed the one that
takes a GrColorType to be more explixit what its use is.

Bug: skia:6718
Change-Id: Ib5a11aacccc4d94d21bc39be05f116ec3b23a3e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232757
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-08-06 17:09:08 +00:00
Greg Daniel
ea6bb447a2 Add supported GrColorTypes to Mtl FormatTable.
Change-Id: I095a69b801123225e1bd49573701e5e1632430eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232516
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-08-05 20:13:17 +00:00
Robert Phillips
b7f95d1c16 Switch BackendAllocationTests from GrPixelConfig to GrColorType
Bug: skia:6718
Change-Id: Ifd78a1b227dc468ce882cf3caf78b4fae80cc006
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229386
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-07-29 13:26:06 +00:00
Greg Daniel
009ad250fe Remove RG32F color type and pixel config.
Change-Id: I7fd3a8f6c02217d011f353ef602718a537bb87b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228116
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-17 17:05:36 +00:00
Aaron O'Mullan
829b6a0ff4 Fix Metal includes breaking macOS local builds
Before this fix, skia (and thus Chrome) would fail to compile on macOS when the user (developer) had a case-sensitive file-system.

So I've replaced the incorrect includes of <metal/metal.h> by <Metal/Metal.h>

Change-Id: I6ebcc0f46608f6d840d80d18e5f5baf0744a7f16
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225776
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-08 14:02:47 +00:00
Greg Daniel
e706735433 Reland "Removed made-up kSBGRA pixel config."
This reverts commit 70aae53d57.

Reason for revert: Relanding with fix

Original change's description:
> Revert "Removed made-up kSBGRA pixel config."
>
> This reverts commit ff95f6ca9d.
>
> Reason for revert: Broke command buffer GLBackendAllocationTest??
>
> Original change's description:
> > Removed made-up kSBGRA pixel config.
> >
> > We made up this pixel config and don't actually use it ourselves so lets
> > kill it for simplicity.
> >
> > Change-Id: I6ae1c78fe7ada336a2411d295e8836dfeecb2d5c
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223979
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com
>
> Change-Id: I62e954495a702c7ad050719d8a1d6c4abcea3f60
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223990
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: If8781567f065031c46bcea74098d32ed1bc72607
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223994
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-27 01:57:13 +00:00
Brian Salomon
70aae53d57 Revert "Removed made-up kSBGRA pixel config."
This reverts commit ff95f6ca9d.

Reason for revert: Broke command buffer GLBackendAllocationTest??

Original change's description:
> Removed made-up kSBGRA pixel config.
> 
> We made up this pixel config and don't actually use it ourselves so lets
> kill it for simplicity.
> 
> Change-Id: I6ae1c78fe7ada336a2411d295e8836dfeecb2d5c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223979
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I62e954495a702c7ad050719d8a1d6c4abcea3f60
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223990
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-26 23:52:13 +00:00
Greg Daniel
ff95f6ca9d Removed made-up kSBGRA pixel config.
We made up this pixel config and don't actually use it ourselves so lets
kill it for simplicity.

Change-Id: I6ae1c78fe7ada336a2411d295e8836dfeecb2d5c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223979
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-26 21:25:41 +00:00
Emircan Uysaler
23ca4e7dc5 Enable creating protected vulkan backend
This CL allows user to indicate that they have a protected content in
GrVkBackendContext creation which results in protected CommandPool and Queue
usage.

Bug: skia:9016
Change-Id: I6a478d688b6988c2c5e5e98f18f58fb21f9d26ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210067
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Emircan Uysaler <emircan@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-06-24 16:04:00 +00:00
Robert Phillips
459b295bed Expand backend allocation API to allow an initialization color (only for GL to start)
Change-Id: I8e676e80f85f14c81c3cec8d766d0fdc7e25f426
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214445
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-23 15:11:04 +00:00
Robert Phillips
b04b694689 Make GrGLGpu::createBackendTexture parallel GrGLGpu::createTextureImpl
- in preparation for making createBackendTexture call createTextureImpl (just like GrGLGpu::onCreateTexture)

This is more pre-work for making https://skia-review.googlesource.com/c/skia/+/214445/ (Expand backend allocation API to allow an initialization color) reasonable to review.

Change-Id: I28a9ec889532fb72fd05bea4b1fdbb8935e5228b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215170
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-22 14:40:20 +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
efb9f14aba Add testing of mipmaps to backend allocation test
Bug: skia:9091
Change-Id: I1d928d3180c47d22a41c69e169da00b598318d47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214301
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-05-17 19:57:56 +00:00
Robert Phillips
0c6daf034b Direct backend object allocation API
Change-Id: Ie8733a4db8061c67678a41cf239ce4407e967df7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212965
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-05-17 12:14:48 +00:00