Commit Graph

10752 Commits

Author SHA1 Message Date
Robert Phillips
10089c6a42 Revert "Remove legacy SkImage::MakeFromYUVATextures."
This reverts commit df29db4c41.

Reason for revert: blocking the G3 roll

Original change's description:
> Remove legacy SkImage::MakeFromYUVATextures.
>
> Bug: skia:10632
> Change-Id: Iad8989e0ae5aa6921e8e2e27ba375221f2af0262
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336959
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Id77c1679a96ad9c1be93e6e29449cc4785a3983b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337183
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-20 21:51:40 +00:00
Michael Ludwig
6c1191d749 Revert "Simplify layer bounds syncing and no-device error handling in SkCanvas::internalSaveLayer"
This reverts commit b27ba538ec.

Reason for revert: causes invalid memory accesses due to replaceClip use, and replaceClip() is probably not the right operation to use
to emulate a layer when no layer was the strategy or failed to allocate.

Original change's description:
> Simplify layer bounds syncing and no-device error handling in SkCanvas::internalSaveLayer
>
> This corrects some subtle bugs that can occur with recording canvas or
> if a device fails to be created for a new layer, where the stashed
> matrix would not be restored properly. Since no new DeviceCM would get
> added in those cases, the canvas' total matrix wouldn't get fixed in the
> paired onRestore() and it would remain dirty for the remainder of the
> canvas's lifetime.
>
> After this change, the underlying SkDevice's bounds are also kept in
> sync with the intent of the saveLayer when kNoLayer_Strategy is used.
> Previously, the bounds would be applied to the canvas' conservative clip
> and quick reject bounds, but the device would remain un-updated. As we
> move towards SkNoPixelsDevice taking over the conservative clip bounds,
> this ensures bounds remain up to date within a saveLayer/restore pair
> even if no layer was allocated.
>
> Change-Id: I5ca389bdd624ea7278106da863a96e9d8f90e2d1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335861
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=mtklein@google.com,bsalomon@google.com,reed@google.com,michaelludwig@google.com

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1151195, chromium:1151270, chromium:1151294, chromium:1151320, chromium:1151322
Change-Id: I9db07916ffc450cc6ecc9188d72bb7c35770a974
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337117
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-20 17:10:58 +00:00
Brian Salomon
df29db4c41 Remove legacy SkImage::MakeFromYUVATextures.
Bug: skia:10632
Change-Id: Iad8989e0ae5aa6921e8e2e27ba375221f2af0262
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336959
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-20 16:48:16 +00:00
Michael Ludwig
b27ba538ec Simplify layer bounds syncing and no-device error handling in SkCanvas::internalSaveLayer
This corrects some subtle bugs that can occur with recording canvas or
if a device fails to be created for a new layer, where the stashed
matrix would not be restored properly. Since no new DeviceCM would get
added in those cases, the canvas' total matrix wouldn't get fixed in the
paired onRestore() and it would remain dirty for the remainder of the
canvas's lifetime.

After this change, the underlying SkDevice's bounds are also kept in
sync with the intent of the saveLayer when kNoLayer_Strategy is used.
Previously, the bounds would be applied to the canvas' conservative clip
and quick reject bounds, but the device would remain un-updated. As we
move towards SkNoPixelsDevice taking over the conservative clip bounds,
this ensures bounds remain up to date within a saveLayer/restore pair
even if no layer was allocated.

Change-Id: I5ca389bdd624ea7278106da863a96e9d8f90e2d1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335861
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-19 21:24:40 +00:00
Jim Van Verth
9e64047a04 Add MTLBinaryArchive support to iOS Metal build
Change-Id: I7a4f58e4fc1fc18c42de372dd480e0681000e2f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333758
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-11-19 20:00:30 +00:00
Michael Ludwig
466e7e88d3 Hide SkCanvas::AutoValidateClip in cpp file
Bug: skia:9283
Change-Id: I1f808ec9d004f228b17a139dff7a2f44676baf50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335856
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-11-18 20:56:15 +00:00
Michael Ludwig
5013d957f3 Rename fDeviceClipBounds to fQuickRejectBounds
This better differentiates it from device clip bounds, and the fact that
the stored bounds have been outset by 1 to account for AA, and are only
used for quick reject purposes.

Bug: skia:9283
Change-Id: I47420f23b74e47626596f978c78f01d7d97ae808
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335828
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-11-18 20:37:55 +00:00
Brian Salomon
94584f4574 Remove unused macros from GrGLConfig.h, GrGLConfig_chrome.h, and scripts
Change-Id: I5a9e7d490fd71f326ac37a72eb942fc64f557733
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335666
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-11-18 20:23:35 +00:00
Herb Derby
90f211f46b calculate glyph offset using (0,0) mapping
This code has rotted a bit. The glyph off set is now calculated
by mapping (0,0) through the current matrix, and the initial
matrix, and taking the vector difference. Residual is no longer
needed and all the plumbing can be removed.

Change-Id: I20b56afc6749fd26fe283a7ff22f38951da0e6f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335823
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-11-18 17:18:45 +00:00
Brian Salomon
fcc4e85f3c Remove SkYUVAInfo::PlanarConfig
Bug: skia:10632
Change-Id: I72b4379c82fd7dc4c7169387014f8fffbb86e23f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334161
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-11-18 14:26:14 +00:00
Brian Salomon
98e17bf01a Remove deprecated DDL promise texture image factories.
Bug: skia:10632
Change-Id: I218281256ea5ab4a5a5a7ea7bf209350082f8dc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335038
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-17 17:28:23 +00:00
Ben Wagner
c634fc4a66 Remove FCLocker::Suspend.
It's a bad idea, difficult to reason about, and may be causing
deadlocks.

Change-Id: Id9749661f4f3f942ee983e9c1fdab2bd7f287edb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335242
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-11-17 17:11:03 +00:00
Leon Scroggins
da3d8c2471 Reland "SkAnimatedImage: Use fSampleSize"
This is a reland of 4fdf9f9ce5

No change from the original, which was just reverted to be able to
cleanly revert its parent, which has now been relanded with a fix.

Original change's description:
> SkAnimatedImage: Use fSampleSize
>
> Bug: b/163595585
>
> This will allow using less memory when decoding an animated GIF by
> sampling at decode time. This is tested by the animated_image GMs.
>
> Change-Id: I748b2180827623e4ca1fc0fd4d6dd02733b3b5f2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333226
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

Bug: b/163595585
Change-Id: I3249bd04b64750a50a4c5c787db3e80ac4d85e67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335279
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-11-17 14:07:03 +00:00
Robert Phillips
b7c1310834 Revert "Remove SkBaseDevice::flush"
This reverts commit 971b19d0c6.

Reason for revert: See if this CL was causing the Perf-Win10-Clang-ShuttleA-GPU-GTX660-x86_64-Release-All issue

Original change's description:
> Remove SkBaseDevice::flush
>
> Another small step in removing SkCanvas::flush
>
> Change-Id: I6f17edcd1996e1009dad7cc96a97be3b0c4664f4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334417
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I0b9116f8ce4eed3a0d49ccf1cc55d8d89675617e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335216
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-16 18:46:19 +00:00
Leon Scroggins
1340dbde91 Reland "SkAndroidCodec: Support decoding all frames"
This is a reland of fc4fdc5b25

Original change's description:
> SkAndroidCodec: Support decoding all frames
>
> Bug: b/160984428
> Bug: b/163595585
>
> Add support to SkAndroidCodec for decoding all frames with an
> fSampleSize, so that an entire animation can be decoded to a smaller
> size.
>
> dm/:
> - Test scaled + animated decodes
>
> SkAndroidCodec:
> - Make AndroidOptions inherit from SkCodec::Options. This allows
>   SkAndroidCodec to use fFrameIndex. (It also combines the two versions
>   of fSubset, which is now const for both.)
> - Respect fFrameIndex, and call SkCodec::handleFrameIndex to decode
>   the required frame.
> - Disallow decoding with kRespect + fFrameIndex > 0 if there is a
>   non-default orientation. As currently written (except without
>   disabling this combination), SkPixmapPriv::Orient would draw the new
>   portion of the frame on top of uninitialized pixels, instead of the
>   prior frame. This could be fixed by
>   - If SkAndroidCodec needs to decode the required frame, it could do so
>     without applying the orientation, then decode fFrameIndex, and then
>     apply the orientation.
>   - If the client provided the required frame, SkAndroidCodec would need
>     to un-apply the orientation to get the proper starting state, then
>     decode and apply.
>   I think it is simpler to force the client to handle the orientation
>   externally.
>
> SkCodec:
> - Allow SkAndroidCodec to call its private method handleFrameIndex. This
>   method handles decoding a required frame, if necessary. When called by
>   SkAndroidCodec, it now uses the SkAndroidCodec to check for/decode the
>   required frame, so that it will scale properly.
> - Call rewindIfNeeded inside handleFrameIndex. handleFrameIndex calls a
>   virtual method which may set some state (e.g. in SkJpegCodec). Without
>   this change, that state would be reset by rewindIfNeeded.
> - Simplify handling a kRestoreBGColor frame. Whether provided or not,
>   take the same path to calling zero_rect.
> - Updates to zero_rect:
>   - Intersect after scaling, which will also check for empty.
>   - Round out instead of in - this ensures we don't under-erase
>   - Use kFill_ScaleToFit, which better matches the intent.
>
> Change-Id: Ibe1951980a0dca8f5b7b1f20192432d395681683
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333225
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

Bug: b/160984428
Bug: b/163595585
Change-Id: I7c1e79e0f92c75b4840eef65c8fc2b8497189e81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334842
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-11-16 16:55:48 +00:00
Robert Phillips
971b19d0c6 Remove SkBaseDevice::flush
Another small step in removing SkCanvas::flush

Change-Id: I6f17edcd1996e1009dad7cc96a97be3b0c4664f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334417
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-16 15:26:06 +00:00
Brian Salomon
9f94f31cc0 Add convenience method SkYUVAInfo::makeSubsampling.
Will be used Chrome to convert subsampled info to k444.

Bug: skia:10632
Change-Id: Ife9bdf3a28aeb6db1de063539a8b1664bdcbdb5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334958
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
2020-11-16 14:28:34 +00:00
Michael Ludwig
4757a60871 Accept SkFilterQuality in SkImageFilters::Shader
This is needed to help ease the migration from SkImageFilters::Paint,
until image shaders always force you to embed sampling options.

Change-Id: Id8dc8c3196a7935073677a5fbb8d35c3bd22f9ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333757
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-13 22:46:20 +00:00
Mike Reed
cae335d5b1 Add temporary Make for SkSamplingOptions
To help stage clients away from SkFilterQuality

Change-Id: Icf9d192880caa16a82f9774cc99c97e096f8e678
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334162
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-13 20:12:53 +00:00
Brian Salomon
a29ed26cfc Remove unused copy-to-external YUV SkImage factories.
Also inline some helper functions into newer factory method
that are no longer shared.

Bug: skia:10632
Change-Id: I466c59f668d882802087acad1ec1f229505a3377
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334596
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-11-13 19:24:15 +00:00
Leon Scroggins III
267a8589d3 Revert "SkAndroidCodec: Support decoding all frames"
This reverts commit fc4fdc5b25.

Reason for revert: Google3 and ASAN failures

Change-Id: I890cd76109c0375391637f879550837d01e650f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334840
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-11-13 16:20:39 +00:00
Leon Scroggins
efd628a1a9 Revert "SkAnimatedImage: Use fSampleSize"
This reverts commit 4fdf9f9ce5.

Reason for revert: Google3 and ASAN failures caused by the prior
change, which this depends on.

Original change's description:
> SkAnimatedImage: Use fSampleSize
>
> Bug: b/163595585
>
> This will allow using less memory when decoding an animated GIF by
> sampling at decode time. This is tested by the animated_image GMs.
>
> Change-Id: I748b2180827623e4ca1fc0fd4d6dd02733b3b5f2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333226
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

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

Change-Id: I0d30ada4eba2302ce0c5f85b1174d0618ae0f589
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/163595585
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334839
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2020-11-13 15:28:00 +00:00
Leon Scroggins
4fdf9f9ce5 SkAnimatedImage: Use fSampleSize
Bug: b/163595585

This will allow using less memory when decoding an animated GIF by
sampling at decode time. This is tested by the animated_image GMs.

Change-Id: I748b2180827623e4ca1fc0fd4d6dd02733b3b5f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333226
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-11-12 22:30:51 +00:00
Leon Scroggins
fc4fdc5b25 SkAndroidCodec: Support decoding all frames
Bug: b/160984428
Bug: b/163595585

Add support to SkAndroidCodec for decoding all frames with an
fSampleSize, so that an entire animation can be decoded to a smaller
size.

dm/:
- Test scaled + animated decodes

SkAndroidCodec:
- Make AndroidOptions inherit from SkCodec::Options. This allows
  SkAndroidCodec to use fFrameIndex. (It also combines the two versions
  of fSubset, which is now const for both.)
- Respect fFrameIndex, and call SkCodec::handleFrameIndex to decode
  the required frame.
- Disallow decoding with kRespect + fFrameIndex > 0 if there is a
  non-default orientation. As currently written (except without
  disabling this combination), SkPixmapPriv::Orient would draw the new
  portion of the frame on top of uninitialized pixels, instead of the
  prior frame. This could be fixed by
  - If SkAndroidCodec needs to decode the required frame, it could do so
    without applying the orientation, then decode fFrameIndex, and then
    apply the orientation.
  - If the client provided the required frame, SkAndroidCodec would need
    to un-apply the orientation to get the proper starting state, then
    decode and apply.
  I think it is simpler to force the client to handle the orientation
  externally.

SkCodec:
- Allow SkAndroidCodec to call its private method handleFrameIndex. This
  method handles decoding a required frame, if necessary. When called by
  SkAndroidCodec, it now uses the SkAndroidCodec to check for/decode the
  required frame, so that it will scale properly.
- Call rewindIfNeeded inside handleFrameIndex. handleFrameIndex calls a
  virtual method which may set some state (e.g. in SkJpegCodec). Without
  this change, that state would be reset by rewindIfNeeded.
- Simplify handling a kRestoreBGColor frame. Whether provided or not,
  take the same path to calling zero_rect.
- Updates to zero_rect:
  - Intersect after scaling, which will also check for empty.
  - Round out instead of in - this ensures we don't under-erase
  - Use kFill_ScaleToFit, which better matches the intent.

Change-Id: Ibe1951980a0dca8f5b7b1f20192432d395681683
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333225
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-11-12 21:31:41 +00:00
Jim Van Verth
351c9b53d6 Switch to using GrMtlBackendContext for GrDirectContext creation.
Makes the Metal backend more consistent with the other backends,
and allows new init parameters to be added without significantly
changing API.

Added updated sk_cf_obj because I needed some of its functionality.

Bug: skia:10804
Change-Id: I6f1dd1c03ddc4c4b702ea75eff14bc0f98ab5ad2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334426
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-11-12 21:03:51 +00:00
Leon Scroggins
7d1153fc4c Handle EXIF orientation in SkAnimatedImage
Bug: skia:10914
Bug: b/163595585

In a WebP image, it is possible to combine animation with an EXIF
orientation. While SkAndroidCodec attempts to handle orientation itself
by decoding into temporary memory and then drawing through a matrix,
this doesn't work directly when compositing a P-frame into a prior
frame. SkAnimatedImage already uses an SkMatrix to handle cropping and
scaling, so update that matrix to include the orientation.

Make SkAnimatedImage a friend of SkAndroidCodec. This allows the former
to have the same ExifOrientationBehavior specified by the latter, and to
recreate the latter so it does not try to handle the orientation itself.

Clip SkAnimatedImage to its bounds. Android's AnimatedImageDrawable
performs its own clip, but this makes a crop rect work for other
clients.

Update getCurrentFrame to take cropping, scaling, and orientation into
account. This method is used by CanvasKit, which does not use cropping
or scaling, but will now properly orient an animation with an EXIF
orientation.

Add a GM that exercises the various combinations of ways SkAnimatedImage
can be used:
- via newPictureSnapshot (as in Android) versus getCurrentFrame
- scaling down to a dimension that can be output from the
  SkAndroidCodec, versus up, which SkAnimatedImage scales
- with a crop rect
- with a post processor

Change-Id: If1854e9aea23fc4afddf75d39132b38e3fbc6071
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333223
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-11-12 19:47:59 +00:00
Heather Miller
c6e3881888 Update Skia milestone to 89
Change-Id: I9de827fe1902a9a91898fcf70d82153a821500ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334418
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
2020-11-12 16:50:19 +00:00
Leon Scroggins
bc098ef6d4 Handle EXIF orientation in SkAnimCodecPlayer
Bug: skia:10914

SkAnimCodecPlayer:
- Properly handle orientation, whether the image is still or not
- Mark const methods as const
- Fix seek() so that if you seek to the duration of frame 0, it will
  show frame 1
- Fix the SkImageInfo so if the first frame is opaque, but following
  frames are not, those frames can still be decoded

resources:
- Rename "webp-animated.webp" to "stoplight.webp", which better
  describes the animation
  - Update test files accordingly
- Add "stoplight_h.webp", which is the same animation with an EXIF
  that converts it to a horizontal stoplight

AnimCodecPlayer test:
- Test the new image files
- Verify SkAnimCodecPlayer::dimensions behaves as expected
- Remove extra debugging line
- Provide better error messages

AnimCodecPlayerExifGM:
- Add a new GM that shows all frames of the new animation with an EXIF
  orientation
- Add a new GM that shows all frames of an animation with an opaque
  first frame followed by frames with alpha

Change-Id: I43cf91c16d52aa1901eef8e13e1e644eea6058b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332753
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-11-12 14:43:47 +00:00
Brian Salomon
e4387382c2 Split SkYUVAInfo::PlanarConfig into PlaneConfig and Subsampling enums
Sometimes it's helpful to think about subsampling separately from
how the channels are spread across planes.

Bug: skia:10632
Change-Id: Ib03f71195f9706ef6def418b1f2125c29e0cf738
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334102
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-11 22:42:36 +00:00
Leon Scroggins
70eba23828 Remove SkAnimatedImage::dimensions
The only caller is CanvasKit, and SkAnimatedImage already has getBounds
(from SkDrawable) which does the same thing, except it returns
SkScalars. It also takes scaling and cropping into account, which
CanvasKit does not use, and in a future commit, it will consider
orientation. Switch CanvasKit to use getBounds.

Change-Id: Ia956f91d241641aec450f3aba99583e95a3ff386
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333222
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-11-11 21:48:15 +00:00
Leon Scroggins
398fbed736 Remove unused SkAnimatedImage factory
This version was used before we added the version with an SkImageInfo
parameter to handle the SkColorSpace. That version supports all use
cases supported by this old one.

Change-Id: I966cfc83ac34d4951283eaf9e81febb032f461cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333221
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-11-11 21:29:05 +00:00
Ben Wagner
dfe8cbcf8f Update SkFont::measureText documentation.
The documentation implied that the paint would affect the advance
widths, but this has never been done. Instead document which parts of
the paint affect the bounds.

Change-Id: I48376f08e8a6a47b7ea949c53523b47bb66b4aa4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334052
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-11-11 17:15:35 +00:00
John Stiles
f7c9ccfb1f Avoid over-allocation in SkTArray assignment and reserve_back.
Previously, `checkRealloc` would always size up the requested buffer to
allow for 50% extra growth. In some cases (e.g. repeated push_back),
this is a clear win for performance. In other cases (e.g. assigning one
array to another, reserve_back), this extra padding is typically
unwanted and goes against most caller's expectations.

Change-Id: I2d2b5cf81268026822dc5ea08396771bbf06b25a
Bug: skia:10930
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333797
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-11-11 17:09:15 +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
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
Robert Phillips
0c0884991d Update DDL testing harness to support drawing DDL w/ integer offsets
This isn't hooked up anywhere but breaks up the omnibus CL.

Change-Id: I15c200e57450e7cc8ee95a3f7969926d0eb8487f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333129
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-11-10 14:34:46 +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
Mike Klein
c6acdab422 refactor Sk[S]TArray methods
Lots of this stuff can be delegated to each other,
cutting the protected SkTArray constructors to two.

Change-Id: Ie35b7a5ceb0ffef5a9548afccc546e076bd668cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333256
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-11-09 22:28:48 +00:00
Mike Klein
339f0ee2a6 align SkAlignedSTStorage<N,T> to T
This decreases alignment for things like float
and increases alignment for things like __m128.

The other users of SkAlignedSStorage looked simple enough to port to
aligned char[].  I haven't changed either of their alignments---still
the old max(void*,double)---but we can now if we want.

All that together lets us delete SkAlignedSStorage.

Change-Id: I6b5957a26f42ad859de383054573fb58d5cd0576
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333196
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-11-09 19:51:55 +00:00
Mike Klein
46f11c2aab init SkSTArray storage before passing to SkTArray
Using private inheritance is similar to having a class member,
except it's initialized before the next base class, SkTArray.
This lets us pass it to SkTArray's constructors.

I think we can make related changes (updating the various SkAlignedFoo,
not using them here, or not using them anywhere) independently.

... storage constructors made explicit at suggestion of GCC's -Wextra.
... now with explicit static_cast<STORAGE*>(this)

Change-Id: I665cf840e111da68f039416c9649ce328cc308d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333146
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-09 18:13:57 +00:00
Adlai Holler
d7b59c091d Have DDLs honor the reduceOpsTaskSplittingFlag
Especially while I'm fiddling with the implementation, we don't
want the user to be surprised when using DDLs also triggers
this other codepath.

Bug: skia:10877
Change-Id: I660ea08189fff45acd7a45df12e15c45f607758a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332720
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-11-06 20:20:44 +00:00
Herb Derby
e886b8e8b1 move concrete subruns to .cpp
In addition, place all the subruns, and helpers in
an anonymous namespace. Add helper has_some_antialiasing.

Change-Id: Iee7dc24f7e568e2bace03ee00c1c98dbf3050634
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332744
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-11-06 19:49:14 +00:00
Mike Reed
15b95d6f6c Move image sampling options into their own header
Experimenting with a single struct for everything, to simplify the
number of API changes/additions needed.

e.g. makeShader(...)

Idea is to use SkSampleOptions to augment drawBitmap calls, so we can
remove SkFilterQuality enum from SkPaint.

Change-Id: I9045ff483f58af29148d7dc21d30b294c4a718a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332739
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-06 17:30:44 +00:00
Greg Daniel
1448eb979d Fix formatting nit.
Change-Id: Id107d50ba23db4491d54d80b1d4c688bd3e80ebc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332741
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2020-11-06 16:46:44 +00:00
Adlai Holler
3078f85ca5 Remove dead no-sorting GrDrawingManager code paths
This simplifies our world a little bit.

Bug: skia:10877
Change-Id: I2fb27cd53e9fda0f279c046f6eaa50fd02774e72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332604
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-06 14:49:50 +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
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
Derek Sollenberger
f843170eb2 Revert "move subrun code to anonymous namespace"
This reverts commit a5eff5d53a.

Reason for revert: b/172455654

Original change's description:
> move subrun code to anonymous namespace
>
> Change-Id: Ic4325a5529ba354c0ce176c4299a9c179f911ff2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332136
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=herb@google.com,robertphillips@google.com,reed@google.com

Change-Id: I5601b086ff3dc0a5de85fb427cc01568c67f18ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332541
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Derek Sollenberger <djsollen@google.com>
2020-11-05 16:03:33 +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