Commit Graph

49 Commits

Author SHA1 Message Date
Robert Phillips
0d8722c8b5 Make use of shareable promise images in tools
The main change here is just fusing the following three methods into recreateSKP:
   deflateSKP
   createCallbackContexts
   createSKP

All the remaining changes are just API fallout from that.

Bug: skia:11728
Change-Id: Iae2ce65983ad56c8288bdc830e248394a0055bfb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/389925
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-03-30 14:25:55 +00:00
Adlai Holler
55aaefe687 Reland "Support sharing promise images between DDLs"
This reverts commit 38b9a4bc3e.

Reason for revert: Fixed ASAN, TSAN, and other bugs via other CLs.

Original change's description:
> Revert "Support sharing promise images between DDLs"
>
> This reverts commit 07e11d48cb.
>
> Reason for revert: Broke DDL3_ASAN and DDL3_TSAN
>
> Original change's description:
> > Support sharing promise images between DDLs
> >
> > - Migrate our code to SkImage::MakePromiseTexture
> > - Have DDLTileHelper share one SKP and one set of promise images across all tiles.
> > - Disallow on-the-fly allocation of mips for promise textures.
> >
> > Bug: skia:10286
> > Change-Id: Ie35976958454fc520f3c9d860e6285441260c9f7
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291938
> > Commit-Queue: Adlai Holler <adlai@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=robertphillips@google.com,adlai@google.com
>
> Change-Id: I939b14875d1a20e4a92eab94680adcfe9596ad81
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10286
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375738
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>


Bug: skia:10286
Change-Id: Ibfd7dfcd72f10a4e29a87fa8c610f2dfd018e0db
Cq-Include-Trybots: luci.skia.skia.primary:Test-Ubuntu18-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-DDL3_ASAN,Test-Ubuntu18-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-DDL3_TSAN
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375739
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-03-04 13:10:37 +00:00
Adlai Holler
38b9a4bc3e Revert "Support sharing promise images between DDLs"
This reverts commit 07e11d48cb.

Reason for revert: Broke DDL3_ASAN and DDL3_TSAN

Original change's description:
> Support sharing promise images between DDLs
>
> - Migrate our code to SkImage::MakePromiseTexture
> - Have DDLTileHelper share one SKP and one set of promise images across all tiles.
> - Disallow on-the-fly allocation of mips for promise textures.
>
> Bug: skia:10286
> Change-Id: Ie35976958454fc520f3c9d860e6285441260c9f7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291938
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I939b14875d1a20e4a92eab94680adcfe9596ad81
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10286
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375738
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-02-25 17:55:00 +00:00
Adlai Holler
07e11d48cb Support sharing promise images between DDLs
- Migrate our code to SkImage::MakePromiseTexture
- Have DDLTileHelper share one SKP and one set of promise images across all tiles.
- Disallow on-the-fly allocation of mips for promise textures.

Bug: skia:10286
Change-Id: Ie35976958454fc520f3c9d860e6285441260c9f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291938
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-02-25 17:00:19 +00:00
Brian Salomon
9679612d6b Reland "Test all YUVA image factories with different encoded origins."
This reverts commit f1650efc55.

Reason for revert: fix for cpu/ddl configs

Original change's description:
> Revert "Test all YUVA image factories with different encoded origins."
>
> This reverts commit 2ba80af000.
>
> Reason for revert: new test fails ddl and cpu configs on imggen
>
> Original change's description:
> > Test all YUVA image factories with different encoded origins.
> >
> > Now that SkImage_GpuYUVA stores a GrYUVATextureProxies it supports
> > encoded origins.
> >
> > Modify wacky_yuv_format GMs to use different origins and remove
> > restriction in SkImage::MakeFromYUVAPixmaps.
> >
> > Bug: skia:10632
> > Change-Id: I02477d592b7baba164944d629eeac48223698c10
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353623
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> TBR=jvanverth@google.com,bsalomon@google.com
>
> Change-Id: If909ee4769cc1c74e1682a5e2870ec85a83f65c5
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10632
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354661
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

# Not skipping CQ checks because this is a reland.

Bug: skia:10632
Change-Id: Iafe79ab5b3ce0ff9e3a4007e5d8fbc44edded196
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355630
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-01-19 21:11:05 +00:00
Brian Salomon
0c0b5a6bb2 Remove SkYUVASizeInfo, make SkYUVAIndex a private part of SkYUVAInfo
Bug: skia:10632
Change-Id: If4dd7779b0856f6d0b441381bf7f2f51527cdb9d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352497
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-01-12 15:06:26 +00:00
Brian Salomon
72068174f2 Fix images used in orientation GMs
Previous approach using magick's -orient tool didn't actually change the
stored JPEG's orientation (they were all tagged Undefined and the data
was top-left).

Regenerate the images using new method where the PNGs are generated with
transformations that the EXIF tag will undo. The script converts to JPEG
using magick and then modifies the TAG using exiftool.

Change-Id: Ic2276711c0f4faa26620c93b24f4f0e58d658ae3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345127
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-12-17 15:48:25 +00:00
Brian Salomon
bd3792de72 Add SkYUVAInfo-based promise texture image factory
Bug: skia:10632
Change-Id: I6a31f2d712f704850ba5246208dc8a4a6e6916eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333519
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-11 14:38:55 +00:00
Brian Salomon
f143274cda Simplify promise image callbacks.
Remove done and release distinction. Chrome is not using either as
it tracks texture access using other synchronization mechanisms
(semaphores, flush finish procs). Now there is just fulfill and release
where release is called when the texture can be deleted. Also,
release proc can be null.

Simplify texture idle mechanism as the "flushed" state was only used to
implement the old idea of a release proc. The "finished" idle state is
still used to implement the new release proc. Though, it could also be
removed if GrTexture were to be removed for textures returned by fulfill.

Not directly tied to this bug, but a new YUVA factory will be required
and it's good to clean things up first to avoid adding another
instance of the current complexity.

Bug: skia:10632

Change-Id: I4fe3c0af3f5a591506b1b3c736fd3284a38465a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331836
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-10 02:47:56 +00:00
Adlai Holler
b270568f29 Almost remove GrContext
This is everything except for literally removing the class.

Change-Id: I2f16caf865d1bcf9c0f267aed73313c0676a73bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327222
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-10-20 15:52:01 +00:00
Robert Phillips
3172208ad0 Revert "Remove GrContext"
This reverts commit 2edf18d818.

Reason for revert: breaking wasm-debugger

Original change's description:
> Remove GrContext
>
> Woo!
>
> Change-Id: Ifa3ff7e79c7048c2f1d808cc9705593d72886f08
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326436
> Auto-Submit: Adlai Holler <adlai@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ie05bda5dad7fb5d369ebe579d2e009fdb99c0729
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326941
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-14 18:30:13 +00:00
Adlai Holler
2edf18d818 Remove GrContext
Woo!

Change-Id: Ifa3ff7e79c7048c2f1d808cc9705593d72886f08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326436
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-10-14 17:47:31 +00:00
Brian Salomon
59c60b0cb3 Reland "Add idea of DataType to SkYUVAPixmapInfo."
This is a reland of ed63444587

Original change's description:
> Add idea of DataType to SkYUVAPixmapInfo.
> 
> DataType describes the data type of YUVA channels
> independent of how they are grouped into planes.
> 
> Adds mapping functions between SkColorType/channel count
> and DataType.
> 
> SkYUVAPixmapInfo can be constructed from DataType and will
> choose appropriate SkColorTypes for each plane.
> 
> Valid SkYUVAPixmapInfos now have the same DataType for each
> plane (could relax this in the future, esp for alpha plane).
> 
> SkYUVAPixmapInfo::SupportedDataTypes specifies the supported
> combinations of SkYUVAInfo::PlanarConfig and
> kYUVAPixmapInfo::DataType supported by a GrContext (based on
> supported texture formats).
> 
> SkImageGenerator/SkCodec YUVA query API now takes a
> SupportedDataTypes.
> 
> Change-Id: I8791234638e6ba3396d1e7960b7bc210edc6dd57
> Bug: skia:10632
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314276
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:10632
Change-Id: I35b55b7477c11c822fdb3729a9f84acff1eb785d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315284
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-09-03 18:05:17 +00:00
John Stiles
7571f9e490 Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'.
Mechanically updated via Xcode "Replace Regular Expression":

  typedef (.*) INHERITED;
    -->
  using INHERITED = $1;

The ClangTidy approach generated an even larger CL which would have
required a significant amount of hand-tweaking to be usable.

Change-Id: I671dc9d9efdf6d60151325c8d4d13fad7e10a15b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314999
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-03 03:41:26 +00:00
Michael Ludwig
c7fa895e50 Revert "Add idea of DataType to SkYUVAPixmapInfo."
This reverts commit ed63444587.

Reason for revert: trying to unblock android roller, which incorrectly thinks this has a merge conflict: https://b.corp.google.com/issues/167576324

Original change's description:
> Add idea of DataType to SkYUVAPixmapInfo.
> 
> DataType describes the data type of YUVA channels
> independent of how they are grouped into planes.
> 
> Adds mapping functions between SkColorType/channel count
> and DataType.
> 
> SkYUVAPixmapInfo can be constructed from DataType and will
> choose appropriate SkColorTypes for each plane.
> 
> Valid SkYUVAPixmapInfos now have the same DataType for each
> plane (could relax this in the future, esp for alpha plane).
> 
> SkYUVAPixmapInfo::SupportedDataTypes specifies the supported
> combinations of SkYUVAInfo::PlanarConfig and
> kYUVAPixmapInfo::DataType supported by a GrContext (based on
> supported texture formats).
> 
> SkImageGenerator/SkCodec YUVA query API now takes a
> SupportedDataTypes.
> 
> Change-Id: I8791234638e6ba3396d1e7960b7bc210edc6dd57
> Bug: skia:10632
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314276
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I72c39539a4766f10cac3ca3cdef6c503a8319ff1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314895
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-09-02 21:26:39 +00:00
Brian Salomon
ed63444587 Add idea of DataType to SkYUVAPixmapInfo.
DataType describes the data type of YUVA channels
independent of how they are grouped into planes.

Adds mapping functions between SkColorType/channel count
and DataType.

SkYUVAPixmapInfo can be constructed from DataType and will
choose appropriate SkColorTypes for each plane.

Valid SkYUVAPixmapInfos now have the same DataType for each
plane (could relax this in the future, esp for alpha plane).

SkYUVAPixmapInfo::SupportedDataTypes specifies the supported
combinations of SkYUVAInfo::PlanarConfig and
kYUVAPixmapInfo::DataType supported by a GrContext (based on
supported texture formats).

SkImageGenerator/SkCodec YUVA query API now takes a
SupportedDataTypes.

Change-Id: I8791234638e6ba3396d1e7960b7bc210edc6dd57
Bug: skia:10632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314276
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-09-02 13:21:45 +00:00
Brian Salomon
be0e42cb8f New helpers for SkYUVAInfo when used with pixmaps.
SkYUVAPixmapInfo is a SkYUVAInfo with per-plane color types and row
bytes. It describes a set of pixmaps that make up a planar image.
Consolidates validity checks of the SkYUVAInfo with the color types
and row bytes. It can provide SkImageInfos for each plane and also
assist with configuring planes to share a common allocation.

SkYUVAPixmaps is a collection of SkPixmaps that are valid for a
SkYUVAInfo. It can either wrap existing SkPixmaps or allocate and
own the memory. It consolidates validity checking of SkPixmaps with
the SkYUVAInfo. Replaces sk_gpu_test::YUVAPixmaps.

Minor tweaks to SkYUVAInfo naming, parameter order consistency, adds a
hasAlpha() method.

Bug: skia:10632
Change-Id: Ib0f48b8448fff22805fd0c04e07887d0b7338b76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312886
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2020-08-27 15:39:56 +00:00
Brian Salomon
5660e8b441 Hook DDLPromiseImageHelper up to new YUVA API.
The old API is no longer implemented by SkCodecImageGenerator, meaning
we would never take the YUVA code path.

Bug: skia:10632

Change-Id: I33adb348768fdcd70368640d6857c5c7e3c2dc0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312882
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-08-25 17:13:40 +00:00
John Stiles
ec9b4aab87 Enable ClangTidy check readability-const-return-type.
https://clang.llvm.org/extra/clang-tidy/checks/readability-const-return-type.html

`const` on a non-pointer/reference return type typically doesn't add
value and can have negative side effects. (i.e., returning a
`const std::string` isn't meaningfully different from returning a
`std::string`, but can sometimes inhibit move-related optimizations.)

In Skia's case, the priv() functions are a notable exception where const
return types are intentional and valuable. These calls have been marked
with NOLINT to exclude them from the check.

This check does not affect pointer and reference returns, where
constness is important.

Change-Id: I86cab92332f164e5ab710b4127182eec99831d7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308564
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-07 17:42:38 +00:00
Brian Salomon
efb5f07a77 Remove virtual SkImage_Base::getPlanes
Change-Id: I5b106455cc54dad600e64b3f1bfcd02f5099b75b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306360
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-07-30 18:33:50 +00:00
Brian Salomon
d007281c9a Fix clang 12 Wsuggest-override and Wsuggest-destructor-override
Change-Id: Ic44e24057b95bb014504f02a736fb4341afc8971
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304856
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-22 01:11:36 +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
Mike Reed
13711ebe68 rename SkMipMap to SkMipmap
Change-Id: I1fa8a0482a717847236a30b4851061f4074b7755
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302644
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-07-15 13:26:13 +00:00
Robert Phillips
1a57857fb6 Retract GrContext.h from headers
GrContext is going away. These #includes have been letting it slip in
where it shouldn't.

Change-Id: Idbf24aeba4454d272ad3ebc8ea0d75ae4d9e6e10
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301978
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-13 20:03:58 +00:00
Robert Phillips
d5f3c98166 Update DDL test harness to use GrDirectContexts
Before I start updating this to support relocatable DDLs I felt I
should clean it up a bit.

Change-Id: I640d15a40164b33c4c2d7378e37d39fe7d3ff313
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300926
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-08 12:33:27 +00:00
Robert Phillips
11c6767a17 Create DDL for final composition step in DDL test harness
Besides better matching Viz's behavior this also reduces a lot of choppiness in the composition RenderTask DAG.

In the previous approach DDL draws and compositing draws would be interleaved resulting in a lot of render target swaps.

This necessitated some reorganization bc I wanted to reuse PromiseImageCallbackContext to manage the tiles' promiseImages.

Change-Id: I513bf060a69ff2bfe0e7b82ae72f149dfede632e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285056
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-24 12:16:34 +00:00
Robert Phillips
f95e2f42a8 Handle mipmap creation failure in DDL test harness
SkMipMap::Build fails surprisingly often. Fall back to unmipped promise images in that case.

The prior approach created the mipMaps too late (i.e., at backendTexture creation time) for the test harness to change its mind about the mip status of a promise image. This approach moves the mipmap creation earlier - to when the PromiseImageInfos are created (i.e., at SKP deflation time).

Change-Id: Id3c67a44cc84da7ee76d02f4d44d7f27ce8e39d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284136
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-20 14:11:50 +00:00
Robert Phillips
4e3ceb96b8 Fix up GPUDDLSink for Vulkan
Change-Id: If38afff3d07f51fd0f5a989c2f59e3c788086f8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284099
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-16 20:17:12 +00:00
Robert Phillips
4508eb992b Make all SkImages mipmapped w/in the DDL testing harness
When timing DDL performance with SKPs, if the mipmapping requirements of a given SkImage are gotten wrong at record time, the mipmaps will keep getting regenerated over and over again. This CL works around the problem by just creating all promise images as mipmapped. A better (but longer term solution) would be to examine the actual draw ops w/in an SKP.

Even more aggressively, we may want to disable mipmap regeneration w/in DDLs.

For desk_nytimes.skp on Windows/gl we have:

           before CL   after CL
w/ DDLs      7.999       3.136
w/o DDLs     1.953       1.863

This perf improvement won't be seen by Chrome since, presumably, they're creating their backend textures w/ the correct mipmappedness. Additionally, they, hopefully, aren't recording the same DDL over and over again (with incorrect mipmappedness).

Bug: 1056730
Change-Id: I8bf9dc9e64bc77159a04d89e5e3ac398e98beaa7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283677
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-04-16 14:49:40 +00:00
Ben Wagner
507e486219 Revert "Enable deprecated-copy-dtor warning."
This reverts commit e990fcc4b0.

Reason for revert: Build-Win-Clang-x86_64-Release-Shared

Original change's description:
> Enable deprecated-copy-dtor warning.
> 
> In C++11 a user declared destructor still requires the compiler to
> implicitly default the copy constructor and copy assignment operator,
> but this is deprecated. Note that a user declared destructor suppresses
> the move constructor and move assignment operator; a user declared
> destructor exists if any '~Foo' method declaration appears inside
> 'class Foo' (even if defaulted); if the copy and move operations are the
> same then copy operations that take 'const Foo&' will do fine double
> duty as move operations.
> 
> Clang seems to have an issue with this warning, in that it does not
> appear to distinguish between compiler defaulted and user defaulted
> destructors. As a result, it does not always warn when it should.
> There may yet be places in the code where a move operation is desired
> but may be suppressed because the implicitly defaulted  moves are not
> declared because a destructor has been declared.
> 
> This wraps dawn and shaderc configs in 'third_party' so that their
> headers will be included through '-isystem' in order to avoid the
> warnings generated by including their headers.
> 
> Change-Id: I681524cd890d86305aa99b6b765a52113b4dfa4b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280406
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

TBR=mtklein@google.com,bsalomon@google.com,bungeman@google.com

Change-Id: Icd6a2487637d21fcf7c4c7ab7cba7a8adfda5afd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280836
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-03-31 22:32:07 +00:00
Ben Wagner
e990fcc4b0 Enable deprecated-copy-dtor warning.
In C++11 a user declared destructor still requires the compiler to
implicitly default the copy constructor and copy assignment operator,
but this is deprecated. Note that a user declared destructor suppresses
the move constructor and move assignment operator; a user declared
destructor exists if any '~Foo' method declaration appears inside
'class Foo' (even if defaulted); if the copy and move operations are the
same then copy operations that take 'const Foo&' will do fine double
duty as move operations.

Clang seems to have an issue with this warning, in that it does not
appear to distinguish between compiler defaulted and user defaulted
destructors. As a result, it does not always warn when it should.
There may yet be places in the code where a move operation is desired
but may be suppressed because the implicitly defaulted  moves are not
declared because a destructor has been declared.

This wraps dawn and shaderc configs in 'third_party' so that their
headers will be included through '-isystem' in order to avoid the
warnings generated by including their headers.

Change-Id: I681524cd890d86305aa99b6b765a52113b4dfa4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280406
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-03-31 22:15:07 +00:00
Robert Phillips
19f466d399 Adds gpu stats for program cache
With the addition of the DDL program pre-compilation we need to know how it is working.

This CL also fixes some threading bugs.

Bug: skia:9455
Change-Id: I20da58a7f1b19685687fae1d159d4e0db8a4964d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273001
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-26 16:11:56 +00:00
Robert Phillips
923181b6e3 Improve DDLPromiseImageHelper
Split apart creation of the callback contexts and the backend textures
   This allows the texture upload to be done separately on the
   gpu-thread

Add a backendFormat member to the promise image callback context
   This allows the promise images to be created in CreatePromiseImages
   before the backend textures have been created (i.e., the backend
   textures can now be created on the gpu-thread so we have no
   guarantee they will be available when the SKP is being reinflated
   w/ promise images)

Change-Id: I1e21385e450a5ef27dd6950d9d6aee737aa7515d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270939
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-14 19:17:10 +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
Brian Salomon
7d88f310a9 Remove support for SkDeferredDisplayListRecorder::DelayReleaseCallback::kNo.
Bug: skia:8800
Change-Id: I39d1ac62ab9a0d4f987c23de96c644aa9b2fa70e
Reviewed-on: https://skia-review.googlesource.com/c/196161
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-28 19:02:20 +00:00
Brian Salomon
f55e8d5232 Add option to skip intermediate release/fulfill calls for promise images.
SkiaRenderer does not delete promise image textures when they are released
but not done. Refulfilling promise image textures takes a significant amount
of CPU time. This allows us to fulfill each promise image once.

Bug: skia:8736
Change-Id: I7ad7fa9678ed0ec4bb714b71fbf920ab4a845409
Reviewed-on: https://skia-review.googlesource.com/c/188039
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-31 16:24:52 +00:00
Brian Salomon
3f4cd774e6 Make SkPromiseImageTexture ref counted.
This makes the API easier to use in Chrome.

It is no longer required to pass the SkPromiseImageTexture to the
release proc.

Bug: skia:
Change-Id: I6636401f6a7915d3ad15e890718638bc91a58cc4
Reviewed-on: https://skia-review.googlesource.com/c/183383
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-14 16:19:01 +00:00
Brian Salomon
cdd8a0a0e8 Revert "Revert "Reuse GrTexture instances when the same GrBackendTexture is used to""
This reverts commit 426ba463d5.

Bug: skia:8613
Change-Id: Iacaf40549369110aa95015e8d4579ec41db22d13
Reviewed-on: https://skia-review.googlesource.com/c/182963
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-10 17:51:21 +00:00
Brian Salomon
426ba463d5 Revert "Reuse GrTexture instances when the same GrBackendTexture is used to"
This reverts commit 559c617137.

Reason for revert: breaking things

Original change's description:
> Reuse GrTexture instances when the same GrBackendTexture is used to
> repeatedly fulfill a promise SkImage.
> 
> Bug: skia:8613
> 
> Change-Id: I35c76435d630d2daa034e0c3efb59666bfd6882a
> Reviewed-on: https://skia-review.googlesource.com/c/175820
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I7548809945d0a875fdb9387398bbc45e733c0846
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8613
Reviewed-on: https://skia-review.googlesource.com/c/182960
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-10 16:33:11 +00:00
Brian Salomon
559c617137 Reuse GrTexture instances when the same GrBackendTexture is used to
repeatedly fulfill a promise SkImage.

Bug: skia:8613

Change-Id: I35c76435d630d2daa034e0c3efb59666bfd6882a
Reviewed-on: https://skia-review.googlesource.com/c/175820
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-10 16:10:59 +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
Jim Van Verth
e24b587a00 Replace use of SkYUVSizeInfo with SkYUVASizeInfo
Bug: skia:7903
Change-Id: If5acd50711ed8bd4a49efcb93db66fd3d14c8992
Reviewed-on: https://skia-review.googlesource.com/c/164681
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-10-30 15:00:34 +00:00
Jim Van Verth
8f11e43f8b Reland: Widen internal API to support more complex YUV formats
Bug: skia:7901
Change-Id: Ic83e9f0c2a493335671fe431ffba6f649812d406
Reviewed-on: https://skia-review.googlesource.com/c/163481
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-18 18:44:26 +00:00
Jim Van Verth
f99a67403a Revert "Widen internal API to support more complex YUV formats"
This reverts commit 0c583af06d.

Reason for revert: DDL is failing

Original change's description:
> Widen internal API to support more complex YUV formats
> 
> Bug: skia:7901
> Change-Id: I46fec08711b8b483cf58ccae733e4dc2a9689231
> Reviewed-on: https://skia-review.googlesource.com/c/162280
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ibe3dd7abbce4a3b6afe74c565198dadc61a9f439
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7901
Reviewed-on: https://skia-review.googlesource.com/c/163257
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-10-18 16:13:28 +00:00
Jim Van Verth
0c583af06d Widen internal API to support more complex YUV formats
Bug: skia:7901
Change-Id: I46fec08711b8b483cf58ccae733e4dc2a9689231
Reviewed-on: https://skia-review.googlesource.com/c/162280
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-18 15:10:39 +00:00
Robert Phillips
e8e2bb1384 Test YUV images in DDL
The main two CLs calved off (and landed independently) from this CL are:

https://skia-review.googlesource.com/c/skia/+/156761 (Add SkImage_Gpu::MakePromiseYUVATexture)
  -- adds internal place holder for YUVA promise images (only returns Y channel)

https://skia-review.googlesource.com/c/skia/+/156140 (Add SkImage_Base API to access planar data)
  -- adds ability to grab planes for testing purposes (not externally visible)

Bug: skia:7903
Bug: skia:8424
Change-Id: Id0f2f84851dacc66c2c266a30cafa0b628b12eb4
Reviewed-on: https://skia-review.googlesource.com/151983
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-10-01 12:12:29 +00:00
Timothy Liang
036fdfe5aa implemented getting format from texture as virtual in gpu caps
Bug: skia:
Change-Id: If6bbbd212ff472ea322d2bbed61995fe7ba85df7
Reviewed-on: https://skia-review.googlesource.com/138240
Commit-Queue: Timothy Liang <timliang@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-06-28 20:21:17 +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
Robert Phillips
96601084b3 Add DDL to SKPBench
Most of this CL is just repackaging the promise image and tile
code from ViaDDL for reuse by SKPBench.

Change-Id: Ie5003c36fe85cc5be9639552f9488b8e92dcdbbf
Reviewed-on: https://skia-review.googlesource.com/129805
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-05-30 10:12:08 +00:00