Commit Graph

4709 Commits

Author SHA1 Message Date
Ben Wagner
ae4bb98f13 Reland "Remove use of legacy display globals."
This is a reland of c1916c34fe

As it turns out, benches are not always given a canvas.

Original change's description:
> Remove use of legacy display globals.
>
> In the ongoing effort to remove the display globals from Skia, allow
> their use only if SK_LEGACY_SURFACE_PROPS is defined. Do not define this
> in a normal Skia build and remove all use from Skia code.
>
> Change-Id: I9ff550f5db246b9024aac687a1bc01321f1be4c8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319343
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

Change-Id: I61a2ac058fafc99653e3304876cf4b97350dac8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322490
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-10-05 19:13:58 +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
Jim Van Verth
bd0881cb58 Revert "Remove use of legacy display globals."
This reverts commit c1916c34fe.

Reason for revert: Bots unhappy

Original change's description:
> Remove use of legacy display globals.
>
> In the ongoing effort to remove the display globals from Skia, allow
> their use only if SK_LEGACY_SURFACE_PROPS is defined. Do not define this
> in a normal Skia build and remove all use from Skia code.
>
> Change-Id: I9ff550f5db246b9024aac687a1bc01321f1be4c8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319343
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

TBR=djsollen@google.com,bungeman@google.com,herb@google.com,reed@google.com

Change-Id: I365d2b1d19241a90130bc1b59663651817966f63
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322400
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-10-05 16:34:15 +00:00
Ben Wagner
c1916c34fe Remove use of legacy display globals.
In the ongoing effort to remove the display globals from Skia, allow
their use only if SK_LEGACY_SURFACE_PROPS is defined. Do not define this
in a normal Skia build and remove all use from Skia code.

Change-Id: I9ff550f5db246b9024aac687a1bc01321f1be4c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319343
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-10-05 15:53:10 +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
Ben Wagner
12857d405c Fix gms placing text in bounds.
In the operation of taking the bounds of (horizontal text) and then
drawing the text within those bounds it is necessary to draw the text at
the origin of the bounds and not at the left edge of the bounds.

Change-Id: I712e1713ca5e0be929b11f526f224141a5310cc2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319776
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-09-28 16:35:13 +00:00
Chris Dalton
1b6a43cf20 Move user stencil settings from GrPipeline to GrProgramInfo
Bug: skia:10419
Change-Id: If11d28f6d9348ba0011825f719123c09f0103603
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319481
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-25 21:12:50 +00:00
Brian Salomon
96c8aeb494 Reland "Allow rect and circle blur fast cases to be used with rotation matrices."
This is a reland of 2bded27a96

Original change's description:
> Allow rect and circle blur fast cases to be used with rotation matrices.
>
> For circles this is trivial. The existing shader works as is.
>
> For rects this requires back projecting from device space.
>
> Adds a GM for rotated rect blurs and modifies a circle blur GM to add
> rotation.
>
> Bug: chromium:1087705
>
> Change-Id: I6b969552fbcc9f9997cfa061b3a312a5a71e8841
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318757
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: chromium:1087705
Change-Id: Ie3ef96c40461665f6207225a15e19b4cf5bcba94
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319338
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-09-24 21:33:44 +00:00
Robert Phillips
1fc7422092 Revert "Allow rect and circle blur fast cases to be used with rotation matrices."
This reverts commit 2bded27a96.

Reason for revert: Seems to be blocking the Chrome roll

Original change's description:
> Allow rect and circle blur fast cases to be used with rotation matrices.
>
> For circles this is trivial. The existing shader works as is.
>
> For rects this requires back projecting from device space.
>
> Adds a GM for rotated rect blurs and modifies a circle blur GM to add
> rotation.
>
> Bug: chromium:1087705
>
> Change-Id: I6b969552fbcc9f9997cfa061b3a312a5a71e8841
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318757
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Iafb479f3b3561e226678a3020254c6e76d4ce284
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1087705
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319186
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-24 13:43:20 +00:00
Brian Salomon
2bded27a96 Allow rect and circle blur fast cases to be used with rotation matrices.
For circles this is trivial. The existing shader works as is.

For rects this requires back projecting from device space.

Adds a GM for rotated rect blurs and modifies a circle blur GM to add
rotation.

Bug: chromium:1087705

Change-Id: I6b969552fbcc9f9997cfa061b3a312a5a71e8841
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318757
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-09-23 20:01:07 +00:00
Chris Dalton
6756afabb6 Fail the "tess_segs_5" tests if Skia doesn't actually give us 5 tessellation segments
Bug: skia:10419
Change-Id: I5363ac6ac74131341d010cf2958cc5d7a070689f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318782
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-09-23 17:03:57 +00:00
Florin Malita
8b5ed02eb0 Fix skia_use_ffmpeg builds
... post https://skia-review.googlesource.com/c/skia/+/317109

Change-Id: I7286fd6d7598a50a1db452f04a28317c600f4984
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318477
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-09-22 14:25:10 +00:00
Brian Salomon
6c6678f78e Separate YUVATextures, YUVATexturesCopy, and YUVAPixmaps in wacky GMs.
Skips all but the generator flavor on CPU since the others were all
falling back to the generator anyway.

Uses the new MakeFromYUVAPixmaps signature.

Rename domain to subset.

Bug: skia:10632
Change-Id: Ie6afe0e7927dc3d0b121df094c1ccb6f0db3b815
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318198
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-09-21 16:19:51 +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
Chris Dalton
31634288fd Add gms that test limited hw tessellation segments
Adds variations of trickycubicstrokes and widebuttcaps that limit the
max number of hardware tessellation segments to 5. This exercises our
stroking logic for splitting curves and joins when they require more
segments than are supported by the hardware.

Bug: skia:10419
Change-Id: Ie52374b89e30bfa021b2de74e3cd32e02ab734d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317268
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-17 23:48:44 +00:00
Mike Reed
b4aa639f23 Refactor API for mipmap-builder,
now the builder returns the new image.

Change-Id: Ie56256390b96d3fdbe39f89784276947047df656
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316442
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-09-17 21:46:44 +00:00
Brian Osman
b25e6e15c6 Remove unnecessary casting from SkSL in GMs
Converts examples to use more idiomatic "user" SkSL,
without extra casts, and taking advantage of swizzle.

Change-Id: I4ad4e7b6563b4f09402855cb125546b015622ced
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317388
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-09-16 19:56:07 +00:00
Chris Dalton
5c3e1a969e Add a quadratic cusp to trickycubicstrokes
Bug: skia:10419
Change-Id: I37f04f442485c13cc7af60e0573b23dfaa5378bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317267
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-09-16 15:12:47 +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
Adlai Holler
302e8fb771 Downgrade SkImage to GrImageContext
We still occasionally downcast, so this is not airtight,
but it (1) allows us to know where we are downcasting and
(2) lets us move away from GrContext (and hopefully remove
it sooner than later.)

All three canaries are currently broken =( so here we go!

Bug: skia:104662
Change-Id: I84efe132574690b62ea512e194e4f9e318e9c050
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316218
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-14 17:01:07 +00:00
Greg Daniel
d358cbebd4 Add support for plumbing GrDstSampleType through Ops and Pipeline creation.
This CL adds a new type GrDstSampleType to say how we will sample the dst.

We add tracking of the GrDstSampleType in the recording of GrOps and
then during execution passing the information along to the GrPipeline.

In general the tracking of GrDstSampleType is a global state of a GrOpsTask
so it is kept separate fro the DstProxyView which is more specific to a
single Op on the GrOpsTask.

Bug: skia:10409
Change-Id: Ie843c31f2e48a887daf96cee99ed159b196cb545
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315645
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-11 14:42:34 +00:00
Chris Dalton
c2ae19caa5 Add more flat line cases to trickycubicstrokes
Bug: skia:10419
Change-Id: Ie3eba0181d59d6ab759bcf8cc4b53dfac135cbd6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315857
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-09-09 19:18:07 +00:00
Mike Reed
d849a75ad3 use pathbuilder
Change-Id: Icb4d3f98440b53ba38270cc1f43fc43e6724d36b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315736
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-09-09 12:43:00 +00:00
John Stiles
7571f9e490 Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'.
Mechanically updated via Xcode "Replace Regular Expression":

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

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

Change-Id: I671dc9d9efdf6d60151325c8d4d13fad7e10a15b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314999
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-03 03:41:26 +00:00
Mike Reed
85f51b2a40 Simplify firstdirection
Change-Id: I30d3056dc97a16c08b85fd77120485ef07b18d96
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314037
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-08-30 15:01:02 +00:00
Mike Reed
3872c98951 Move convexity enum out of public
Also, move first-direction into SkPathRef.h so it can be referenced
by name in SkPath (instead of using uint8_t)

No functional change expected.

Change-Id: Ica4a8357a8156fd9a516118f23599a965b0fdd47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313980
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-08-30 13:04:22 +00:00
Adlai Holler
bcfc554fde Add GrDirectContext arg to SkImage::readPixels
Note: The polarity of the staging flag is inverted from usual because
a G3 dependency with no SkUserConfig.h relies on the legacy API.

Once this lands, we will migrate them and others, then remove the
staging API. The inverted staging flag is kind of nice, actually - I may
use that pattern in the future. It means less total CLs and it's just as
easy to flip the bit on or off during debugging.

Bug: skia:104662
Change-Id: I48cba1eeae3e2e6f79918c6d243e0666e68ec71b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310656
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-08-27 19:26:29 +00:00
Mike Reed
06d7c9d798 Revert "Revert "use pathbuilder""
This reverts commit 43e3e91883.

Change-Id: I43f6c195f96b1601225801ffaa05a3133c236eba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313421
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-08-26 17:35:34 +00:00
Mike Reed
43e3e91883 Revert "use pathbuilder"
This reverts commit 4b25d41d96.

Reason for revert: grrrr, broke some layout test (a little)

https://test-results.appspot.com/data/layout_results/linux-blink-rel/40609/blink_web_tests%20%28with%20patch%29/layout-test-results/results.html

Original change's description:
> use pathbuilder
> 
> Change-Id: I4b7cd6aed0c8da44e6065bb171332e25988ec8cc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313376
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I7a073aafcfddc398ab9a761719230f2427c987c6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313420
Reviewed-by: Mike Reed <reed@google.com>
2020-08-26 16:35:37 +00:00
Mike Reed
4b25d41d96 use pathbuilder
Change-Id: I4b7cd6aed0c8da44e6065bb171332e25988ec8cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313376
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-08-26 14:58:13 +00:00
Mike Reed
ad5494d1d9 use pathbuilder
Change-Id: I11c18d4ff0e60cc33d742cf49359039395abc6b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313256
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-08-25 22:27:20 +00:00
Mike Reed
92f6eb1602 use pathbuilder
Change-Id: I2bca419a3273a9cc8a984b0f4159f518968c6652
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313077
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-08-25 16:29:48 +00:00
Brian Osman
767f444feb SkRuntimeEffect SkSL has a new signature for main()
There is no more 'inout half4 color'. Effects return their output color.
If an effect wants the input color, it must use the (already existing)
approach of sampling a nullptr input shader.

The change is guarded for Chromium (so we can update their runtime color
filters in skia_renderer.cc).

For the GPU backend, FPs can now override usesExplicitReturn to indicate
that their emitCode will generate a return statement. If that's true,
then writeProcessorFunction doesn't inject the automatic return of the
output color, and emitFragProc will *always* wrap that FP in a helper
function, even as a top-level FP. GrSkSLFP opts in to this behavior, so
that the user-supplied return becomes the actual return in the FP's
emitCode.

Adapting the skvm code to this wasn't too bad: It looks fragile (what
happens if there are multiple returns?), but that's not really possible
today, without varying control flow.

Bug: skia:10613

Change-Id: I205b81fd87dd32bab30b6d6d5fc78853485da036
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310756
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-25 13:36:28 +00:00
John Stiles
b8f10b7bb7 Reland "Add a patch and an atlas to the ImageFilter GM slide."
This is a reland of 0baaa23722

Original change's description:
> Add a patch and an atlas to the ImageFilter GM slide.
>
> This exposes a recently-discovered issue where image filters were not
> always applied to some types of canvas draws.
>
> Change-Id: I17ef000d067ad2a41f06ff6e2220ea9915db6f99
> Bug: skia:10660
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312842
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

Bug: skia:10660
Change-Id: Ia6c9278be6e920c1217a89593e4007c2ed0e8af7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312887
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-24 23:19:31 +00:00
John Stiles
84cdc27399 Revert "Add a patch and an atlas to the ImageFilter GM slide."
This reverts commit 0baaa23722.

Reason for revert: MSAN bot issue

Original change's description:
> Add a patch and an atlas to the ImageFilter GM slide.
> 
> This exposes a recently-discovered issue where image filters were not
> always applied to some types of canvas draws.
> 
> Change-Id: I17ef000d067ad2a41f06ff6e2220ea9915db6f99
> Bug: skia:10660
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312842
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

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

Change-Id: I9c672de3e0d14a183b1f64475b56331754a9fe7e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10660
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312883
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-08-24 21:38:13 +00:00
John Stiles
0baaa23722 Add a patch and an atlas to the ImageFilter GM slide.
This exposes a recently-discovered issue where image filters were not
always applied to some types of canvas draws.

Change-Id: I17ef000d067ad2a41f06ff6e2220ea9915db6f99
Bug: skia:10660
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312842
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-08-24 20:37:33 +00:00
Mike Reed
58cc97a11f Use factories to avoid using (deprecated) path editing methods
Change-Id: Iae9944f6bba5a91c4643b3c3745c4c352bd07a17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312845
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-08-24 19:53:13 +00:00
Ben Wagner
1968473fea Move fontmgr_bounds labels to tight bounds
The font bounds may be empty, so label the tight bounds instead,
especially since the labels are of the glyph id that touches that edge
of the tight bounds. Also rotate the labels so they dont' run into each
other.

This also fixes SkMetaData::set so that changing an existing value
doesn't cause strange issues with iterators or attempt to use data from
the previous rec after it's been freed. (Found by running viewer in a
asan build.)

Change-Id: Id255beff5d05310f098bd14baf0935e5fd349e7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312494
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-08-24 15:02:44 +00:00
Brian Salomon
87d42e5d12 A new way to specify YUVA planar data from SkCodec to SkImage_Lazy
Tunnels through SkImageGenerator as well.

The new SkCodec interface doesn't assume three 8 bit planes.

New SkYUVASpec more clearly defines chroma subsampling and siting of
the planes.

The intent is to use this for other YUVA APIs as well, in particular
SkImage factories in the future.

In this change we convert to the SkYUVASpec to SkYUVASizeInfo
and SkYUVAIndex[4] representation. But the intent is to use
the SkYUVASpec representation throughout the pipeline once
legacy APIs are removed.

orientation GM is replicated to test a variety of chroma
subsampling configs.

Bug: skia:10632

Change-Id: I3fad35752b87cac16c51b24824331f2ae7d458d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309658
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2020-08-24 14:25:32 +00:00
John Stiles
3215385aeb Disable ClangTidy namespace comments for short blocks.
Namespace comments don't assist readability for blocks that can easily
fit on a single screen.

Change-Id: I93cbebe8e51400dead794c9eb41cb1eaa86bf756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312639
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-08-24 14:01:22 +00:00
Mike Reed
d16d654762 use pathbuilder
Change-Id: I996e4ad9a603db42d9ae750488db44ee3e84d742
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312637
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-08-22 19:33:32 +00:00
Mike Reed
457c6ddff0 remove unused enums for picture-recorder
Change-Id: I43e74a56d0aa68260ac9a9020a06a308ad75f694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312248
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-08-21 21:20:40 +00:00
Ben Wagner
8bd6c9830d Fixup fontmgr_bounds gm for variable fonts
Variable fonts don't vary the conservitive bounds so they get reported
as empty. Handle this by doing layout based on the join of the tight and
conservative bounds and draw both.

Change-Id: I6e980a2d20514d40a4b97ca55a647055c847c171
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312479
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-08-21 18:56:50 +00:00
Chris Dalton
71e2126a83 Add new tests to trickycubicstrokes
Adds cusps and flat beziers with 180 degree turns that confuse the
new tessellator.

Bug: skia:10419
Change-Id: I2529780da596fe365c1d2825e29145beedf5cb01
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312118
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-08-20 16:36:02 +00:00
Ben Wagner
81eabce6a3 SkCustomTypefaceBuilder to set SkFontStyle
Allow the user of SkCustomTypefaceBuilder to set the SkFontStyle of the
resulting SkTypeface. This allows users to build font families.

Fix the Font_flatten test to actually work (instead of relying on the
magic behavior of nullptr for SkTypeface), add a test with the custom
typeface, and reduce the number of times the inner loop runs from
302,400 times to 4,032 times so that the test finishes in a reasonable
amount of time.

Bug: skia:10630
Change-Id: I0b5e939552ee4a9a1249eefbb7a7279a59b38e5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311596
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Xiao Yu <xster@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-19 00:09:55 +00:00
Mike Reed
e9d783c4d2 use pathbuilder
Change-Id: I4b40107b45cd829595e89d75e19fd063acee4221
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311106
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-08-17 22:05:00 +00:00
Ethan Nicholas
63d7ee398a SkSL now detects modifiers used in incorrect contexts
Change-Id: I3847a17450c3185284961f35064c4f225aeb8b61
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308769
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
2020-08-17 15:40:19 +00:00
Mike Reed
15a5403cd3 Migrate to using SkPathBuilder
Change-Id: I86a75670d7b919313747175ca3e49ef7472061fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310977
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-08-17 14:17:49 +00:00
John Stiles
a008b0fa8b Enable ClangTidy check readability-redundant-smartptr-get.
To my surprise, this even works with homegrown smart pointers (such as
SkTLazy).

https://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-smartptr-get.html

Find and remove redundant calls to smart pointer’s .get() method.

Examples:

  ptr.get()->Foo()  ==>  ptr->Foo()
  *ptr.get()  ==>  *ptr
  *ptr->get()  ==>  **ptr
  if (ptr.get() == nullptr) ... => if (ptr == nullptr) ...

Change-Id: I8ff541e0229656b4d8e875c8053a7e6138302547
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310976
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-16 15:56:48 +00:00
John Stiles
c1c3c6d70d Enable ClangTidy flag bugprone-suspicious-string-compare.
https://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-string-compare.html

Find suspicious usage of runtime string comparison functions.
This check is valid in C and C++.

Checks for calls with implicit comparator and proposed to
explicitly add it:

  if (strcmp(...))       // Implicitly compare to zero
  if (!strcmp(...))      // Won't warn
  if (strcmp(...) != 0)  // Won't warn

Checks that compare function results (i,e, strcmp) are compared to valid
constant. The resulting value is

  <  0    when lower than,
  >  0    when greater than,
  == 0    when equals.

A common mistake is to compare the result to 1 or -1:

  if (strcmp(...) == -1)  // Incorrect usage of the returned value.

Additionally, the check warns if the results value is implicitly cast
to a suspicious non-integer type. It’s happening when the returned
value is used in a wrong context:

  if (strcmp(...) < 0.)  // Incorrect usage of the returned value.

Change-Id: I001b88d06cc4f3eb5846103885be675f9b78e126
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310761
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-16 03:54:08 +00:00