Commit Graph

10855 Commits

Author SHA1 Message Date
Mike Reed
4f509345ab Pass sampling to drawImageSet
Bug: skia:7650
Change-Id: I93d41ca6e5beb85e9924ea2f3e0a82c18ff51369
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/349617
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-05 19:40:31 +00:00
Mike Reed
1efa14d9f4 Move to sampling for async-rescale routines
Bug: skia:7650
Change-Id: I10fde77472679b81747e15f150cbc0fe8e49906f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/349402
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-05 15:46:51 +00:00
Chris Dalton
eae5c16190 Reland "Enable GrTessellationPathRenderer by default"
This is a reland of 6ea387e7c7

Original change's description:
> Enable GrTessellationPathRenderer by default
>
> Moves GrTessellationPathRenderer to the end of the chain and enables
> it by default.
>
> Also updates nvpr to not draw volatile paths. The tessellator is much
> faster at these.
>
> Bug: skia:10419
> Change-Id: I97ca7d4d1dff65fc9d4040c267f9808c8c33b548
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344377
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Bug: skia:10419
Change-Id: I53b50d6aa01ae1bea697e05c3f60d57d132d6aad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345759
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-01-04 19:43:41 +00:00
Mike Reed
d8ff313e44 Plumb sampling to drawSpecial, drawDevice
Bug: skia:7650
Change-Id: I5bae4dec2fbbd57b2cebc4324f5344cc8769b141
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/349398
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-04 17:07:20 +00:00
Mike Reed
ee380a0c7d Remove references to drawBitmapNine
Change-Id: Ifb2ca09b5d146eca796ce0e199720e8833848e13
Docs-Preview: https://skia.org/?cl=349401
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/349401
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-01 15:23:23 +00:00
Adlai Holler
4ef108e6d1 Reland "Yank out old reduceOpsTaskSplitting code"
This reverts commit 7689319271.

Reason for revert: Sticking with this despite regression

Original change's description:
> Revert "Yank out old reduceOpsTaskSplitting code"
>
> This reverts commit dfc880bd9b.
>
> Reason for revert: chromium:1146701
>
> Original change's description:
> > Yank out old reduceOpsTaskSplitting code
> >
> > The behavior previously triggered by this flag is reimplemented
> > in review.skia.org/345168 . The current implementation isn't used
> > and can't really be used safely because it may go over the
> > GPU memory budget.
> >
> > Bug: skia:10877
> > Change-Id: I2759c688aa60a618ef76dfec0a49ef5e5f0a9afc
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345477
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Auto-Submit: Adlai Holler <adlai@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: skia:10877 chromium:1146701
> Change-Id: I90cdd16eaf033b816f2d1830fd0ee72fdc0ec74b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346777
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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

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

Bug: skia:10877 chromium:1146701
Change-Id: Idb734bebe4d0baac9d47539791b0e6240d6be2da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348883
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-12-30 17:28:08 +00:00
Adlai Holler
245c59a3ff Reland "Have DDLs honor the reduceOpsTaskSplittingFlag"
This reverts commit 6e9bf51dd8.

Reason for revert: We're sticking with this despite regression

Original change's description:
> Revert "Have DDLs honor the reduceOpsTaskSplittingFlag"
>
> This reverts commit d7b59c091d.
>
> Reason for revert: Regression in chrome:1146701
>
> Original change's description:
> > 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>
>
> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: skia:10877 chromium:1146701
> Change-Id: Ieab2853b54663e7633bec6d71929db9885251ed2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346659
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Adlai Holler <adlai@google.com>

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

# Not skipping CQ checks because this is a reland.

Bug: skia:10877 chromium:1146701
Change-Id: I754436755829d25da3fdb37f634669ae33419eb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348882
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-12-30 17:20:37 +00:00
Mike Reed
4f23dec742 Reland "Add new virts, hide old ones"
This reverts commit 8f924ac0ce.

Reason for revert: suppressions landed for fuchsia images to rebaseline

Original change's description:
> Revert "Add new virts, hide old ones"
>
> This reverts commit c56e2e5aa6.
>
> Reason for revert: suspected of breaking chrome roll
>
> Original change's description:
> > Add new virts, hide old ones
> >
> > Add virtuals for the draw methods that now take sampling/filtermode.
> >
> > drawImage
> > drawImageRect
> > drawImageLattice
> > drawAtlas
> >
> > Add a flag that can remove the older virtuals, once each client has
> > stopped overriding them. In that situation, the older public methods
> > will simplify extract the sampling from the paint, and call the new
> > public methods.
> >
> > Bug: skia:11105, skia:7650
> > Change-Id: I8b0029727295caa983e8148fc743a55cfbecd043
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347022
> > Commit-Queue: Mike Reed <reed@google.com>
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,fmalita@chromium.org,reed@google.com
>
> Change-Id: I0a90952c11a180d918126ea06a630f4a0bf9b49b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:11105
> Bug: skia:7650
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348194
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>

TBR=djsollen@google.com,bsalomon@google.com,fmalita@chromium.org,reed@google.com

# Not skipping CQ checks because this is a reland.

Bug: skia:11105
Bug: skia:7650
Change-Id: Ia2b4537a2d330460b7554278d2c05075cf27162a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348876
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-30 15:21:01 +00:00
Derek Sollenberger
8f924ac0ce Revert "Add new virts, hide old ones"
This reverts commit c56e2e5aa6.

Reason for revert: suspected of breaking chrome roll

Original change's description:
> Add new virts, hide old ones
>
> Add virtuals for the draw methods that now take sampling/filtermode.
>
> drawImage
> drawImageRect
> drawImageLattice
> drawAtlas
>
> Add a flag that can remove the older virtuals, once each client has
> stopped overriding them. In that situation, the older public methods
> will simplify extract the sampling from the paint, and call the new
> public methods.
>
> Bug: skia:11105, skia:7650
> Change-Id: I8b0029727295caa983e8148fc743a55cfbecd043
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347022
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,fmalita@chromium.org,reed@google.com

Change-Id: I0a90952c11a180d918126ea06a630f4a0bf9b49b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11105
Bug: skia:7650
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348194
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2020-12-30 13:41:52 +00:00
Mike Reed
c56e2e5aa6 Add new virts, hide old ones
Add virtuals for the draw methods that now take sampling/filtermode.

drawImage
drawImageRect
drawImageLattice
drawAtlas

Add a flag that can remove the older virtuals, once each client has
stopped overriding them. In that situation, the older public methods
will simplify extract the sampling from the paint, and call the new
public methods.

Bug: skia:11105, skia:7650
Change-Id: I8b0029727295caa983e8148fc743a55cfbecd043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347022
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-12-29 21:36:08 +00:00
Adlai Holler
6e9bf51dd8 Revert "Have DDLs honor the reduceOpsTaskSplittingFlag"
This reverts commit d7b59c091d.

Reason for revert: Regression in chrome:1146701

Original change's description:
> 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>

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

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

Bug: skia:10877 chromium:1146701
Change-Id: Ieab2853b54663e7633bec6d71929db9885251ed2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346659
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-12-29 21:13:18 +00:00
Mike Reed
fe4611c18e Alias two sets of enums
Change-Id: Id5104dea2987945d572d60135ee0fe374e980f26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348182
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-29 19:10:17 +00:00
Ben Wagner
f73a029506 Make onCreateScalerContext return unique_ptr.
Change SkTypeface::onCreateScalerContext to return std::unique_ptr
instead of a bare pointer. The public SkTypeface::createScalerContext
implementation already returns std::unique_ptr, so this is an internal
change only.

Move SkTypeface::createScalerContext implementation from
SkScalerContext.cpp to SkTypeface.cpp for consistency.

Also change the return type of SkScalerContext::MakeEmptyContext to
std::unique_ptr and rename to SkScalerContext::MakeEmpty.

Change-Id: I965308e8f9c78b887811e428f0de873dc6196479
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346658
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
2020-12-28 17:31:09 +00:00
Florin Malita
c8f9f68b07 Add explicit int -> size_t casts to SkTDArray.h
To unblock https://skia-review.googlesource.com/c/skia/+/347616:

In file included from ../../../../../../skia/tools/public_headers_warnings_check.cpp:8:
In file included from gen\skia.h:19:
In file included from ../../../../../../skia\include/core/SkContourMeasure.h:11:
In file included from ../../../../../../skia\include\core\SkPath.h:13:
In file included from ../../../../../../skia\include/private/SkPathRef.h:16:
In file included from ../../../../../../skia\include/private/SkIDChangeListener.h:13:
../../../../../../skia\include/private/SkTDArray.h(76,48): error: implicit conversion changes signedness: 'const int' to 'unsigned long long' [-Werror,-Wsign-conversion]
                 !memcmp(a.fArray, b.fArray, a.fCount * sizeof(T)));
                                             ~~^~~~~~ ~

...

Change-Id: I1b55580ae5e73bde41cecb20d137295bbaf8cbb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347860
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-12-28 17:23:49 +00:00
Mike Reed
9a27566e0c Add customization for kMedium
Change-Id: If08d7d71be59179b22bbf27dacca5942f1832a11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347637
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-27 13:30:39 +00:00
Brian Salomon
d12c91ba31 Revert "Revert "Remove legacy SkImage::MakeFromYUVATextures.""
Bug: skia:10632

This reverts commit 10089c6a42.

Cq-Include-Trybots: luci.skia.skia.primary:Canary-Android,Canary-Chromium,Canary-Flutter,Canary-G3
Change-Id: I40f17827c7bf77c005995a198f135718ec4047f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345174
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-12-24 03:37:08 +00:00
Mike Reed
dc607e35e1 Use bitmap.asImage()
Change-Id: Ie16194937530d7cd75f84d9af66c31b77875ef83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347043
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-23 17:41:47 +00:00
Mike Reed
839eef3e9a Work on hiding filter-quality
SkPaintPriv methods are just an internal stopgap

Change-Id: Ibe6e37c5871068d8cd67dc0948961444dfd2b62a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347041
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-23 17:05:17 +00:00
Brian Salomon
8f7d95382e Remove public getter for GrSurfaceDrawContext on SkSCanvas.
Made it private and accessible internally via SkCanvasPriv.

Update SkGpuDevice methods/variables after rename of GrDrawSurfaceContext.

Cq-Include-Trybots: luci.skia.skia.primary:Canary-G3,Canary-Flutter,Canary-Android
Change-Id: I3da64cee1de03c201243ee6c7ccd4b4c44cad8c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346498
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-12-23 16:13:07 +00:00
Mike Reed
ac9f0c9e27 Bitmap.asImage()
... and lots and lots of IWYU

Change-Id: Ie5157dcdd2e6d29b95c71b39153278ab48ef4eb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346778
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-23 15:54:57 +00:00
John Stiles
7df731bcfd Reland "Add support for range-based for loops to SkTHashSet/Map."
Updated Pair type in SkTHashMap to derive from std::pair to fix C++14
issues with structured bindings.

Original change's description:
> Add support for range-based for loops to SkTHashSet/Map.
>
> This allows loops over SkTHashes to break in the middle, and also
> removes the need to use lambda captures to bring variables inside the
> loop's scope.
>
> Change-Id: Ief55d776b2c57a44b24cfe1c94493a5d514791c8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346496
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

Change-Id: I2ac5b2c59e70ed0ec3b42b32e7994d6bcdf56b40
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346502
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-12-22 20:53:53 +00:00
Michael Ludwig
a18613d120 Add halfWidth/halfHeight functions to SkRectPriv
These effectively compute width/2 or height/2, but switch operations
around so that it's less likely to overflow on finite rects that would
have overflows in width or height.

Bug: skia:1160678
Change-Id: Ic93ca0c1d12598163b3dd48a5e8ba0ac7903301f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344968
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-12-22 20:42:43 +00:00
Adlai Holler
7689319271 Revert "Yank out old reduceOpsTaskSplitting code"
This reverts commit dfc880bd9b.

Reason for revert: chromium:1146701

Original change's description:
> Yank out old reduceOpsTaskSplitting code
>
> The behavior previously triggered by this flag is reimplemented
> in review.skia.org/345168 . The current implementation isn't used
> and can't really be used safely because it may go over the
> GPU memory budget.
>
> Bug: skia:10877
> Change-Id: I2759c688aa60a618ef76dfec0a49ef5e5f0a9afc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345477
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Auto-Submit: Adlai Holler <adlai@google.com>

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

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

Bug: skia:10877 chromium:1146701
Change-Id: I90cdd16eaf033b816f2d1830fd0ee72fdc0ec74b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346777
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-12-22 20:29:52 +00:00
John Stiles
dd690af373 Revert "Add support for range-based for loops to SkTHashSet/Map."
This reverts commit 5d00e15625.

Reason for revert: tree breakage on Chromebook standard lib

Original change's description:
> Add support for range-based for loops to SkTHashSet/Map.
>
> This allows loops over SkTHashes to break in the middle, and also
> removes the need to use lambda captures to bring variables inside the
> loop's scope.
>
> Change-Id: Ief55d776b2c57a44b24cfe1c94493a5d514791c8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346496
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

TBR=mtklein@google.com,johnstiles@google.com

Change-Id: I165872ac41f66f3b3255cf8970626392e5283412
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346500
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-12-22 15:35:03 +00:00
John Stiles
5d00e15625 Add support for range-based for loops to SkTHashSet/Map.
This allows loops over SkTHashes to break in the middle, and also
removes the need to use lambda captures to bring variables inside the
loop's scope.

Change-Id: Ief55d776b2c57a44b24cfe1c94493a5d514791c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346496
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-12-22 15:10:42 +00:00
Brian Salomon
f02df4db61 Remove public SkCanvas::internalGetTopLayerBounds()
Android is now using framework-only topLayerBounds()

Cq-Include-Trybots: luci.skia.skia.primary:Canary-Android
Change-Id: I40375ef1de45d3c2160dd913593326950265314e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344974
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-12-22 14:18:12 +00:00
Leon Scroggins III
e42716032b SkAnimatedImage: Always respect exif orientation
No known clients (CanvasKit, Android) want to ignore the exif
orientation in an animation.

A follow-on CL will deprecate SkAndroidCodec::ExifOrientation, leaving
it up to the client (e.g. SkAnimatedImage, hwui/ImageDecoder) to
handle the orientation. Add SkEncodedOriginSwapsWidthHeight to assist
clients to do so.

Update stoplight_animated_image GM. It previously showed using
SkAnimatedImage without respecting the orientation, which is no longer
supported. The new version replaces the left half of the image with the
right.

Remove assert that is no longer true. Originally, an SkAnimatedImage was
"simple" if it did not have a crop or postProcessor. This is no longer
true if has an exif orientation. Add a test that calls the simple
constructor and verifies it does not crash.

Change-Id: I421fd02700f220fb90458cd03c4431dee7daf399
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344762
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-12-21 16:39:12 +00:00
Mike Reed
6aea078802 Don't use sprite-blit if cubic sampling
Need this to land first: https://chromium-review.googlesource.com/c/chromium/src/+/2597643

Bug: skia:7650
Change-Id: Idebecfc8a5922a937fd46ccff1eea4df53f6b0cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345170
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-21 16:10:42 +00:00
Mike Reed
e78f8cebca Starting to hide setFilterQuality
Bug: skia:7650
Change-Id: I511859e9b34af21d351db87b658dad970f0802a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345171
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-12-19 20:56:50 +00:00
Brian Salomon
7bfdb10449 Revert "Enable GrTessellationPathRenderer by default"
This reverts commit 6ea387e7c7.

Reason for revert: valgrind failing

Original change's description:
> Enable GrTessellationPathRenderer by default
>
> Moves GrTessellationPathRenderer to the end of the chain and enables
> it by default.
>
> Also updates nvpr to not draw volatile paths. The tessellator is much
> faster at these.
>
> Bug: skia:10419
> Change-Id: I97ca7d4d1dff65fc9d4040c267f9808c8c33b548
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344377
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I3718ae210ebc403959d187160214cf0df895e4f5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345718
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-12-18 15:46:30 +00:00
Adlai Holler
dfc880bd9b Yank out old reduceOpsTaskSplitting code
The behavior previously triggered by this flag is reimplemented
in review.skia.org/345168 . The current implementation isn't used
and can't really be used safely because it may go over the
GPU memory budget.

Bug: skia:10877
Change-Id: I2759c688aa60a618ef76dfec0a49ef5e5f0a9afc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345477
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-12-18 01:14:20 +00:00
Chris Dalton
6ea387e7c7 Enable GrTessellationPathRenderer by default
Moves GrTessellationPathRenderer to the end of the chain and enables
it by default.

Also updates nvpr to not draw volatile paths. The tessellator is much
faster at these.

Bug: skia:10419
Change-Id: I97ca7d4d1dff65fc9d4040c267f9808c8c33b548
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344377
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-12-17 19:33:56 +00:00
Brian Osman
0a442b71b0 New SkSL code generator that emits directly to skvm
Still TODO:
- Function calls. Can do these by inlining everything (recursively).
- Additional flow control: ES2 for loops can be supported (via
  unrolling), and switch() can be implemented. (Was never done in
  ByteCode).
- Uniforms and params have been set up to work very generically (caller
  just supplies IDs, the generator collates everything into a master
  working list). Builtins should work the same way (caller supplies a
  map of builtin ID -> skvm::Val[]?), so that we don't need a special
  case for device coord.
- Figure out integer type policy. Today, it's a mix of only supporting
  signed integers, and just treating all integers as signed, even if
  they're not.
- Now that defining intrinsics is *much* simpler, stop defining so many
  of them in sksl_public.sksl, and just implement them here.

Change-Id: Id9771444ce54ccf8e6e408c44ebb3780c1170435
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341980
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-12-17 19:16:25 +00:00
Mike Reed
860d01ca8b Idea: implement drawImageNine by calling drawImageLattice
- that removes the need for onDrawImageNine
- ... that removes a whole lot of plumbing

Bug: skia:11099
Change-Id: I35e2f70320be118aec38a5c783a53c7aa90b3131
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345160
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-17 16:35:05 +00:00
Mike Reed
ed4108e428 Revert "Revert "Reland "Rename getTopDevice/getDevice to topDevice/baseDevice"""
Removed const Device* return

This reverts commit 9e230d8136.

Change-Id: I1151a198e857fb1b539f69fdab917668c35d147d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345285
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-17 16:32:23 +00:00
Brian Salomon
01ff5384bf Support luminance-alpha GL format for YUVA planes
Bug: skia:10632
Change-Id: Ic91510b55644c15ee4eb5f96e7c35193b5ce49df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344761
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-12-17 14:54:25 +00:00
Mike Reed
83aef7f816 Remove obsolete dox w.r.t. filter-quality
Change-Id: Iab72a7e87445f821b887db32ee09a64700983077
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345280
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-17 14:33:21 +00:00
Michael Ludwig
9e230d8136 Revert "Reland "Rename getTopDevice/getDevice to topDevice/baseDevice""
This reverts commit 7839f66540.

Reason for revert: another android-framework only compiler issue, this time around 'const'-ness

Original change's description:
> Reland "Rename getTopDevice/getDevice to topDevice/baseDevice"
>
> This reverts commit d8b939e0b4.
>
> Reason for revert: fix SkAndroidFrameworkUtils getDevice() reference
>
> Original change's description:
> > Revert "Rename getTopDevice/getDevice to topDevice/baseDevice"
> >
> > This reverts commit 632a23afa4.
> >
> > Reason for revert: breaking android roll
> >
> > Original change's description:
> > > Rename getTopDevice/getDevice to topDevice/baseDevice
> > >
> > > This addresses nit from https://skia-review.googlesource.com/c/skia/+/344663
> > > and also moves topDevice() to be private, since it's not really meant
> > > for arbitrary subclasses to access anyways. Classes outside of SkCanvas
> > > that need topDevice/baseDevice are already friended anyways.
> > >
> > > Bug: skia:10987
> > > Change-Id: Ib0b0dffb5b1c35d5a0c78aeb8903e4cf0b8810a9
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344960
> > > Reviewed-by: Mike Klein <mtklein@google.com>
> > > Reviewed-by: Mike Reed <reed@google.com>
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> >
> > TBR=mtklein@google.com,reed@google.com,michaelludwig@google.com
> >
> > Change-Id: I9b70230f7db5d31cede2ea03e7abc7c154021204
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:10987
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345158
> > Reviewed-by: Derek Sollenberger <djsollen@google.com>
> > Commit-Queue: Derek Sollenberger <djsollen@google.com>
>
> TBR=djsollen@google.com,mtklein@google.com,reed@google.com,michaelludwig@google.com
>
> # Not skipping CQ checks because this is a reland.
>
> Bug: skia:10987
> Change-Id: Ibf6397b54655c25ef3d348210de5eb6dab416723
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345165
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: Ib97ee3c349eee90d27bf22f4d43d29d24ca68f27
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10987
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345282
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-12-17 14:23:16 +00:00
Michael Ludwig
7839f66540 Reland "Rename getTopDevice/getDevice to topDevice/baseDevice"
This reverts commit d8b939e0b4.

Reason for revert: fix SkAndroidFrameworkUtils getDevice() reference

Original change's description:
> Revert "Rename getTopDevice/getDevice to topDevice/baseDevice"
>
> This reverts commit 632a23afa4.
>
> Reason for revert: breaking android roll
>
> Original change's description:
> > Rename getTopDevice/getDevice to topDevice/baseDevice
> >
> > This addresses nit from https://skia-review.googlesource.com/c/skia/+/344663
> > and also moves topDevice() to be private, since it's not really meant
> > for arbitrary subclasses to access anyways. Classes outside of SkCanvas
> > that need topDevice/baseDevice are already friended anyways.
> >
> > Bug: skia:10987
> > Change-Id: Ib0b0dffb5b1c35d5a0c78aeb8903e4cf0b8810a9
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344960
> > Reviewed-by: Mike Klein <mtklein@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> TBR=mtklein@google.com,reed@google.com,michaelludwig@google.com
>
> Change-Id: I9b70230f7db5d31cede2ea03e7abc7c154021204
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10987
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345158
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>

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

# Not skipping CQ checks because this is a reland.

Bug: skia:10987
Change-Id: Ibf6397b54655c25ef3d348210de5eb6dab416723
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345165
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-12-17 01:14:53 +00:00
Mike Reed
85fa75616d Add filtermode to drawnine
Bug: skia:7650, skia:11099
Change-Id: I1e603099d30bd4672cbb6783209bacf4678fa0f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345156
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-16 22:05:43 +00:00
Derek Sollenberger
d8b939e0b4 Revert "Rename getTopDevice/getDevice to topDevice/baseDevice"
This reverts commit 632a23afa4.

Reason for revert: breaking android roll

Original change's description:
> Rename getTopDevice/getDevice to topDevice/baseDevice
>
> This addresses nit from https://skia-review.googlesource.com/c/skia/+/344663
> and also moves topDevice() to be private, since it's not really meant
> for arbitrary subclasses to access anyways. Classes outside of SkCanvas
> that need topDevice/baseDevice are already friended anyways.
>
> Bug: skia:10987
> Change-Id: Ib0b0dffb5b1c35d5a0c78aeb8903e4cf0b8810a9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344960
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: I9b70230f7db5d31cede2ea03e7abc7c154021204
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10987
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345158
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2020-12-16 21:42:05 +00:00
Brian Salomon
590f567291 Add GrSurfaceFillContext
This is a new base class for GrSurfaceDrawContext. It allows any
alpha-type but is restricted to non-blending fills of irects using FPs,
clears,and discards.

Bug: skia:11019

Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341680
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: I696df3617719fcd8303faa73fb44b32b3fb4f71c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344896
2020-12-16 20:48:43 +00:00
Michael Ludwig
632a23afa4 Rename getTopDevice/getDevice to topDevice/baseDevice
This addresses nit from https://skia-review.googlesource.com/c/skia/+/344663
and also moves topDevice() to be private, since it's not really meant
for arbitrary subclasses to access anyways. Classes outside of SkCanvas
that need topDevice/baseDevice are already friended anyways.

Bug: skia:10987
Change-Id: Ib0b0dffb5b1c35d5a0c78aeb8903e4cf0b8810a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344960
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-12-16 18:31:06 +00:00
Jim Van Verth
63f0354b6d Add support for directional lights.
Adds a new kDirectionLight_ShadowFlag which indicates that lightPosition
is a vector pointing towards the light, and lightRadius is the blur
radius when the occluder is at z == 1. For other values of z it will
scale linearly. The direction is specified in device space.

Bug: skia:10781
Change-Id: I14d530f006e5541ed6e22bfbeb29c7441c21fb8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321792
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-12-16 16:58:26 +00:00
Brian Salomon
0263bff0d2 Revert "Add GrSurfaceFillContext"
This reverts commit b339bbe9dc.


Revert "Make backend allocation tests avoid alphatype conversions"

This reverts commit 177af6f410.

Bug: skia:11019
Change-Id: Id80aa7df4a15c8530a609c49ca6264bce7831852
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344569
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-12-16 14:49:56 +00:00
Chris Dalton
15f51848df Reland "Disable HW tessellation shaders by default"
This is a reland of ad8b9fa2d7

Original change's description:
> Disable HW tessellation shaders by default
>
> The GLSL backdoor for tessellation shaders is only experimental at
> this point. In order to enable the tessellation path renderer, we need
> to turn off HW tessellation and let it use the indirect draw modes.
>
> Bug: skia:10419
> Change-Id: Ic979978a331c7ad016907cf42b2562b35caab8ab
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344336
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com
Bug: skia:10419
Change-Id: I0bdf34da134a3a34a5c78b35cc0eb86d6e989bb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344796
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-12-16 05:08:25 +00:00
Chris Dalton
1c2584d8cc Revert "Disable HW tessellation shaders by default"
This reverts commit ad8b9fa2d7.

Reason for revert: Benchmark failure

Original change's description:
> Disable HW tessellation shaders by default
>
> The GLSL backdoor for tessellation shaders is only experimental at
> this point. In order to enable the tessellation path renderer, we need
> to turn off HW tessellation and let it use the indirect draw modes.
>
> Bug: skia:10419
> Change-Id: Ic979978a331c7ad016907cf42b2562b35caab8ab
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344336
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ia74dbcec582168870bd3ccc5e52b8dce0fb2bdfc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344698
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-12-15 20:45:46 +00:00
Brian Salomon
b339bbe9dc Add GrSurfaceFillContext
This is a new base class for GrSurfaceDrawContext. It allows any
alpha-type but is restricted to non-blending fills of irects using FPs,
clears,and discards.

Bug: skia:11019

Change-Id: I229ce5f452e66796e2fa5c0e7a6ddccbf23bef5c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341680
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-12-15 19:31:44 +00:00
Chris Dalton
ad8b9fa2d7 Disable HW tessellation shaders by default
The GLSL backdoor for tessellation shaders is only experimental at
this point. In order to enable the tessellation path renderer, we need
to turn off HW tessellation and let it use the indirect draw modes.

Bug: skia:10419
Change-Id: Ic979978a331c7ad016907cf42b2562b35caab8ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344336
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-12-15 18:36:44 +00:00
Michael Ludwig
887ac49f9e Always use AutoLayerForImageFilter
This definitely simplifies the drawing code, but always copies the input
SkPaint so that it can be modified if necessary. If we get perf hits, we
can just revert this. We could keep it using a copy-on-write, but with
this change, I believe we've removed the majority of instances of
SkCopyOnWrite<SkPaint> inside SkCanvas. There's just one LatticePaint
struct that's overly complex for what it does that I can clean up next.

A middle ground would be to keep the copy-on-write behavior, but drop
the branch on image-filter. Given the lack of perf needle movement on
some of the other simplifications that avoided technically unnecessary
paint copies, I doubt it's worth the complexity.

As part of this change, since the draw calls no longer branch based on
the presence of an image filter, the AutoLayerForImageFilter takes over
calling predrawNotify() in its various forms. We don't have to follow
through with that, if we'd rather have the notification be called out
explicitly within the draw call itself. I've found it easy to forget to
call predrawNotify(), or keep it in the right place while updating draws
so I may be biased.

Bug: skia:10987
Change-Id: I5204c175aae691f82cc45f3d9a04ef64dee5d80f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342920
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-12-15 15:38:19 +00:00