Commit Graph

248 Commits

Author SHA1 Message Date
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
Michael Ludwig
1fe2b80dc7 Revert "Reland "Draw image filters directly under non-axis-aligned transforms""
This reverts commit 7712db9c24.

Reason for revert: blink unittests and maybe vulkan+skiarenderer masks appear broken. The blink unittests had actually failed with original CL, but was missed because of focus on Android. Not sure what's going on yet.

Original change's description:
> Reland "Draw image filters directly under non-axis-aligned transforms"
>
> This reverts commit 6cafdc069b.
>
> Reason for revert: Fixes unit test failure in Android
>
> In the original version, this internalSaveLayer() returned early if the
> strategy was kNoLayer. This diverged from the old code that updated the
> canvas' clip bounds and then returned before making the layer. A comment
> had suggested this was maybe okay to switch to this early out, but it
> turns out that's not the case.
>
> In Android's unit tests, it queries the clip bounds on a recording canvas
> which always uses a no-layer strategy. However, we do need to set the
> clip bounds of these types of canvas' (or virtual wrappers of a real
> canvas) so that they stay consistent with a real canvas.
>
> The unit tests had two failures, first the bounds and second a color
> mismatch after reading back. However, the bounds test was an ASSERT_EQ
> inside an SkDrawable function. ASSERT_EQ aborts the current function, so
> it never ran the drawRect that sets the color to green. The later
> readback is outside the drawable function, so that test still happened
> and failed. The only real issue to fix is the clip bounds tracking; once
> that unit test succeeds, the color readback will work properly.
>
> Original change's description:
> > Revert "Draw image filters directly under non-axis-aligned transforms"
> >
> > This reverts commit f8f23b2030.
> >
> > Reason for revert: b/172617382 is creating issues for Android's Webview
> >
> > Original change's description:
> > > Draw image filters directly under non-axis-aligned transforms
> > >
> > > This removes hacking the canvas CTM and wrapping the paint's image
> > > filter in a special MatrixTransform that computed a post-transform
> > > instead of its documented pre-transform effect. Performance-wise, the
> > > computed layer sizes should be about the same, but we avoid one less
> > > render target switch because we apply the transformation while drawing
> > > to the dst device, vs. transforming into another temporary layer and
> > > then drawing that to the dst device.
> > >
> > > Several important changes in behavior here:
> > > 1. The DeviceCM record no longer has a stashed matrix to restore and
> > >    holds its restoration paint directly.
> > > 2. Devices for image filter inputs can now have device-to-global
> > >    transforms that are not integer translates.
> > > 3. The MatrixTransform hack punted when there was perspective because it
> > >    could produce excessively large temporary images, but the new version
> > >    appears to work around that. We now impose a maximum layer size to
> > >    protect against that and automatically scale the layer to prevent it.
> > >    Perspective image filters otherwise now draw correctly.
> > > 6. Updated layer sizing code to use the new image filter APIs
> > > 7. Updated backdrop filter and restore filters to go through the same
> > >    code paths, although restore filters skip the intermediate image
> > >    transform.
> > >     - layer bounds and transforms now go through the updated skif API
> > >       and is hopefully more straight forward to understand.
> > > 8. Now we can optimize root color filter nodes of a filter DAG, even if
> > >    the entire DAG can't be represented as a color filter. The last node
> > >    is pulled off and composed with the restoration paint instead.
> > >
> > > Bug: skia:9074,skia:9283
> > > Change-Id: I1fa1d50135b9d6d453b02f89aa3cc3b54deab678
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328376
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> >
> > TBR=bsalomon@google.com,robertphillips@google.com,fmalita@google.com,reed@google.com,michaelludwig@google.com
> >
> > Change-Id: I098d0e4b8ee067b436400eb9fea047e629544eec
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:9074
> > Bug: skia:9283
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332737
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Derek Sollenberger <djsollen@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> TBR=djsollen@google.com,bsalomon@google.com,robertphillips@google.com,fmalita@google.com,reed@google.com,michaelludwig@google.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: skia:9074
> Bug: skia:9283
> Change-Id: Ifd5fed708d05a64ddccbd096fbf29896a44ef9f5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333123
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=djsollen@google.com,bsalomon@google.com,robertphillips@google.com,fmalita@google.com,reed@google.com,michaelludwig@google.com

Change-Id: I7758641e0279ab5af44794d70cd381bc0a69f956
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9074
Bug: skia:9283
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333756
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-10 21:26:17 +00:00
Michael Ludwig
7712db9c24 Reland "Draw image filters directly under non-axis-aligned transforms"
This reverts commit 6cafdc069b.

Reason for revert: Fixes unit test failure in Android

In the original version, this internalSaveLayer() returned early if the
strategy was kNoLayer. This diverged from the old code that updated the
canvas' clip bounds and then returned before making the layer. A comment
had suggested this was maybe okay to switch to this early out, but it
turns out that's not the case.

In Android's unit tests, it queries the clip bounds on a recording canvas
which always uses a no-layer strategy. However, we do need to set the
clip bounds of these types of canvas' (or virtual wrappers of a real
canvas) so that they stay consistent with a real canvas.

The unit tests had two failures, first the bounds and second a color
mismatch after reading back. However, the bounds test was an ASSERT_EQ
inside an SkDrawable function. ASSERT_EQ aborts the current function, so
it never ran the drawRect that sets the color to green. The later
readback is outside the drawable function, so that test still happened
and failed. The only real issue to fix is the clip bounds tracking; once
that unit test succeeds, the color readback will work properly.

Original change's description:
> Revert "Draw image filters directly under non-axis-aligned transforms"
>
> This reverts commit f8f23b2030.
>
> Reason for revert: b/172617382 is creating issues for Android's Webview
>
> Original change's description:
> > Draw image filters directly under non-axis-aligned transforms
> >
> > This removes hacking the canvas CTM and wrapping the paint's image
> > filter in a special MatrixTransform that computed a post-transform
> > instead of its documented pre-transform effect. Performance-wise, the
> > computed layer sizes should be about the same, but we avoid one less
> > render target switch because we apply the transformation while drawing
> > to the dst device, vs. transforming into another temporary layer and
> > then drawing that to the dst device.
> >
> > Several important changes in behavior here:
> > 1. The DeviceCM record no longer has a stashed matrix to restore and
> >    holds its restoration paint directly.
> > 2. Devices for image filter inputs can now have device-to-global
> >    transforms that are not integer translates.
> > 3. The MatrixTransform hack punted when there was perspective because it
> >    could produce excessively large temporary images, but the new version
> >    appears to work around that. We now impose a maximum layer size to
> >    protect against that and automatically scale the layer to prevent it.
> >    Perspective image filters otherwise now draw correctly.
> > 6. Updated layer sizing code to use the new image filter APIs
> > 7. Updated backdrop filter and restore filters to go through the same
> >    code paths, although restore filters skip the intermediate image
> >    transform.
> >     - layer bounds and transforms now go through the updated skif API
> >       and is hopefully more straight forward to understand.
> > 8. Now we can optimize root color filter nodes of a filter DAG, even if
> >    the entire DAG can't be represented as a color filter. The last node
> >    is pulled off and composed with the restoration paint instead.
> >
> > Bug: skia:9074,skia:9283
> > Change-Id: I1fa1d50135b9d6d453b02f89aa3cc3b54deab678
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328376
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,fmalita@google.com,reed@google.com,michaelludwig@google.com
>
> Change-Id: I098d0e4b8ee067b436400eb9fea047e629544eec
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:9074
> Bug: skia:9283
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332737
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=djsollen@google.com,bsalomon@google.com,robertphillips@google.com,fmalita@google.com,reed@google.com,michaelludwig@google.com

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

Bug: skia:9074
Bug: skia:9283
Change-Id: Ifd5fed708d05a64ddccbd096fbf29896a44ef9f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333123
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-10 19:04:39 +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
Brian Osman
b06301ee12 Reland "Rearrange SkSL pre-include modules to hide things"
This reverts commit 4cb5c5e172, and fixes
the Chromium issue by declaring sign(x) in sksl_public.sksl.

Original description:

This makes numerous internal and GLSL types or intrinsics hidden from
public (runtime effect) SkSL. In particular:

- Only core numeric types are visible to all program types. GLSL types
  involving images, textures, and sampling are restricted to internal use.
- sk_Caps is no longer visible to runtime effects.
- The set of intrinsics available to runtime effects is now a separate,
  curated list in sksl_public.sksl. It exactly matches the GLSL ES 1.00
  spec order.
- The blend intrinsics are no longer visible, which also fixes a bug.
  These are nice, but we're not going to offer them yet - they involve
  enums, which creates complications.

Bug: skia:10680
Bug: skia:10709
Bug: skia:10913

Cq-Include-Trybots: luci.chromium.try:linux-chromeos-rel,linux-rel
Change-Id: I42deeeccd725a9fe18314d091ce253404e3572e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332750
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-06 19:28:34 +00:00
Brian Osman
6a1763b983 Fix merge conflict in RELEASE_NOTES.txt
No-Try: true
Change-Id: Ief2f5af2d7ea827f772c5ee1c32bae761fc8d60b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332748
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-06 16:51:49 +00:00
Brian Osman
4cb5c5e172 Revert "Rearrange SkSL pre-include modules to hide things"
This reverts commit bea0dc67f4.

No-Try: true
Change-Id: I7b000de199dc23bd3719a4ee835b2a8d3c93fefd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332747
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-06 16:30:35 +00:00
Michael Ludwig
6cafdc069b Revert "Draw image filters directly under non-axis-aligned transforms"
This reverts commit f8f23b2030.

Reason for revert: b/172617382 is creating issues for Android's Webview

Original change's description:
> Draw image filters directly under non-axis-aligned transforms
>
> This removes hacking the canvas CTM and wrapping the paint's image
> filter in a special MatrixTransform that computed a post-transform
> instead of its documented pre-transform effect. Performance-wise, the
> computed layer sizes should be about the same, but we avoid one less
> render target switch because we apply the transformation while drawing
> to the dst device, vs. transforming into another temporary layer and
> then drawing that to the dst device.
>
> Several important changes in behavior here:
> 1. The DeviceCM record no longer has a stashed matrix to restore and
>    holds its restoration paint directly.
> 2. Devices for image filter inputs can now have device-to-global
>    transforms that are not integer translates.
> 3. The MatrixTransform hack punted when there was perspective because it
>    could produce excessively large temporary images, but the new version
>    appears to work around that. We now impose a maximum layer size to
>    protect against that and automatically scale the layer to prevent it.
>    Perspective image filters otherwise now draw correctly.
> 6. Updated layer sizing code to use the new image filter APIs
> 7. Updated backdrop filter and restore filters to go through the same
>    code paths, although restore filters skip the intermediate image
>    transform.
>     - layer bounds and transforms now go through the updated skif API
>       and is hopefully more straight forward to understand.
> 8. Now we can optimize root color filter nodes of a filter DAG, even if
>    the entire DAG can't be represented as a color filter. The last node
>    is pulled off and composed with the restoration paint instead.
>
> Bug: skia:9074,skia:9283
> Change-Id: I1fa1d50135b9d6d453b02f89aa3cc3b54deab678
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328376
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,fmalita@google.com,reed@google.com,michaelludwig@google.com

Change-Id: I098d0e4b8ee067b436400eb9fea047e629544eec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9074
Bug: skia:9283
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332737
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-06 14:06:42 +00:00
Brian Osman
bea0dc67f4 Rearrange SkSL pre-include modules to hide things
This makes numerous internal and GLSL types or intrinsics hidden from
public (runtime effect) SkSL. In particular:

- Only core numeric types are visible to all program types. GLSL types
  involving images, textures, and sampling are restricted to internal use.
- sk_Caps is no longer visible to runtime effects.
- The set of intrinsics available to runtime effects is now a separate,
  curated list in sksl_public.sksl. It exactly matches the GLSL ES 1.00
  spec order.
- The blend intrinsics are no longer visible, which also fixes a bug.
  These are nice, but we're not going to offer them yet - they involve
  enums, which creates complications.

Bug: skia:10680
Bug: skia:10709
Bug: skia:10913

Change-Id: I8fa1c94f6e4899f38530bb9cff33d147f6983ab3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332597
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-05 21:44:40 +00:00
Michael Ludwig
f8f23b2030 Draw image filters directly under non-axis-aligned transforms
This removes hacking the canvas CTM and wrapping the paint's image
filter in a special MatrixTransform that computed a post-transform
instead of its documented pre-transform effect. Performance-wise, the
computed layer sizes should be about the same, but we avoid one less
render target switch because we apply the transformation while drawing
to the dst device, vs. transforming into another temporary layer and
then drawing that to the dst device.

Several important changes in behavior here:
1. The DeviceCM record no longer has a stashed matrix to restore and
   holds its restoration paint directly.
2. Devices for image filter inputs can now have device-to-global
   transforms that are not integer translates.
3. The MatrixTransform hack punted when there was perspective because it
   could produce excessively large temporary images, but the new version
   appears to work around that. We now impose a maximum layer size to
   protect against that and automatically scale the layer to prevent it.
   Perspective image filters otherwise now draw correctly.
6. Updated layer sizing code to use the new image filter APIs
7. Updated backdrop filter and restore filters to go through the same
   code paths, although restore filters skip the intermediate image
   transform.
    - layer bounds and transforms now go through the updated skif API
      and is hopefully more straight forward to understand.
8. Now we can optimize root color filter nodes of a filter DAG, even if
   the entire DAG can't be represented as a color filter. The last node
   is pulled off and composed with the restoration paint instead.

Bug: skia:9074,skia:9283
Change-Id: I1fa1d50135b9d6d453b02f89aa3cc3b54deab678
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328376
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-11-05 20:46:15 +00:00
Vignesh Venkatasubramanian
eb7f960705 Reland "heif: Add AVIF type and AVIF sniffing"
Fix: Do not use std::optional.

Bug: b/141654151
Change-Id: I6237db0d55b1ea92f7be3588a2b648b9e6014e3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331878
Reviewed-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-11-05 15:25:52 +00:00
Brian Salomon
694ff17357 Revert "Revert changes to unbreak bots."
This reverts commit 49721c8437.

Reason for revert: fixed double usage of plane release context in
 YUVUtils.

Original change's description:
> Revert changes to unbreak bots.
>
> f01a9d9020
> is the culprit
>
>
> Revert "GrRefCntedCallback has Make function."
>
> This reverts commit b2c42140ea.
>
> Revert "Add SkImage::MakeFromYUVATexturesCopyToExternal"
>
> This reverts commit f01a9d9020.
>
> Bug: skia:10632
> Change-Id: Ief076f168b63ff8ca15b607163a13d5f52a733d2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331798
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Change-Id: I41cdfe0d5b8587f85fae0c804c059c0d6ff92800


Bug: skia:10632
Change-Id: I41cdfe0d5b8587f85fae0c804c059c0d6ff92800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331876
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-11-05 14:35:23 +00:00
Greg Daniel
007d97d699 Allow creating SkSurfaceCharacterizations directly for vk secondary CB context.
Bug: chromium:1144921
Change-Id: I9ca905eb9f2542aafbde25e0baa5430640277699
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331877
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-04 16:43:42 +00:00
Brian Salomon
49721c8437 Revert changes to unbreak bots.
f01a9d9020
is the culprit


Revert "GrRefCntedCallback has Make function."

This reverts commit b2c42140ea.

Revert "Add SkImage::MakeFromYUVATexturesCopyToExternal"

This reverts commit f01a9d9020.

Bug: skia:10632
Change-Id: Ief076f168b63ff8ca15b607163a13d5f52a733d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331798
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-11-03 18:52:45 +00:00
Brian Salomon
8b5d44b42a Revert "Reland "heif: Add AVIF type and AVIF sniffing""
This reverts commit 28eb592735.

Reason for revert: std::optional use is breaking bots, e.g.:
https://ci.chromium.org/raw/build/logs.chromium.org/skia/4fa8175011a1c411/+/annotations

Original change's description:
> Reland "heif: Add AVIF type and AVIF sniffing"
>
> This is a reland of 3ab5b73649
>
> Fix: Chromium does not use the heif decoder. So hide it behind
> an ifdef.
>
> Original change's description:
> > heif: Add AVIF type and AVIF sniffing
> >
> > AVIF is the image format based on the AV1 video codec. The
> > container for AVIF is very similar to that of HEIF. Add type
> > definitions for AVIF and sniffing code for detecting AVIF images.
> >
> > The underlying android platform's HEIF decoder implementation will
> > also support AVIF decoding.
> >
> > Bug: b/141654151
> > Change-Id: I7e31f4cedf0bffb8920ddf880a26601e48d0e833
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330059
> > Reviewed-by: Leon Scroggins <scroggo@google.com>
> > Reviewed-by: Derek Sollenberger <djsollen@google.com>
> > Reviewed-by: Chong Zhang <chz@google.com>
> > Commit-Queue: Leon Scroggins <scroggo@google.com>
>
> Bug: b/141654151
> Change-Id: Ie6840d6fc97789be619924fc60df8683cd58430f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331496
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>

TBR=djsollen@google.com,scroggo@google.com,chz@google.com,vigneshv@google.com

Change-Id: I25df9f65b9d56d81be70a5fa650c3d841bd5a15e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/141654151
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331800
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-11-03 18:42:49 +00:00
Vignesh Venkatasubramanian
28eb592735 Reland "heif: Add AVIF type and AVIF sniffing"
This is a reland of 3ab5b73649

Fix: Chromium does not use the heif decoder. So hide it behind
an ifdef.

Original change's description:
> heif: Add AVIF type and AVIF sniffing
>
> AVIF is the image format based on the AV1 video codec. The
> container for AVIF is very similar to that of HEIF. Add type
> definitions for AVIF and sniffing code for detecting AVIF images.
>
> The underlying android platform's HEIF decoder implementation will
> also support AVIF decoding.
>
> Bug: b/141654151
> Change-Id: I7e31f4cedf0bffb8920ddf880a26601e48d0e833
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330059
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Chong Zhang <chz@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>

Bug: b/141654151
Change-Id: Ie6840d6fc97789be619924fc60df8683cd58430f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331496
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-11-03 17:50:42 +00:00
Brian Salomon
f01a9d9020 Add SkImage::MakeFromYUVATexturesCopyToExternal
Updated API for creating a RGBA texture-backed image from RGBA texture
planes with user-provided backing store using GrYUVABackendTextures.

Ultimately we would like to remove all such APIs and have the client
make a SkSurface and draw a YUVA texture image to the surface but
a recent attempt to do that in Chrome caused a not yet understood
perf regression.

Add wacky_yuv_formats variation that tests new api.

Bug: skia:10632
Change-Id: I89411216948682f13281a91a7575d5f345badda7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329956
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-03 15:03:21 +00:00
John Stiles
ebb26e30f2 Revert "heif: Add AVIF type and AVIF sniffing"
This reverts commit 3ab5b73649.

Reason for revert: <optional> header is C++17 only

Original change's description:
> heif: Add AVIF type and AVIF sniffing
>
> AVIF is the image format based on the AV1 video codec. The
> container for AVIF is very similar to that of HEIF. Add type
> definitions for AVIF and sniffing code for detecting AVIF images.
>
> The underlying android platform's HEIF decoder implementation will
> also support AVIF decoding.
>
> Bug: b/141654151
> Change-Id: I7e31f4cedf0bffb8920ddf880a26601e48d0e833
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330059
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Chong Zhang <chz@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>

TBR=djsollen@google.com,scroggo@google.com,chz@google.com,vigneshv@google.com

Change-Id: I9c9cd00af1a41bffa37725f39afc9bc0e504d616
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/141654151
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331336
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-11-02 16:08:03 +00:00
Vignesh Venkatasubramanian
3ab5b73649 heif: Add AVIF type and AVIF sniffing
AVIF is the image format based on the AV1 video codec. The
container for AVIF is very similar to that of HEIF. Add type
definitions for AVIF and sniffing code for detecting AVIF images.

The underlying android platform's HEIF decoder implementation will
also support AVIF decoding.

Bug: b/141654151
Change-Id: I7e31f4cedf0bffb8920ddf880a26601e48d0e833
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330059
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Chong Zhang <chz@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-11-02 15:28:21 +00:00
Ben Wagner
9abf719e67 Remove code guarded by SK_LEGACY_SURFACE_PROPS.
This removes the last of the SkFontHost LCD globals and the
SkSurfaceProps::kLegacyFontHost_InitType.

Bug: skia:3934
Change-Id: Ic2342a3ea3dbcd075d6817cbd3fc27274e376b8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329364
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-10-23 22:41:36 +00:00
Brian Salomon
9f8ee0dbb1 Remove legacy SkImageGenerator YUV planes interface
Bug: skia:10632
Change-Id: Iaed6b51e03ef9023a74d77f3262104c1677c416f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327917
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-20 13:44:11 +00:00
Brian Salomon
c1a249d1dc Revert "Revert "New variant of SkImage::MakeFromYUVATextures.""
This reverts commit be8004d2fb.

Bug: skia:10632
Change-Id: I52dd36ae167623563c7554c40092442a3822ee3c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327760
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-10-19 15:37:29 +00:00
kylechar
97a1e67c45 Add context option to disable mipmap support
This is desired for a short term memory improvement on low memory
devices.

Bug: chromium:1138979
Change-Id: I7df41a9c4d21b7a7f62b738e6358b36dd262f77d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327345
Commit-Queue: Kyle Charbonneau <kylechar@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-10-19 14:50:59 +00:00
Brian Salomon
be8004d2fb Revert "New variant of SkImage::MakeFromYUVATextures."
This reverts commit fea12238ed.

Reason for revert: MSAN/SwiftShader failure

Original change's description:
> New variant of SkImage::MakeFromYUVATextures.
>
> Takes a new type GrYUVATextures. This a set of GrBackendTextures and
> SkYUVAInfo that have been pre-validated to be compatible.
>
> Bug: skia:10632
>
> Change-Id: Id252f8662ede0f268e88fd40dc1b0b8f4ab6345f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317762
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I5350d4f9b1eda0503fb0af9db8575a734bdc811f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327922
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-10-16 22:32:54 +00:00
Brian Salomon
fea12238ed New variant of SkImage::MakeFromYUVATextures.
Takes a new type GrYUVATextures. This a set of GrBackendTextures and
SkYUVAInfo that have been pre-validated to be compatible.

Bug: skia:10632

Change-Id: Id252f8662ede0f268e88fd40dc1b0b8f4ab6345f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317762
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-16 21:03:31 +00:00
Mike Klein
8aa0edfed2 move SkTPin to include/private
Change-Id: Ib0dc823d331a7cddc5da1d1be83136ce803a7871
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327783
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-10-16 19:45:11 +00:00
Michael Ludwig
01b93eabe2 Add SkImageFilters::Blend rename for Xfermode filter
This better matches SkShaders::Blend and SkColorFilters::Blend factories.

Bug: skia:9310
Change-Id: I02a3fe488a446b803df96518caacff1fdf536e9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324623
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-10-13 14:28:26 +00:00
Michael Ludwig
c98d5b6250 Expand image filter factories to accept more types for crop rects
The original SkIRect* crop rect argument was a little too onerous.
First, as a pointer, it required you to declare your crop rect separately
just to take a pointer to it. Now, you can pass an SkIRect or SkRect in
directly when you are explicitly constructing a cropped filter.

Second, the crop rect is transformed by the same matrix as the other
filter parameters, so it can be scaled and translated. Allowing SkRect
instead of just SkIRect gives more precision and flexibility for local
coordinate systems. Now a crop rect could be defined to be from [-.5, .5]
and still map to real pixels after transformation (this was a request
from the skia-discuss mailing list, and also better matches the SVG spec).

The crop rect argument was always meant to be a convenience, since I
plan to refactor cropping into an indenendent image filter that will
give more explicit control over when the crop is applied in the DAG.
To maintain the convenience for the factories, the constructors of
the new CropRect type are not explicit so that callers don't ever need
to concern themselves with it.

Bug: skia:9296
Change-Id: I29a684cb925f1fca4dabc803114ab2b125660aaa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324622
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-10-12 20:25:43 +00:00
Michael Ludwig
7d0f853158 Add SkImageFilters::Shader in place of Paint factory
SkImageFilters::Paint did not use every slot of the SkPaint, with only
its color, alpha, color filter, and shader having a meaningful effect on
the image filter result. It was always blended into a transparent dst,
so blend mode wasn't very relevant, and it was always filled to whatever
required geometry, so stroke style, path effect, and mask filters were
ignored or not well specified.

Color, alpha, and color filter can all be combined into an SkShader, so
a more constrained SkImageFilters::Shader provides the same useful
capabilities without as many surprises.

SkImageFilters::Paint still exists, but is deprecated to be removed
once I've confirmed clients aren't depending on it.

Bug: skia:9310
Change-Id: I11a82bda1a5d440726cf4e2b5bfaae4929568679
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323680
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-10-08 22:51:13 +00:00
Adlai Holler
0ce2c54094 Reland "Reland "Take GrContext private, GrDDLContext inherit from GrRecordingContext""
This reverts commit cf43fc6768.

Reason for revert: Fixed g3

Original change's description:
> Revert "Reland "Take GrContext private, GrDDLContext inherit from GrRecordingContext""
>
> This reverts commit ff13ffbeac.
>
> Reason for revert: Blink in g3
>
> Original change's description:
> > Reland "Take GrContext private, GrDDLContext inherit from GrRecordingContext"
> >
> > This reverts commit 89bdc90ac8.
> >
> > Reason for revert: Fix metal
> >
> > Original change's description:
> > > Revert "Take GrContext private, GrDDLContext inherit from GrRecordingContext"
> > >
> > > This reverts commit d2daa94ede.
> > >
> > > Reason for revert: Metaru
> > >
> > > Original change's description:
> > > > Take GrContext private, GrDDLContext inherit from GrRecordingContext
> > > >
> > > > Woo!
> > > >
> > > > Change-Id: I8d201b709343dc18cad31ea740575285dd035f35
> > > > Docs-Preview: https://skia.org/?cl=317436
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317436
> > > > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > Commit-Queue: Adlai Holler <adlai@google.com>
> > >
> > > TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
> > >
> > > Change-Id: I9b58dee285fbdc49ebc8e76df5da0fe224cf9787
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318758
> > > Reviewed-by: Adlai Holler <adlai@google.com>
> > > Commit-Queue: Adlai Holler <adlai@google.com>
> >
> > TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
> >
> >
> > Change-Id: Id4b10795193a904cd4ed8c36e60e74abe3b6702a
> > Docs-Preview: https://skia.org/?cl=318759
> > Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac10.15.5-Clang-arm64-Debug-iOS_Metal,Build-Mac-Clang-x86_64-Debug-Metal
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318759
> > Commit-Queue: Adlai Holler <adlai@google.com>
> > Reviewed-by: Adlai Holler <adlai@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
>
> Change-Id: Ib20fe933120d56b72efaec73a0bedec60bc28def
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319184
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Adlai Holler <adlai@google.com>

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


Change-Id: I4f01291f4b3bfbb8fd7dd8cf2bf8415430c3392e
Docs-Preview: https://skia.org/?cl=322437
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322437
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-10-06 18:59:11 +00:00
Brian Salomon
72c7b98ae3 Start removal of tool usage of SkSurface::MakeFromBackendTextureAsRenderTarget.
Adds a new helper that creates a GrBackendRenderTarget using
GrGpu and then wraps it in a SkSurface. Uses the SkSurface
release proc to delete the BERT using GrGpu.

Upgrades GrGpu::createTestingOnlyBackendRenderTarget to create MSAA
buffers.

Updates many tests/tool to call sites to use the helper instead of
SkSurface::MakeFromBackendTextureAsRenderTarget.

Adds syncToCpu bool to SkSurface:: and GrContext::flushAndSubmit.

Bug: skia:9832

Change-Id: I73a8f0ce09dc6523729af0814464c6b6657fda06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293683
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-10-06 16:32:11 +00:00
Brian Salomon
f165f799ae Remove unused variant of SkImage::MakeFromYUVAPixmaps
Bug: skia:10632
Change-Id: I337d79d856945071b2b68651a80013184d443267
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322480
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-10-05 18:08:28 +00:00
Brian Salomon
86d07fd01c Remove unused SkImage YUVA factories.
Bug: skia:10632
Change-Id: Icb27e44d234063ab049fef95587f474323d7ada9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321537
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-10-02 19:35:34 +00:00
Greg Daniel
36366209d4 Require stencil bits on wrapped GrBackendRenderTargets to 0, 8, or 16.
This will allow us in a follow on change to put in a "fake" gl stencil
format for the wrapped FBO.

Bug: skia:10727
Change-Id: Iba1eca5114b34d25e6a220591d28a20f7b36b12b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321545
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-10-02 16:15:44 +00:00
Heather Miller
93f22bc46b Update release notes for M87 branch cut, M88 begin
Bug: skia:
Change-Id: Id4cc2f42389dac1e087026fee5c0df0eff4e89c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321776
Reviewed-by: Heather Miller <hcm@google.com>
Auto-Submit: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
2020-10-02 14:36:34 +00:00
Brian Salomon
8e0aa441a5 Get GrBackendRenderTarget's sample count from MtlTexture.
Instead of being passed separately.

Check sample count in various onWrap methods in GrMtlGpu.

Bug: skia:9832


Cq-Include-Trybots: luci.skia.skia.primary:Test-iOS-Clang-iPhone8-GPU-AppleA11-arm64-Release-All-Metal,Test-iOS-Clang-iPhone7-GPU-PowerVRGT7600-arm64-Release-All-Metal,Test-iOS-Clang-iPadPro-GPU-PowerVRGT7800-arm64-Release-All-Metal,Test-iOS-Clang-iPhone11-GPU-AppleA13-arm64-Release-All-Metal,Test-iOS-Clang-iPhone6-GPU-PowerVRGX6450-arm64-Release-All-Metal,Test-Mac10.15-Clang-MacBookAir7.2-GPU-IntelHD6000-x86_64-Release-All-Metal
Change-Id: If5813db95b07f5d272e80920486f461cc5a587fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320956
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-09-30 20:40:33 +00:00
Brian Salomon
718ae76d5b Add sample count field to GrD3DTextureResourceInfo.
Remove separate constructor arg from GrBackendRenderTarget.

Add appropriate checks in onWrap functions in GrD3DGpu to limit to
previous functionality.

Bug: skia:9832

Cq-Include-Trybots: luci.skia.skia.primary:Test-Win10-MSVC-Golo-GPU-QuadroP400-x86_64-Debug-All-Direct3D,Test-Win10-Clang-ShuttleA-GPU-RadeonHD7770-x86_64-Debug-All-Direct3D
Change-Id: Ieba398d4bc00d18fdb0adffcda81f1a166db24b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320757
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-09-30 14:03:39 +00:00
Brian Salomon
57fd923c20 Add sample count to GrVkImageInfo.
Pre-req for allowing rendering to an externally created MSSA VkImage.


Bug: skia:9832

Cq-Include-Trybots: luci.skia.skia.primary:Test-Debian10-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All-Vulkan,Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Release-All-Vulkan,Test-Win10-Clang-ShuttleA-GPU-RadeonHD7770-x86_64-Release-All-Vulkan,Test-Android-Clang-GalaxyS9-GPU-MaliG72-arm64-Release-All-Android_Vulkan,Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Release-All-Android_Vulkan,Test-Android-Clang-GalaxyS20-GPU-MaliG77-arm64-Release-All-Android_Vulkan,Test-Android-Clang-Pixel4XL-GPU-Adreno640-arm64-Release-All-Android_Vulkan,Test-Android-Clang-P30-GPU-MaliG76-arm64-Release-All-Android_Vulkan
Change-Id: Ibf41944c6946dda7e27bdcd509ecd04976fc9ade
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320262
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-09-29 18:36:58 +00:00
Jim Van Verth
c2d10ef667 Add deprecation warning when running Metal on older OSes.
Older versions of MacOS are unstable when compiling shaders, and we
don't have the testing support for older versions of iOS.

Bug: skia:10777
Change-Id: I95d9fe0f1007af6bec5c7525dacda565e32989f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320260
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-09-28 20:14:43 +00:00
Michael Ludwig
e5d5eedd2d Update SkClipOp::kMax_EnumValue to match non-deprecated values
Even when expanding clip ops were disabled, the max value allowed the
fuzzer to produce those disabled values. This should fix the fuzzer to
only produce valid intersect or difference clip ops.

Bug: chromium:1132687
Change-Id: I7368ff36a00e6b0e87ecbae5ba647d249299b9ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320064
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-09-28 15:30:33 +00:00
Jim Van Verth
1b89eb742a Add AMD allocator to D3D12 backend.
Adds base class GrD3DAlloc and GrD3DMemoryAllocator, and a reference
to a GrD3DMemoryAllocator in GrBackendContext and a reference to a
GrD3DAlloc in GrD3DTextureResourceInfo. Internally, we override this
base class to define the AMD memory allocator.

Change-Id: I033924b0247ea330969b1398f25985e7a84aec11
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317243
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-09-23 21:22:52 +00:00
Greg Daniel
1d3c8c1a8b Add optional param to setBackendTextureState to return previous state.
Bug: skia:10742
Change-Id: I334e7896d0a1509eb666c46d5731d2573a5c1aba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318698
Reviewed-by: Austin Eng <enga@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-09-23 19:54:59 +00:00
Jim Van Verth
5fba9ae0cb Revert "Reland "Use Microsoft's ComPtr to wrap D3D12 objects.""
This reverts commit b8ae7fa12a.

Reason for revert: Introduced a memory leak

Original change's description:
> Reland "Use Microsoft's ComPtr to wrap D3D12 objects."
> 
> This is a reland of 0ef049177f
> 
> Original change's description:
> > Use Microsoft's ComPtr to wrap D3D12 objects.
> > 
> > Change-Id: I4bd173428a2b65f0bc1994fb794ef9d4d68d5ba0
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314957
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Jim Van Verth <jvanverth@google.com>
> 
> Change-Id: Id0199db4061c67ed53da35e74dc31a004744be95
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315655
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

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

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

Change-Id: I3f8744668558f6b8f4f367eeeeff2f6aa2c36992
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318209
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-09-21 22:02:12 +00:00
Brian Salomon
94f65d784c Expand SkYUVAInfo::PlanarConfig/SkYUVAPixmapInfo::DataType values.
Now supports all plane configurations tested by WackyYUVFormatsGM.

Added WackyYUVFormatsGM that tests YUVA interface on SkImageGenerator.


Change-Id: I8326f098f1453b9702f04ff366431a516ca160c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317097
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-18 20:43:12 +00:00
Michael Ludwig
395ddc3d51 Reland "Enable novel GrClipStack on bots, disable elsewhere"
This reverts commit f6e0f58b2e.

Reason for revert: benches and tests updated here: https://skia-review.googlesource.com/c/skia/+/317380

Original change's description:
> Revert "Enable novel GrClipStack on bots, disable elsewhere"
> 
> This reverts commit e1ade2ac4a.
> 
> Reason for revert: Need to remove benchmarks that use deprecated SkClipOps first.
> 
> Original change's description:
> > Enable novel GrClipStack on bots, disable elsewhere
> > 
> > As a result of this change, the new GrClipStack will run on all of our
> > default bots. However, the SK_DISABLE_NEW_GR_CLICK_STACK define is used
> > to explicitly disable the clip stack when we build for the Android
> > Framework, Google3, Flutter, and Fuchsia. These projects can have staging
> > controlled from within the skia repo. This CL in chromium also disables
> > the new clip stack: https://chromium-review.googlesource.com/c/chromium/src/+/2412768
> > and must land before this CL does in Skia.
> > 
> > When GrClipStack originally landed, I had it disabled by checking the
> > value of the define SK_USE_NEW_GR_CLICK_STACK for 0 or 1. To be a little
> > simpler, and work with the flutter and fuchsia gn defines, this CL
> > switches GrClipStack control over to SK_DISABLE_NEW_GR_CLICK_STACK and
> > it just checks for whether or not it's defined.
> > 
> > Bug: skia:10205
> > Change-Id: I6b8bd18290844c02839fe99fdf629b48ffd86f27
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317209
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> 
> Change-Id: I14fddccfdea8e91ebad92e55193b0034f8bb28af
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10205
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317377
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

# Not skipping CQ checks because this is a reland.

Bug: skia:10205
Change-Id: I1f26496437ed04a79e9c1058428cdc867ae3be39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317385
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-09-16 19:30:17 +00:00
Michael Ludwig
f6e0f58b2e Revert "Enable novel GrClipStack on bots, disable elsewhere"
This reverts commit e1ade2ac4a.

Reason for revert: Need to remove benchmarks that use deprecated SkClipOps first.

Original change's description:
> Enable novel GrClipStack on bots, disable elsewhere
> 
> As a result of this change, the new GrClipStack will run on all of our
> default bots. However, the SK_DISABLE_NEW_GR_CLICK_STACK define is used
> to explicitly disable the clip stack when we build for the Android
> Framework, Google3, Flutter, and Fuchsia. These projects can have staging
> controlled from within the skia repo. This CL in chromium also disables
> the new clip stack: https://chromium-review.googlesource.com/c/chromium/src/+/2412768
> and must land before this CL does in Skia.
> 
> When GrClipStack originally landed, I had it disabled by checking the
> value of the define SK_USE_NEW_GR_CLICK_STACK for 0 or 1. To be a little
> simpler, and work with the flutter and fuchsia gn defines, this CL
> switches GrClipStack control over to SK_DISABLE_NEW_GR_CLICK_STACK and
> it just checks for whether or not it's defined.
> 
> Bug: skia:10205
> Change-Id: I6b8bd18290844c02839fe99fdf629b48ffd86f27
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317209
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: I14fddccfdea8e91ebad92e55193b0034f8bb28af
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10205
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317377
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-09-16 16:55:49 +00:00
Michael Ludwig
e1ade2ac4a Enable novel GrClipStack on bots, disable elsewhere
As a result of this change, the new GrClipStack will run on all of our
default bots. However, the SK_DISABLE_NEW_GR_CLICK_STACK define is used
to explicitly disable the clip stack when we build for the Android
Framework, Google3, Flutter, and Fuchsia. These projects can have staging
controlled from within the skia repo. This CL in chromium also disables
the new clip stack: https://chromium-review.googlesource.com/c/chromium/src/+/2412768
and must land before this CL does in Skia.

When GrClipStack originally landed, I had it disabled by checking the
value of the define SK_USE_NEW_GR_CLICK_STACK for 0 or 1. To be a little
simpler, and work with the flutter and fuchsia gn defines, this CL
switches GrClipStack control over to SK_DISABLE_NEW_GR_CLICK_STACK and
it just checks for whether or not it's defined.

Bug: skia:10205
Change-Id: I6b8bd18290844c02839fe99fdf629b48ffd86f27
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317209
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-09-16 16:24:57 +00:00
Brian Salomon
c2a9a9716e New version of SkImage::MakeFromYUVAPixmaps()
Takes SkYUVAPixmaps. Still implemented in terms of SkYUVAIndex[4]
internally.

Replace all internal use cases except wacky_yuv_formats.

Takes GrRecordingContext rather than GrContext.

SkVideoDecoder updated to take GrRecordingContext.

Bug: skia:10632

Change-Id: I6e9b9b6a4f11333bce6f87c1ebff0acb297f6540
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316837
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-15 16:13:50 +00:00
Jim Van Verth
b8ae7fa12a Reland "Use Microsoft's ComPtr to wrap D3D12 objects."
This is a reland of 0ef049177f

Original change's description:
> Use Microsoft's ComPtr to wrap D3D12 objects.
> 
> Change-Id: I4bd173428a2b65f0bc1994fb794ef9d4d68d5ba0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314957
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

Change-Id: Id0199db4061c67ed53da35e74dc31a004744be95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315655
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-09-08 22:04:05 +00:00
Jim Van Verth
bbbc28e0ba Revert "Use Microsoft's ComPtr to wrap D3D12 objects."
This reverts commit 0ef049177f.

Reason for revert: Looks like this is introducing a memory leak.

Original change's description:
> Use Microsoft's ComPtr to wrap D3D12 objects.
> 
> Change-Id: I4bd173428a2b65f0bc1994fb794ef9d4d68d5ba0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314957
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

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

Change-Id: Ib0333c00a7f8c3650bd2b077cbdfb6926c5870f4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315653
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-09-08 19:09:24 +00:00