Commit Graph

22670 Commits

Author SHA1 Message Date
Michael Ludwig
4bf964602a Update SkCanvas' experimental SkiaRenderer API
This lifts the temporary functions in SkGpuDevice into SkCanvas and
deprecates the older experimental_DrawImageSetV1 and
experimental_DrawEdgeAARect.  The new functions can handle paints and
transform batching. Internally, SkCanvas routes the old functions to the
new entry points and all device-level code is updated to handle the new
API features.

While touching all of the canvas/device/recording areas, the
experimental functions are grouped in an "EdgeAA" cluster instead of being
separated into the image category and the rectangle category.

Bug: skia:8739
Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-14 14:24:11 +00:00
Mike Klein
539909a84a remove plus clamp
Clamping for plus mode should happen only as the destination format
requires it, or as a consequence of the limited range we're holding
colors in the pipeline, or because non-normalized alpha is nuts.

So I've taken away the clamp on float rgb, keeping it on lowp to stay
in its legal range, and on float alpha because it's crazy not to.

Open questions:
  - also clamp alpha to zero?
  - what do we do with alpha <0 or >1 in general, beyond plus?

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I15660ce55cc393e312f18ffdc13bbfdef08ac6e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201040
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-03-14 13:53:19 +00:00
Brian Salomon
1d835423e1 Reland "Try to avoid vertex colors in Texture/FillRect ops when possible."
This is a reland of e0b989e5e3

Original change's description:
> Try to avoid vertex colors in Texture/FillRect ops when possible.
> 
> Avoids unnecessary fragment shader color multiplication.
> 
> Change-Id: I353d3ca91824ce20c9e9af1c5c84ab9953ddd8ab
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201004
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>

Change-Id: I22125cb7058f528cb368ff30c3c26e3d55056e66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201222
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-14 13:48:14 +00:00
Mike Reed
1386b2d557 pass common SkStageRec to all effects using rasterpipeline
- shaders
- colorfilters
- mixers

Bug: skia:
Change-Id: Ife2fabd1171228ea9fb154efab3537fd0ddb4a6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200933
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-14 01:45:13 +00:00
Brian Salomon
368ea4f99e Revert "Try to avoid vertex colors in Texture/FillRect ops when possible."
This reverts commit e0b989e5e3.

Reason for revert: gms

Original change's description:
> Try to avoid vertex colors in Texture/FillRect ops when possible.
> 
> Avoids unnecessary fragment shader color multiplication.
> 
> Change-Id: I353d3ca91824ce20c9e9af1c5c84ab9953ddd8ab
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201004
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: I42b37e50c1c0185d8f8a52984c9350464004880e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201081
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-14 00:26:24 +00:00
Brian Salomon
e0b989e5e3 Try to avoid vertex colors in Texture/FillRect ops when possible.
Avoids unnecessary fragment shader color multiplication.

Change-Id: I353d3ca91824ce20c9e9af1c5c84ab9953ddd8ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201004
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-03-13 21:43:23 +00:00
Herb Derby
4e6073662b Fallback for source should not use sub-pixel positioning.
Current bad behavior, the code asks for a glyph that is
sub-pixel position in source space. It later renders the
glyph using the actual sub-pixel positioning in device space.

This changes the behavior to ask for an non-sub-pixel positioned
glyph in source space.

Change-Id: Idf29a82f79cb551ced2db5ffd7774c526147ccac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200937
Auto-Submit: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-03-13 21:42:43 +00:00
Mike Reed
8bcd12892d assert that during restore, the layer and its parent are in the same colorspace
Bug: skia:8773
Change-Id: Ie02efaac2d20cdb9c903cfd1e11eca958c3aca48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201003
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-13 21:15:53 +00:00
Herb Derby
36f6608183 Use bulk api in direct-to-screen fallback
Change-Id: If1fa6118a9c6c9f7d4589942d890257f1fb581ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200936
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-03-13 19:43:21 +00:00
Adrienne Walker
21bda79ca3 Fix uninitialized read in too small SkDescriptor
Bug: chromium:941542
Change-Id: I2054b0e1f94553caa70367f2b1b6c7e17a6ecd1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200938
Commit-Queue: Adrienne Walker <enne@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Adrienne Walker <enne@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-13 18:31:21 +00:00
Chris Dalton
7d6748ed13 Remove GrAAType::kMixedSamples
Our only use case for mixed samples is stencil-then-cover. This mode
is now handled by AATypeFlags::kMixedSampledStencilThenCover.

Bug: skia:
Change-Id: Id7431cf83ccb20752d1bc85c6ad41efe408e0359
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200841
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-13 18:20:21 +00:00
Chris Dalton
09e56897ab Replace GrAAType with flags for path renderers
Replaces the single GrAAType with a set of flags indicating which AA
types are acceptable for the path renderer to use.

Bug: skia:
Change-Id: I773565c904a360355e771966b6cddba697e1165f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200840
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-13 18:07:51 +00:00
Mike Klein
be3929daf6 reland: add private non-copying SkReadBuffer::readString()
PS1 is https://skia-review.googlesource.com/c/skia/+/171220
PS2 checks for a bad name.

Bug: oss-fuzz:13706, chromium:941425
Change-Id: Ia11a96a755d8d55327c758ef97a055a472035644
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200941
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-13 17:18:41 +00:00
Brian Osman
e22dba8d5e Clamp in GrBicubicEffect (to match SW and for general sanity)
Bug: skia:8809
Change-Id: I9f5b6428113602929b3a1b45c25b623e8da0e264
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200512
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-13 14:46:11 +00:00
Mike Klein
08e6bd4e6c Revert "add private non-copying SkReadBuffer::readString()"
This reverts commit 232783f0c5.

Reason for revert: several fuzzers find nullptr deref.  Will investigate and reland.

Original change's description:
> add private non-copying SkReadBuffer::readString()
> 
> ... and use it when looking up deserialized type factories.
> 
> Change-Id: I23d6dd549d4258908a961971a8de380776c91e1c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/171220
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>

TBR=mtklein@google.com,khushalsagar@chromium.org

Change-Id: I552f8de413dd52e1480c8ce1e7e84a072a54cb93
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200940
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-03-13 14:11:42 +00:00
Herb Derby
fbf260df76 Check that a glyph will fit in the atlas instead of a bogus check
I made a transcription error about 7 mo. ago. This corrects the error.

Change-Id: Icbe814a9e44748778bf988840fc2fc7ab9e8fa86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200500
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-03-13 13:20:51 +00:00
Mike Reed
b070bc9947 retain colorspace in blurimagefilter_raster
Bug: skia:8773
Change-Id: Id6c84f1216c6e6dcd455fe57e661bcb734899b86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200601
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-03-12 22:32:45 +00:00
Adrienne Walker
dc087c60f6 Fix null pointer crash in looking up nonexistent typeface
Bug: chromium:939762
Change-Id: Id9f6ae3c4965069d1ee585f405036e6fe6226c12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200600
Auto-Submit: Adrienne Walker <enne@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-12 22:24:44 +00:00
Herb Derby
e8d2d013a1 Introduce bulk strike api for glyph metrics for one draw case
The strike system can determine which glyphs are important,
and will only put the important glyphs into the result.

This is only used in the draw mask case now. I will expand it to
the other cases. I'm leaving the existing abi inteact until all
cases are converted.

Change-Id: I8c5e785ccd4341adfb09888532bf7b690ffb91d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200048
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-03-12 22:04:14 +00:00
Mike Reed
bf66ed3063 remove dead SK_SUPPORT_LEGACY_RASTERLAYERCOLORSPACE code
Bug: skia:
Change-Id: I2a7300fc29bcbff109cc33e277ffbb1fa9d6d94c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200513
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-03-12 21:54:46 +00:00
Adrienne Walker
08b0c97aa9 Add validation to reading kRec_SkDescriptorTags
Bug: chromium:940284, chromium:940843
Change-Id: Id6ce237781c6515f52341d3e56614e13e8ba76d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200045
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Adrienne Walker <enne@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-12 21:14:04 +00:00
Herb Derby
44b3519381 Move GlyphAndPos and PathAndPos to interface and rename.
GlyphAndPos -> SkGlyphPos
PathAndPos -> SkPathPos

Change-Id: I64da3bd8327ee60065cacf5d20f7eb6dc75c68aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200511
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-12 20:39:34 +00:00
Mike Klein
dadac55c7f simplify matrix color filter clamps
We must keep alpha sanely [0,1].

This makes the existing clamps unconditional, which seems the most
compatible with our clients' expectations, and which makes the CPU
backend agree with the GPU backend.

I'm not sure I've got a more principled reason to clamp than those.

Clamping means we can't really concatenate these into a new matrix
filter ever, deleting a bunch of code supporting that and a few
unit tests that thought we could.

(Good candidate for a user-defined effect with user-defined clamping.)

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: Ib92a4c882320e65ae705833bf623e4e961bc6651
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200394
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-03-12 20:29:11 +00:00
Mike Reed
c723b70d91 Initial add SkMixers
Just using with composeshader for now, plan to try that sort of generalization
for colorfilters and imagefilters in follow-on cls.

Bug: skia:
Change-Id: Ic9650b8ea6f6278e6bfd657e90befbf9e71f383c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198823
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-12 20:27:12 +00:00
Mike Klein
232783f0c5 add private non-copying SkReadBuffer::readString()
... and use it when looking up deserialized type factories.

Change-Id: I23d6dd549d4258908a961971a8de380776c91e1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/171220
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
2019-03-12 20:22:56 +00:00
Khushal
b6b8ad3b2f remote fonts: Remove debug asserts for deserialization failures.
The fuzzers are tripping on these asserts.

Bug: 940370
Change-Id: I08adfa5b9b3e083f3671bd9a5e952f26860e185f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199960
Auto-Submit: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-03-12 20:17:51 +00:00
Ethan Nicholas
4100b7cad2 added SK_API to SkSK::Compiler
Bug: skia:
Change-Id: If7c2941ec1c266ecee08894c5284e9434de1ef91
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200463
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-12 20:16:51 +00:00
Mike Klein
aa42ac6afc remove unused clamp_a_dst
Change-Id: Ic94bb9082d9f140069bb9a2c528816887752fbaf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200548
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-12 20:09:11 +00:00
Robert Phillips
570f4e51fd Always explicitly allocate except in Android Framework (take 3)
This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.

We want:
  Flutter and Chrome to always explicitly allocate but not sort opLists outside of DDLs
  Android to never explicitly allocate and, thus, automatically never sort opLists

This needs the following Chrome suppression CL to land first:
https://chromium-review.googlesource.com/c/chromium/src/+/15182 (Add flag to skia/config/SkUserConfig.h to unblock Skia roll)

TBR=bsalomon@google.com
Change-Id: I3f51005ebc975ec754c2e0d2c646c0c324b02158
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200507
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 19:37:21 +00:00
Mike Klein
61770d8a99 simplify filterColor()
This implementation also pins.

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: Icd6764ffc967dcebb8a46e8a7727c8e7f3f23ec0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200397
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-12 17:55:51 +00:00
Robert Phillips
2a2d732c39 Revert "Always explicitly allocate except in Android Framework (take 2)"
This reverts commit 88b93da63d.

Reason for revert: Chrome

Original change's description:
> Always explicitly allocate except in Android Framework (take 2)
> 
> This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.
> 
> We want:
>   Flutter and Chrome to always explicitly allocate but not sort opLists outside of DDLs
>   Android to never explicitly allocate and, thus, automatically never sort opLists
> 
> This cannot land until after the following Chrome CL lands:
> 
> https://chromium-review.googlesource.com/c/chromium/src/+/1516096 (Disable opList sorting within Skia)
> 
> 
> Change-Id: Ic7d6a1a77a08f2fe42324773f62cccf8175ab3d7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199931
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ida481ee9833d6db366b3d315fb4e9850d7c005ab
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200506
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 16:29:43 +00:00
Robert Phillips
60dd62ba20 Revert "Always try to reduce opList splitting in DDL contexts/drawingManagers"
This reverts commit 2cce805f1f.

Reason for revert: Chrome

Original change's description:
> Always try to reduce opList splitting in DDL contexts/drawingManagers
> 
> This may get us in trouble w/ local DDL testing (since we run all our GMs through DDLs). For Chrome this shouldn't yet be a problem (since they are only using DDLs for compositing).
> 
> This does mean we're on a tight timeline to land predictive intermediate flushes before Chrome starts using DDLs for rasterization.
> 
> Change-Id: I0bb95c075cff3ee49498ff267d76c3a61d16373e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199722
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: Idb2dbda1a41844b2541526d504b117fd4cd628cc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200505
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 16:29:14 +00:00
Robert Phillips
2cce805f1f Always try to reduce opList splitting in DDL contexts/drawingManagers
This may get us in trouble w/ local DDL testing (since we run all our GMs through DDLs). For Chrome this shouldn't yet be a problem (since they are only using DDLs for compositing).

This does mean we're on a tight timeline to land predictive intermediate flushes before Chrome starts using DDLs for rasterization.

Change-Id: I0bb95c075cff3ee49498ff267d76c3a61d16373e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199722
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 15:37:20 +00:00
Greg Kaiser
2f3b0dd0d3 GrQuadPerEdgeAA: Fix typo in 'if' check
We were checking d1And2[2] twice, and not checking d1And2[3] at
all.  We fix this to check each of them once.

Change-Id: Ib44dfcb2643ce2758917763f048d93e8f39fd8d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200389
Auto-Submit: Greg Kaiser <gkaiser@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-03-12 14:18:28 +00:00
Brian Salomon
d0e1ceffcc Revert "Reintroduce deinstantiate lazy proxy types and use for promise images."
This reverts commit 8b40ac35b2.

Reason for revert: breaks viz_unittests

Original change's description:
> Reintroduce deinstantiate lazy proxy types and use for promise images.
> 
> This reverts a fraction of b2c5dae65d to
> restore the deinstantiate lazy proxy type, supporting implementation,
> and tests.
> 
> Use them for promise images to avoid thread safety issues for promise
> image resources. Makes promise image instantiation callbacks do a thread
> safe unref of their fulfilled GrTexture in GrResourceCache. The
> GrResourceCache mechanism for receiving unref messages is extended to
> allow multiple pending unrefs. All this is new.
> 
> 
> Bug: skia:8800
> Change-Id: I7b1d4fea13c053b6fbbd39c0c6eaf567b8bf81f1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199002
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Iba960efba4290a284294c62d0470ad7e932c174a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-12 13:37:21 +00:00
Robert Phillips
88b93da63d Always explicitly allocate except in Android Framework (take 2)
This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.

We want:
  Flutter and Chrome to always explicitly allocate but not sort opLists outside of DDLs
  Android to never explicitly allocate and, thus, automatically never sort opLists

This cannot land until after the following Chrome CL lands:

https://chromium-review.googlesource.com/c/chromium/src/+/1516096 (Disable opList sorting within Skia)


Change-Id: Ic7d6a1a77a08f2fe42324773f62cccf8175ab3d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199931
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 13:25:28 +00:00
Brian Osman
e938c92fe7 Remove SkToSRGBColorFilter (now unused)
This was another stop-gap color management "solution".

Bug: skia:
Change-Id: I7c0c362840dd35aad51ad8780f2dab591c42a7e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199720
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-12 13:19:28 +00:00
Brian Salomon
8b40ac35b2 Reintroduce deinstantiate lazy proxy types and use for promise images.
This reverts a fraction of b2c5dae65d to
restore the deinstantiate lazy proxy type, supporting implementation,
and tests.

Use them for promise images to avoid thread safety issues for promise
image resources. Makes promise image instantiation callbacks do a thread
safe unref of their fulfilled GrTexture in GrResourceCache. The
GrResourceCache mechanism for receiving unref messages is extended to
allow multiple pending unrefs. All this is new.


Bug: skia:8800
Change-Id: I7b1d4fea13c053b6fbbd39c0c6eaf567b8bf81f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199002
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-11 20:48:22 +00:00
Brian Osman
d0626aa0c4 Add clamped half-float pixel config to Ganesh
Currently doesn't do any clamping, but connects the new config to the
recently added SkColorType. Behavioral changes coming in future CLs.

Bug: skia:
Change-Id: I907396030c435d0aa5931063b3dc6f1b60c661af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199980
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-11 20:09:07 +00:00
Michael Ludwig
e6266a2d16 Handle arbitrary and degenerate quadrilaterals in GrQuadPerEdgeAA
Updates the handling of perspective quads to calculate the correct,
degenerate-safe projected quad and then derive from that the proper
perspective quad.

In 2D, updated to determine if the optimized outset/inset procedure
is valid, and if not goes through a more robust procedure that is
based on line equation intersections. In particular, the degenerate
inset/outset approach is used when the quad has a zero-length edge,
if insetting/outsetting normally would create a self-intersecting shape,
or if near parallel edge angles would create numerical instabilities.

Performance testing by forcing all rectangle draws through the degenerate
code path suggests that it is about 10% slower than the optimal approach,
at least on my workstation...

Bug: skia:
Change-Id: I2973da8d97949eacebb09a1b27c334d62c1c948e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/194008
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-03-11 20:04:03 +00:00
Herb Derby
4eff3f934d One routine to rule them all!
Change-Id: I6c448f325fca21c4919c0a0854d9d5cb9d54beb0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198661
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-11 19:36:41 +00:00
Mike Reed
ca9b2082d1 rename mixer to lerp (in prep for SkMixer)
Bug: skia:
Change-Id: I55d879dd76e10c8ef9a01f2dd7cff725e8a82433
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199932
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-03-11 19:32:31 +00:00
Robert Phillips
d40dc3f81b Revert "Always explicitly allocate except in Android Framework"
This reverts commit e157745dfc.

Reason for revert: Too exciting

Original change's description:
> Always explicitly allocate except in Android Framework
> 
> This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.
> 
> 
> Change-Id: Idc02985e52f074894a251c7335ef00b009c72ccd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199725
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: Icb097844de6db92e8151c81616a758837ecd9dfc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199929
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-11 18:41:22 +00:00
Herb Derby
ac962c9c42 Convert templates to virtuals in SkGlyphRunPainter
This removes a bunch of duplicate code, and visual cluter.
And, sets up for the next CL which unifies the SDF/Path
decisions.

* unify some parameter naming

Change-Id: Ic654dc20b22f5414834730a0c34f47608d73491a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199281
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-11 18:14:53 +00:00
Robert Phillips
e157745dfc Always explicitly allocate except in Android Framework
This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.


Change-Id: Idc02985e52f074894a251c7335ef00b009c72ccd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199725
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-11 17:22:31 +00:00
Jim Van Verth
444b3094ad Improve Metal texture uploads.
Switches to using buffers rather than managed textures. The result
is much faster as it does the swizzling work on the GPU rather than
the CPU.

Bug: skia:
Change-Id: I3e708e2f15830c47b2d0ceb48eed5ab841864af6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199258
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-03-11 16:23:31 +00:00
Greg Daniel
387ec9ae82 Make vulkan GrBackendFormats with ycbcr external texture types.
Bug: skia:
Change-Id: I58b5cc2a3e03404f05de9644eb4e459a7a9a9ebb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199001
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-03-11 14:01:20 +00:00
Robert Phillips
0a22ba84e0 Add kIdentity_SkYUVColorSpace
This utility color space just maps Y to R, U to G and V to B when flattening or accessing the YUV planes. Clients can then add a colorFilter to directly manipulate the YUV values.

This cannot land in Skia until the following CL lands in Chrome:

https://chromium-review.googlesource.com/c/chromium/src/+/1506004 (Update usage of Skia's SkYUVColorSpace enum to allow the addition of a new value)

Change-Id: Id9403ebbd009b45281d4d53fca52f68692d6c69f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198160
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-11 13:47:40 +00:00
Nigel Tao
e66a0b212a Check that we do not #define WUFFS_IMPLEMENTATION
Bug: skia:8235
Change-Id: Ie36301acf1779c8c33f69d9dfc986562d96992c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199441
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-03-11 13:01:10 +00:00
Nigel Tao
48aa221e60 Update Wuffs version
Also re-write some C "designated initializer" expressions in
SkWuffsCodec.cpp. They may be valid C (C99), but are not necessarily
valid C++. Even though GCC and Clang extends C++ to accept them,
Microsoft Visual C++ does not.

This pulls in the Wuffs bug fix:
c4b8a6a4cc
"Don't use designated initializers".

Bug: skia:8235
Bug: skia:8764
Change-Id: I57be56ce0b7f5bc1eb38ecc113a9b7ad7d2e373b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199440
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-03-11 12:51:00 +00:00
Robert Phillips
56181ba452 Make DDL contexts/drawing managers always sort opLists
We want:
  DDLs to always be sorted
  Live rendering to still be sorted w/in Skia
  Live rendering to still not be sorted in Chrome and Android

Additionally, we want reduced-opList-splitting to only be enabled on some of Skia's bots.

Change-Id: I15e7d69c7e109749665a86a0169ad918c993dc77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199244
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-08 18:40:17 +00:00
Mike Reed
5e398c2b5e change load/store_rgba to have src and dst variants
somewhat motivated by future mixer stages

Bug: skia:
Change-Id: Icd41ec9311f0da966164451324d28e7b3dfb3213
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199280
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-03-08 17:24:33 +00:00
Ethan Nicholas
03896ae9ce Fixed a couple of Vulkan bugs
There was a bad test in GrVkImage, and the test in SkSLVariable was
allowing interface variables to be declared dead, which was probably
not a serious problem but was causing the debug layers to whine.

Bug: skia:8837
Change-Id: I233372ae45b575949b7c8f92b119b86e649f3142
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199060
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-03-08 14:18:03 +00:00
Brian Osman
dbfcd92d5f Fix two SkPathRef bugs
- Transforming a path in place wasn't updating the gen ID of the path
- Transforming a path into another (uniquely held) path wasn't calling
  gen ID change listeners.

Bug: skia:
Change-Id: I9e244725d9bd5776d203ce6b12698cee09d0b714
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199003
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-03-07 22:59:28 +00:00
Chris Dalton
d7291ba7a1 Restore support for multisample locations
Bug: skia:
Change-Id: I971455867e54d431cc1094fca041f773f78748ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196218
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-07 22:00:48 +00:00
Jim Van Verth
61610bebdf Add Autorelease pools to clear out no longer needed Metal objects.
Bug: skia:8822
Change-Id: I2bb3528100a54a169ec9c5b26ef7d4d1cacc19db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198244
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-03-07 21:05:08 +00:00
Ethan Nicholas
5476f2e9b8 added constant swizzle support for Metal
Bug: skia:
Change-Id: Ia7d81920ddc341aa40da6af534d846f3e805a109
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192031
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-03-07 20:47:04 +00:00
Ethan Nicholas
858feccb58 Got RelaxedPrecision decorations working again in SPIR-V, and removed
no-longer-needed old-style precision handling code.

Bug: skia:8829
Change-Id: I72fc2ee2a305c9c72a3efa92dd44d18239eabaf2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198169
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-03-07 19:56:59 +00:00
Brian Osman
1132f74e11 Add F16Norm support to a few more pixmap helpers
Bug: skia:
Change-Id: I86fd67a792ddfc456e8dd553d9012ed9bc9101f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198822
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-07 19:33:19 +00:00
Brian Osman
dfddf340c1 Fix bit-depth selection for picture shader playback with F16Norm
Bug: skia:
Change-Id: Ic85817901ffd30faf6ba40f1b14a507ed1dd2e8f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198821
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-07 18:59:09 +00:00
Mike Klein
47750765d2 treat F16Norm like F16 as far as SW tranfer functions go
Change-Id: I5dd9ad47fc43d4ba859c6b8f1253e1788258c48e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198761
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-07 18:28:59 +00:00
Mike Klein
22504dea79 add pause to SkSpinlock::contendedAcquire on Intel
Popping off work to run in the thread pool is my bottleneck running DM
on a P920.  The long-term fix there is probably to restructure the
thread pool to work-steal, but adding this little pause to the contended
spin does make a noticeable improvement on its own.  It's what
_mm_pause() is designed for, after all.

Change-Id: I09ab3a940547e5c4b4b2fa1f3f945f08aed47b99
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198620
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-03-07 17:06:29 +00:00
Mike Reed
2539429036 undo old colorspace hacks related to savelayers
... there appears also to be a bug in the 'global' imagefiltercache,
where it doesn't respect the outputProps colorspace..?

Bug: skia:8793, skia:8830
Change-Id: Ib8a113fa21eae5f581b44b051a790be9133aa411
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198247
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-07 16:26:49 +00:00
Brian Salomon
88b8d1124b Revert "Distinguish between "flushed" and "finished" idle state callbacks on GrTexture."
This reverts commit 9ac0407006.

Reason for revert: Breaking DDL Win10 skpbench bot

Original change's description:
> Distinguish between "flushed" and "finished" idle state callbacks on GrTexture.
> 
> This is necessary to convert the promise image API to call Release when all
> work is flushed and Done when all work is complete (future work).
> 
> Change-Id: I9745952bb0978ca2aaa79aeed460730b2fea856e
> Bug: skia:8800
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197163
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

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

Bug: skia:8800
Change-Id: I5e6c4ea072beb4fb67a53d2ea2b007a7d201799d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198603
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-07 15:47:59 +00:00
Brian Salomon
d716d4402a Revert "Change promise image contract to for when Release and Done are called."
This reverts commit c5e8e150c8.

Reason for revert: Reverting to revert 9ac0407006 https://skia-review.googlesource.com/c/skia/+/197163


Original change's description:
> Change promise image contract to for when Release and Done are called.
> 
> Now Release is called when all work related to the SkImage is flushed
> and Done is called when it is finished on the GPU in Vulkan. In GL they
> are still both called back-to-back after flushing.
> 
> Bug: skia:8800
> Change-Id: I990be7b9ebef8411590afd860ef40511fb5fee32
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198165
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I13e8211d89ed1b7694c2d7734eeaaf4ba9ad410a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198602
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-07 15:23:41 +00:00
Herb Derby
a677af71b2 Removed unused fallback code
Change-Id: I2dc9cde4bd7b7b54e7de677455b38fb3c9b86edb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198242
Auto-Submit: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-07 15:21:09 +00:00
Mike Klein
be27245416 fix f16norm mips
Change-Id: Ibfcf5e3aba33800e6f63de633cbde197a3b17057
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198222
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-07 15:03:59 +00:00
Brian Salomon
c5e8e150c8 Change promise image contract to for when Release and Done are called.
Now Release is called when all work related to the SkImage is flushed
and Done is called when it is finished on the GPU in Vulkan. In GL they
are still both called back-to-back after flushing.

Bug: skia:8800
Change-Id: I990be7b9ebef8411590afd860ef40511fb5fee32
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198165
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-07 13:43:59 +00:00
Mike Reed
b8b05e6be0 remove dead SK_SUPPORT_LEGACY_CHOOSERASTERPIPELINE code
Bug: skia:8793
Change-Id: I6f7f794f3734b709383ad73402cf1042cc2d68f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198251
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-07 12:26:29 +00:00
Herb Derby
692122e3ef Don't apply the view matrix twice for complicated fallback
In complicated fallback the matrix was being applied to create
the glyph cache and then rendering to the screen. Create the
glyphs with the identity matrix.

Change-Id: Ib399726ef73257f2890784c1f4ad598fef074ab3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198248
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-03-07 02:39:08 +00:00
Florin Malita
34336e3633 Make SkCubicMap immutable
Drop setter, only keep the parameterized constructor.

Change-Id: I31517df23688b8bd7485bf70c9c055cd1c87edcf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198245
Auto-Submit: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-03-06 22:55:08 +00:00
Florin Malita
93092ff457 Make SkCubicMap public
Bug: skia:8803
Change-Id: I3aa0814d538d95dc3a5a1034993b823d2151ab85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/193961
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-06 19:58:28 +00:00
Jim Van Verth
ae336bda8f Another stab at MTLRenderCommandEncoder memory leak.
Allocating the MTLRenderCommandEncoder within a separate method seems
to add an unwanted retain, which leaves the refCnt stuck at 1 even
when we set the pointer to nil (the __strong keyword was a red herring).
Allocating and setting to nil within the same method seems to give the
right number of retain/release pairs.

Bug: skia:8243
Change-Id: Ic9a7180915e2753565d706b42d4d07eedb42519e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198175
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-03-06 19:35:53 +00:00
Herb Derby
cc6cd85b6f Fix: set SDFT if there is only fallback
If in the SDFT case, and emoji only the SDFT flag must be set
to make the mustRegenerate work correctly.

Change-Id: I48cbea699e44cf5721e841c81eb57d4b9fa026a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198171
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-03-06 19:18:08 +00:00
Herb Derby
c72594a1cf Move process* closures into the GrTextBlob
Change-Id: I8614a7d267940ec5f000ffdb50833ce50c0df774
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197850
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-03-06 16:40:17 +00:00
Hal Canary
2a3093c154 SkPDF: Add experimental Harfbuzz font subsetter
Currently hidden behind gn flag:  skia_pdf_subset_harfbuzz

Replaces Sfntly subsetter.

TODO:
  1) Test on all clients.
  2) Enable on each client.
  3) Set skia_pdf_subset_harfbuzz default to true,
  4) Delete sfntly dependency.

Bug: chromium:931719
Change-Id: I5c763ce3e6b21d6bc65284d4105b9974e0907cdc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/171223
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-03-06 16:30:56 +00:00
Jim Van Verth
2e4287f543 Fix stencil setup in Metal
We could have a case where stencil is disabled but the framebuffer
has a stencil buffer, and the framebuffer and pipeline must match.

Bug: skia:8243
Change-Id: I460543392ffaf7198d693fd067fbdc96cda71fd3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197764
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-03-06 15:20:57 +00:00
Greg Daniel
b085fa9c8c Add ddl support to drawing to wrapped vulkan secondary command buffers.
Bug: skia:
Change-Id: I3ddb6b1e923b8c1733b6a0e219efffa36e665fa2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/189282
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-06 14:47:26 +00:00
Nigel Tao
e39c88495c SkWuffsCodec: replace memset+check_wuffs_version
check_wuffs_version is deprecated.

Bug: skia:8235
Change-Id: Ie4e99976318e0b831ecb2c04699fa2e5648c9813
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/195780
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-03-06 14:16:16 +00:00
Robert Phillips
8defcc15b1 Update YUVA mipmap generation path to take a GrRecordingContext
Again, SkImage-derived objects will only have native access to an image context. Passing in a recording context captures when the mipmaps will be generated.

Change-Id: I025845ee4ea6bd97aa6001c1de316e394e7c5817
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197768
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-06 13:14:16 +00:00
Khushal
624cec68e4 remote fonts: Ensure consistent gamma usage with remote and gpu fonts.
R=herb@google.com, mtklein@google.com

Change-Id: Id5e259e78fdf1c2b609ec6717b754665d48a9c43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197280
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
Auto-Submit: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-05 22:54:45 +00:00
Michael Ludwig
7ae2ab59f6 Support per-entry transforms in image-set API
Bug: skia:
Change-Id: I508ec8cb1df1c407853b401c73c66a575fb9c661
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196642
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-05 21:32:05 +00:00
Chris Dalton
b8fff0dfce Make mixed samples detection automatic
Previously, we relied on ops to deduce whether a draw would have
hardware coverage modulation as a result mixed samples. This is
problematic because *any* draw can have mixed samples coverage if
there is a multisampled stencil clip. No ops were checking for stencil
clip, and most just said they never used mixed samples.

Now that the only usecase for mixed samples is the stencil buffer,
this CL makes the processorSet automatically deduce mixed samples
coverage from the stencil settings and fsaaType.

Bug: skia:
Change-Id: Ib69b84bc03b12f6efb8e7d6ed721ae1612785315
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197281
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-05 21:27:15 +00:00
Herb Derby
a00da61c5d Pointer to GrStrikeCache on GrTextBlob
This will allow all the glyph drawing closures to live on the
GrTextBlob.

Other cleanup
* Rename glyphCache things to grStrikeCache.

Change-Id: I03e0353a1434230086a08184221272f1e5751ae6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197244
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-05 21:13:56 +00:00
Robert Phillips
6603a1743e Make SkImage_Base::asTextureProxyRef take a GrRecordingContext parameter
In future Ganesh the SkImage's will only have GrImageContexts. asTextureProxyRef, however, may need to perform some rendering thus requires an external GrRecordingContext.

Change-Id: I893573e9f3462b4c4cf5e29a7f8ee74027a2ce6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197134
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-05 19:49:40 +00:00
Brian Salomon
9ac0407006 Distinguish between "flushed" and "finished" idle state callbacks on GrTexture.
This is necessary to convert the promise image API to call Release when all
work is flushed and Done when all work is complete (future work).

Change-Id: I9745952bb0978ca2aaa79aeed460730b2fea856e
Bug: skia:8800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197163
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-05 19:49:00 +00:00
Brian Salomon
2ca31f8de2 Use GrSurface::setRelease helper that creates ref-counted wrapper
Change-Id: Ic748ee18d6cdf7d7b83a89ad6ec580be96bc305b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197769
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-05 19:43:55 +00:00
Chris Dalton
ff8065c2d2 Make sure to apply the stencil settings for GrDashOp
Bug: skia:8807
Change-Id: I0389d4836382aac289732effb41221e84978cc66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197789
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-05 18:23:03 +00:00
Herb Derby
d3898b987d Have SkGlyphRunListPainter close over SkStrikeCacheInterface
Change-Id: I7b07cc7f7fc4335fd614b45c7d19bdefe55fe8e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197165
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-05 16:47:45 +00:00
Ben Wagner
68efb2122d Clarify ownership of typefaces in implementation.
This converts a number of ownership semantics by using sk_sp and
unique_ptr instead of comments.

Change-Id: I4c584a5a8ea54fd22a4d23deddb5ce844f883117
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197206
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-03-05 16:20:45 +00:00
Ethan Nicholas
a70693b234 Add support for runtime color filters written in SkSL.
Bug: skia:
Change-Id: I9b930e81cff1c656908125dcf900279f73570204
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/195581
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-05 16:03:25 +00:00
Florin Malita
6041d315c7 Reland "SkMixerColorFilter GPU impl"
This reverts commit c2949ec67b.

Reason for revert: not related to crossfade

Original change's description:
> Revert "SkMixerColorFilter GPU impl"
> 
> This reverts commit e80f7eb9d6.
> 
> Reason for revert: break crossfade in chrome roll?
> 
> Original change's description:
> > SkMixerColorFilter GPU impl
> > 
> > Bug: skia:
> > Change-Id: Ia1e25e0c99737d9720c17f92f0d76a1cb7897ea8
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/193163
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,ethannicholas@google.com,fmalita@chromium.org,reed@google.com
> 
> Change-Id: Ib9464fcabc649b95ba131146690d6208af728436
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197760
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: Ie96e80e153aeab16c4ea35d5f1350372060228aa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197763
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-05 15:03:34 +00:00
Mike Reed
c2949ec67b Revert "SkMixerColorFilter GPU impl"
This reverts commit e80f7eb9d6.

Reason for revert: break crossfade in chrome roll?

Original change's description:
> SkMixerColorFilter GPU impl
> 
> Bug: skia:
> Change-Id: Ia1e25e0c99737d9720c17f92f0d76a1cb7897ea8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/193163
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ib9464fcabc649b95ba131146690d6208af728436
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197760
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-05 14:45:08 +00:00
Mike Reed
c9273997fd Reland "check if we can use legacy blits"
This reverts commit 2b28b1c12d.

Reason for revert: hmmm, maybe not

Original change's description:
> Revert "check if we can use legacy blits"
> 
> This reverts commit 5539390c53.
> 
> Reason for revert: broke chrome roll?
> 
> Original change's description:
> > check if we can use legacy blits
> > 
> > depends on https://skia-review.googlesource.com/c/skia/+/196647
> > 
> > Bug: skia:
> > Change-Id: I85ea7aac34558838d120c2c02abaaeebd77d8b8a
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196651
> > Reviewed-by: Mike Klein <mtklein@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
> 
> TBR=mtklein@google.com,brianosman@google.com,reed@google.com
> 
> Change-Id: Ib05f310e428145ffb79c27a077c8c31ef937487e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197658
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I14180cd0025a33a3c9c3cd8a1652e4a6cf8be141
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197659
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-05 14:42:56 +00:00
Mike Reed
2b28b1c12d Revert "check if we can use legacy blits"
This reverts commit 5539390c53.

Reason for revert: broke chrome roll?

Original change's description:
> check if we can use legacy blits
> 
> depends on https://skia-review.googlesource.com/c/skia/+/196647
> 
> Bug: skia:
> Change-Id: I85ea7aac34558838d120c2c02abaaeebd77d8b8a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196651
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: Ib05f310e428145ffb79c27a077c8c31ef937487e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197658
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-05 14:40:05 +00:00
Brian Osman
fbe9fa73f5 Remove dithering during SkConvertPixels
Now that https://chromium-review.googlesource.com/c/chromium/src/+/1495208
has landed, this is safe to land.

Bug: b/124403051 skia:8787
Change-Id: I087cd2313343229176a1814c2097dbe8f77620cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/195886
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-05 14:23:22 +00:00
Jim Van Verth
6e8174e957 Fix issue with offsetting polygon by 0 distance.
Need to output matching indices as well.

Bug: skia:13417, chromium:937412
Change-Id: I251a70eb07fda8b3a257d9f57ebdd9f20ad01b5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197160
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-03-05 14:06:02 +00:00
Brian Salomon
1c1c666382 Default implementation of onSetRelease() on GrSurface
Change-Id: I96ca2a8372d0748b56d5048ea294d7e2be80d22a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197040
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-03-05 13:24:52 +00:00
Brian Salomon
b2c5dae65d Simplify promise image lazy instantiation callbacks.
Now that we never re-fulfill a promise image we no longer need to deinstantiate
promise image proxies. They now can use kSingleUse callback semantics.

This was the only usage of the kDeinstantiate lazy callback type so it is
removed. The DeinstantiateProxyTracker is also no longer required and is
removed.

The GrTexture idle callback mechanism now uses GrReleaseProcHelper, which has
been extended to support chaining multiple callbacks together and an abandon()
method that aborts calling the callback in the destructor. It has been renamed
GrRefCntedCallback to reflect its more general usage.

Bug: skia:8800
Change-Id: I857c9eec57fdf706631a266ec8bea682d6657a7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196500
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-05 13:18:22 +00:00
Robert Phillips
920d488d5f Lay some groundwork for depowering SkGpuDevice's and SkImage_GpuBase's context pointer
In future Ganesh these classes will, respectively, have a RecordingContext and an ImageContext.

Change-Id: I69ced004a2edae5c410e9c00c2de6c0246699caa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197167
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-05 13:14:32 +00:00
Mike Reed
5539390c53 check if we can use legacy blits
depends on https://skia-review.googlesource.com/c/skia/+/196647

Bug: skia:
Change-Id: I85ea7aac34558838d120c2c02abaaeebd77d8b8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196651
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-05 11:49:02 +00:00
Florin Malita
e80f7eb9d6 SkMixerColorFilter GPU impl
Bug: skia:
Change-Id: Ia1e25e0c99737d9720c17f92f0d76a1cb7897ea8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/193163
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-05 11:35:47 +00:00
Chris Dalton
4c56b03cfd Drop support for GL_EXT_raster_multisample
We had only used this extension in conjunction with
GL_NV_framebuffer_mixed_samples to draw directly to the framebuffer.
However, it's faster and higher quality to just use our own analytic
AA if we can draw directly to the framebuffer.

It might have been interesting to fake mixed samples using
GL_EXT_raster_multisample and PLS together, but those two extensions
don't appear to ever exist together.

Bug: skia:
Change-Id: Iea489cb0e03fc55aa64d3ea7fccc61b539cc461e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197082
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-05 11:35:21 +00:00
Mike Reed
fbc887df72 Revert "Remove (unnecessary?) flush in RenderYUVAToRGBA"
This reverts commit 49b293a7d5.

Reason for revert: speculative to fix chrome roll

Original change's description:
> Remove (unnecessary?) flush in RenderYUVAToRGBA
> 
> I don't think we need a flush here.
> 
> Change-Id: I87bf41b491835578e7df9bea4e15ea24dd551c1e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196645
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I49305a5a2bcd5fe112b5f55b64511fd05d6c8548
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197305
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-03-05 02:47:38 +00:00
Robert Phillips
9882dae24d Reduce usage of SkCanvas::flush
SkCanvas::flush is problematic and we wish to deprecate it. As a first step, this CL begins to remove Skia's internal usage of it.

Ideally clients would use SkSurface::flush and/or GrContext::flush.

Change-Id: I39bb0702f8230134a97961a4ee70833fd5bd0dcc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196641
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-03-04 22:09:39 +00:00
Florin Malita
390f9bd8ba Fix handling of SkSL nullable FPs
Bug: skia:8798
Change-Id: Iec311c9d834a6f35b0a4481dbd748532107cd4b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197108
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-04 22:09:20 +00:00
Mike Klein
5ece363ff4 mark lowp TODOs
Change-Id: I14b39a77039d26ca5a98310c41d328a7126ee90a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196621
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-03-04 22:04:32 +00:00
Herb Derby
0f27b5ee2b Introduce SkStrikeCacheInterface
Introduce SkStrikeCacheInterface in order to move from a
template a based interface on SkGlyphRunListPainter to
a class based interface.

Change-Id: Ib15e437420c00f4e11242ac1a4d8a87ee2af9ee1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197101
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-03-04 21:59:30 +00:00
Greg Daniel
b6c15babd5 Add API for creating SkImage from AHB while uploading data to it.
Bug: skia:
Change-Id: I893b511450df7f15bdde202fe01ce223ea2294a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/195366
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-04 21:59:12 +00:00
Robert Phillips
0d075de863 Clean up GrSurfaceContext's relationship with GrRecordingContext
GrSurfaceContext was explicitly holding a lot of things it could just get from its GrRecordingContext.

Change-Id: Ia2e9708d71318dc0c101d56aadf5ae797230bc75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/194360
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-04 21:54:05 +00:00
Mike Klein
b70990eda4 add kRGBA_F16Norm_SkColorType
For now this is distinct from kRGBA_F16_SkColorType but treated the
same.  Next steps are to see if we can keep it clamped to [0,1].

Switched a few switches away from default to exhaustive.

Took away any explicit SW clamps for now except the one we definitely
want in append_gamut_clamp_if_normalized().

Skip F16Norm in the DDL test because we can't yet distinguish it from
F16.

Change-Id: I021a864fe078e4fa4e2b399982e6c38350e10d74
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196371
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-03-04 21:49:07 +00:00
Robert Phillips
49b293a7d5 Remove (unnecessary?) flush in RenderYUVAToRGBA
I don't think we need a flush here.

Change-Id: I87bf41b491835578e7df9bea4e15ea24dd551c1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196645
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-04 21:49:03 +00:00
Robert Phillips
193c421f2f Remove peekProxy's side-effect behavior
Prior to this CL peekProxy could cause the conversion of YUVA planes to RGBA. This switches peekProxy back to just peeking.

In future Ganesh asTextureProxyRef is going to require a GrRecordingContext (bc it can actually do work). The options were to either add a GrRecordingContext parameter to peekProxy or remove its ability to do work (as in this CL).

Change-Id: I42d7dcd41f7c99a7712446d3f6629ffde91bfe5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197105
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-04 21:38:54 +00:00
Mike Reed
5800f2e8a9 Reland "use colorspace steps to determine legacy blits"
This reverts commit c945f0e31a.

Reason for revert: looks like this did not help

Original change's description:
> Revert "use colorspace steps to determine legacy blits"
> 
> This reverts commit 0919852526.
> 
> Reason for revert: speculative: unblock android roll
> 
> Original change's description:
> > use colorspace steps to determine legacy blits
> > 
> > Bug: skia:8793
> > Change-Id: I1de4bde25f7dcb12175733a3213c43f92410dc4a
> > Reviewed-on: https://skia-review.googlesource.com/c/196647
> > Commit-Queue: Mike Reed <reed@google.com>
> > Reviewed-by: Mike Klein <mtklein@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> 
> TBR=mtklein@google.com,brianosman@google.com,reed@google.com
> 
> Change-Id: I79a21df9a3c3a9f3127f57131feff0f3e417e642
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8793
> Reviewed-on: https://skia-review.googlesource.com/c/196774
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

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

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

Bug: skia:8793
Change-Id: I2b70c6e3763bf27112b54ed0d0611a6addc755b9
Reviewed-on: https://skia-review.googlesource.com/c/196981
Reviewed-by: Mike Reed <reed@google.com>
2019-03-03 22:13:00 +00:00
Mike Reed
cf27e74da0 Reland "bring back lowp bilerp_clamp_8888"
This reverts commit c6671be0ea.

Reason for revert: looks like it didn't help

Original change's description:
> Revert "bring back lowp bilerp_clamp_8888"
> 
> This reverts commit 5043c09b8b.
> 
> Reason for revert: speculative, to try to unblock android roller
> 
> Original change's description:
> > bring back lowp bilerp_clamp_8888
> > 
> > PS1-3 are the literal code I removed a few months ago.
> > 
> > PS4 adds asserts to make sure we don't underflow.
> > PS5 adds rounding when scaling off bias, reducing diff slightly.
> > 
> > Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
> > Change-Id: Ice573395a1680e1c3b55a8fe3e4d034f15adde1b
> > Reviewed-on: https://skia-review.googlesource.com/c/196620
> > Commit-Queue: Mike Klein <mtklein@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> 
> TBR=mtklein@google.com,brianosman@google.com,reed@google.com
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Change-Id: I816c23c4a12451be518ea3baf4b9a3fdba9b818a
> Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
> Reviewed-on: https://skia-review.googlesource.com/c/196777
> Reviewed-by: Mike Reed <reed@google.com>

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

Change-Id: I0f96a395ac704a52735c93a08f8ed52a148d5de5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Reviewed-on: https://skia-review.googlesource.com/c/196980
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-03 22:12:24 +00:00
Mike Reed
c6671be0ea Revert "bring back lowp bilerp_clamp_8888"
This reverts commit 5043c09b8b.

Reason for revert: speculative, to try to unblock android roller

Original change's description:
> bring back lowp bilerp_clamp_8888
> 
> PS1-3 are the literal code I removed a few months ago.
> 
> PS4 adds asserts to make sure we don't underflow.
> PS5 adds rounding when scaling off bias, reducing diff slightly.
> 
> Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
> Change-Id: Ice573395a1680e1c3b55a8fe3e4d034f15adde1b
> Reviewed-on: https://skia-review.googlesource.com/c/196620
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

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

Change-Id: I816c23c4a12451be518ea3baf4b9a3fdba9b818a
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Reviewed-on: https://skia-review.googlesource.com/c/196777
Reviewed-by: Mike Reed <reed@google.com>
2019-03-03 13:06:40 +00:00
Mike Reed
c945f0e31a Revert "use colorspace steps to determine legacy blits"
This reverts commit 0919852526.

Reason for revert: speculative: unblock android roll

Original change's description:
> use colorspace steps to determine legacy blits
> 
> Bug: skia:8793
> Change-Id: I1de4bde25f7dcb12175733a3213c43f92410dc4a
> Reviewed-on: https://skia-review.googlesource.com/c/196647
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: I79a21df9a3c3a9f3127f57131feff0f3e417e642
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8793
Reviewed-on: https://skia-review.googlesource.com/c/196774
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-02 17:52:34 +00:00
Ben Wagner
c025aa9638 Adjust luminance gamma for Mac.
It appears that on macOS 10.13 smoothed subpixel antialiased black glyphs
are blit with a gamma of 2.0, but white are blit with a gamma of ~1.4 with
a smooth trasition between these. In macOS 10.14 smoothed black glyphs are
blit with a gamma of 2.0, but white are blit with a gamma ~1.0 with a
smooth transition between. The reason for this is to tone down the high
dilation of the outlines after autohinting.

In order to render like the platform, emulate this behavior by adjusting
the luminance value used to pick the mask gamma.

Bug: chromium:933137
Change-Id: I02d73c29bee1a3506b43598d78f07a03c968349f
Reviewed-on: https://skia-review.googlesource.com/c/196501
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-03-02 03:55:47 +00:00
Mike Klein
5043c09b8b bring back lowp bilerp_clamp_8888
PS1-3 are the literal code I removed a few months ago.

PS4 adds asserts to make sure we don't underflow.
PS5 adds rounding when scaling off bias, reducing diff slightly.

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: Ice573395a1680e1c3b55a8fe3e4d034f15adde1b
Reviewed-on: https://skia-review.googlesource.com/c/196620
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-02 03:55:46 +00:00
Mike Reed
0919852526 use colorspace steps to determine legacy blits
Bug: skia:8793
Change-Id: I1de4bde25f7dcb12175733a3213c43f92410dc4a
Reviewed-on: https://skia-review.googlesource.com/c/196647
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-02 03:50:43 +00:00
Jim Van Verth
841d654844 Fix memory leak in Metal.
ARC wasn't kicking in for the renderCmdEncoders -- adding the __strong
keyword seems to be enough of a hint.

Bug: skia:8243
Change-Id: I07e75d355ab89102126ba2134250f0440ecc488c
Reviewed-on: https://skia-review.googlesource.com/c/196652
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-03-02 03:50:40 +00:00
Greg Daniel
bae712104d Add flush call to take access type, flags, and semaphore.
Bug: skia:
Change-Id: I5e664939a446616ef57acc79d26a10e6908cda10
Reviewed-on: https://skia-review.googlesource.com/c/196643
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-03-02 03:45:36 +00:00
Mike Klein
656281b793 update high-contrast color filter for tagged SW destinations
We haven't updated this since the tagged == linear days.

Bug: skia:8812
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I2f67696f37aab410e1b482348ee8b1cf7e7b1697
Reviewed-on: https://skia-review.googlesource.com/c/196622
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-01 18:47:29 +00:00
Ian McKellar
947e5e437f Clean up SkFontMgr_fuchsia.cpp after FIDL API change
This cleans up some changes made in:
https://skia-review.googlesource.com/c/179994

Bug: skia:
Change-Id: I813f44578fd6dcd0da8a3ec3a877f307c6e36093
Reviewed-on: https://skia-review.googlesource.com/c/196504
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-03-01 16:56:19 +00:00
Jim Van Verth
1223e7fc0a Add GrMtlPipelineStateCache.
Allows us to cache MTLRenderPipelines rather than regenerating them
for every use.

Bug: skia:
Change-Id: I3357d3bc6d644074bd9d544a8d5205af56d918e5
Reviewed-on: https://skia-review.googlesource.com/c/195127
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-03-01 14:48:59 +00:00
Chris Dalton
906430d4b4 Make GrMesh compatible with instanced draws that have no attribs
Bug: skia:
Change-Id: Ia366e20608670df34ab2db3966f5beaa23242592
Reviewed-on: https://skia-review.googlesource.com/c/196162
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-02-28 23:19:22 +00:00
Mike Reed
011d166d37 Move responsibility to onMakeContext for device colorspace decision
Prior to this CL, we always used raster-pipeline if the device had a
colorspace. In this CL, we defer to individual shaders to decide if they can still
use the legacy path (onMakeContext).

The motivation is purely performance (and perhaps short-term backwards
compat): the legacy blits are usually faster, so staying in them
(as long as we still draw correctly) is preferable.

Causes some (mostly unimportant) rebaselines, esp. around bilerp, as the
rasterpipeline does a much better (but slower) job of it, and now we will
use the legacy bilerp more often.

Bug: skia:8793
Change-Id: I1e7e482a863a1a09ffef86a87e2aa9a4a8d1b9b5
Reviewed-on: https://skia-review.googlesource.com/c/195888
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-28 22:50:02 +00:00
Chris Dalton
d31b5e7489 Revert "Drop unused shader support for sample variables"
This restores support for sample variables and improves on the
original API.

A test will come once we restore support for sample locations.

Bug: skia:
Change-Id: I350cc08477c532a13ff7acdd8055c0aa65c51d26
Reviewed-on: https://skia-review.googlesource.com/c/195720
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-02-28 21:19:22 +00:00
Brian Salomon
7d88f310a9 Remove support for SkDeferredDisplayListRecorder::DelayReleaseCallback::kNo.
Bug: skia:8800
Change-Id: I39d1ac62ab9a0d4f987c23de96c644aa9b2fa70e
Reviewed-on: https://skia-review.googlesource.com/c/196161
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-28 19:02:20 +00:00
Michael Ludwig
1433cfd7c4 Reland "Add general quad API to SkGpuDevice"
This reverts commit 24adb3a356.

Reason for revert: fixes SkGpuDevice extraction when running gbr configs in dm.

Original change's description:
> Revert "Add general quad API to SkGpuDevice"
>
> This reverts commit 339e1cc8d4.
>
> Reason for revert: compositor GM breaks dm on windows
>
> Original change's description:
> > Add general quad API to SkGpuDevice
> >
> > Heavily refactors SkGpuDevice's internal texturing code in an attempt
> > to consolidate entry points for drawing an image. Helps lay the ground
> > work for eventually implementing bitmap tiling with per-edge AA.
> >
> > Bug: skia:
> > Change-Id: I9feb86d5315d73119deb21e954c45e45513a63f6
> > Reviewed-on: https://skia-review.googlesource.com/c/191571
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
>
> Change-Id: I74bc7eb08855dff5535cf809fc47ce6f16d2c15d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/195889
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: I667eb5b4d1253b050670a64de9f0aa70f4df3a5e
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/196160
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
2019-02-28 18:44:20 +00:00
Brian Osman
57a06e24d6 Fix scaling error in SkLights::makeColorSpace
Lights are in [0, 1], so converting to SkColor requires scaling.

Bug: skia:
Change-Id: I54726fa6abcc9a801ae51f4ee2a24c067656effd
Reviewed-on: https://skia-review.googlesource.com/c/196420
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-28 18:30:01 +00:00
Kevin Lubick
f5ea37f981 [canvaskit] Support image assets for Skottie
There's a lot of refactoring here to fix up the
namespace of the JS (see pre/postamble js).

A reviewer can skip all the changes to interface.js,
as they are mostly whitespace changes.

Bug: skia:
Change-Id: I7cedeb98f04d4446ac4dfb555a416f30490b2b94
Reviewed-on: https://skia-review.googlesource.com/c/195885
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-02-28 15:56:09 +00:00
Mike Klein
1c94143772 round when writing lowp 565 or 4444
All math discovered the lazy way through brute force.
Some of it makes sense when you think about it.

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Bug: skia:8799
Change-Id: I044b0bf702cf5a5648f5017d58cc7e5d0ac09a7d
Reviewed-on: https://skia-review.googlesource.com/c/196010
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-27 21:48:51 +00:00
Mike Reed
31cc6d7917 utility to check if floats are [0...1]
Bug: skia:
Change-Id: I9bab3ff73d3934786d7457c4b1bcf67d01c653f3
Reviewed-on: https://skia-review.googlesource.com/c/196060
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-27 21:43:31 +00:00
Michael Ludwig
24adb3a356 Revert "Add general quad API to SkGpuDevice"
This reverts commit 339e1cc8d4.

Reason for revert: compositor GM breaks dm on windows

Original change's description:
> Add general quad API to SkGpuDevice
> 
> Heavily refactors SkGpuDevice's internal texturing code in an attempt
> to consolidate entry points for drawing an image. Helps lay the ground
> work for eventually implementing bitmap tiling with per-edge AA.
> 
> Bug: skia:
> Change-Id: I9feb86d5315d73119deb21e954c45e45513a63f6
> Reviewed-on: https://skia-review.googlesource.com/c/191571
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I74bc7eb08855dff5535cf809fc47ce6f16d2c15d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/195889
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-02-27 19:42:31 +00:00
Michael Ludwig
339e1cc8d4 Add general quad API to SkGpuDevice
Heavily refactors SkGpuDevice's internal texturing code in an attempt
to consolidate entry points for drawing an image. Helps lay the ground
work for eventually implementing bitmap tiling with per-edge AA.

Bug: skia:
Change-Id: I9feb86d5315d73119deb21e954c45e45513a63f6
Reviewed-on: https://skia-review.googlesource.com/c/191571
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-27 19:07:20 +00:00
Mike Reed
95835340b2 Avoid forcing rasterpipeline due to device colorspace
Step 0 of "optimizing" for cases where we don't need to force rasterpipeline.

0: treat device colorspace of sRGB as "no colorspace" for single colors
1: convert the color to the device's colorspace (cache xformer on device?)
2: query the shader, to see if its colorspace is the same (needs a new virtual on shaderbase?)

Bug: skia:8793
Change-Id: Id49388fb4f9b8933003efb8db7a620c795c36d83
Reviewed-on: https://skia-review.googlesource.com/c/195370
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-27 16:36:19 +00:00
Ben Wagner
ff84d8a900 SkTypeface::openStream to return smart pointer.
Change-Id: I2c936510e13561fcc9fd8343d5ab9f18c28c8340
Reviewed-on: https://skia-review.googlesource.com/c/195371
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-27 14:08:09 +00:00
Chris Dalton
07cdcfc966 Reland "Stack-allocate pipelines for GrMeshDrawOp"
This is a reland of dfe5000a5f

Original change's description:
> Stack-allocate pipelines for GrMeshDrawOp
>
> Stack-allocates the pipelines in onExecute. This saves us from having
> to store the pipelines on the heap, as well as delaying the need to
> detach processors until onExecute. The delay is an improvement because
> it allows us to keep visiting proxies after onPrepare. (Previously,
> they were moved out of GrProcessorSet and into a pipeline during
> onPrepare, so visiting proxies was impossible after that point.)
>
> Bug: skia:8731
> Change-Id: Idc05063fb0dfbfed42b434e429fa5a497097bdae
> Reviewed-on: https://skia-review.googlesource.com/c/193368
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com

Bug: skia:8731
Change-Id: I32def1a35bb0593470fa672691a9e697dc6d9680
Reviewed-on: https://skia-review.googlesource.com/c/195261
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-02-26 23:32:54 +00:00
Mike Klein
a907dcbda7 remove mention of SkPaintDefaults_Flags
Change-Id: I0294bf2e294761bccf2e05dbd55addb003538cd1
Reviewed-on: https://skia-review.googlesource.com/c/193361
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-26 22:54:24 +00:00
Greg Daniel
cb32415753 Add support for VK_IMAGE_LAYOUT_PRESENT_SRC_KHR in skia vulkan.
This change allows Skia to handle transfering from the present layout.
Skia currently never changes to the present layout, though we are looking
at adding support for this in a different CL.

With this change a client can wrap a an VkImage into an SkSurface still in
the queue present layout and Skia will handle the transation to color
attachment. If a client uses this functiality they most likely will want
to immediately call wait(GrBackendSemaphore) on the SkSurface so that Skia
waits on the VkSemaphore that came from a call to vulkan aquire image before
doing any work on the wrapped VkImage.

Bug: skia:
Change-Id: Ia9bd12ad4e6cd972daaa972cce8698d396c002fc
Reviewed-on: https://skia-review.googlesource.com/c/194424
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-02-26 17:37:25 +00:00
Stan Iliev
cb58060404 Pass render target VkImage in GrVkDrawableInfo
Test: Ran CTS
Bug: b/115613038
Change-Id: I9493de41e0bfaa53436676c8eed2a4f178b6e51e
Reviewed-on: https://skia-review.googlesource.com/c/186400
Commit-Queue: Stan Iliev <stani@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-02-26 17:07:30 +00:00
Herb Derby
eafd81bf0b Make ARGB fallback use common strike lookup
This is a larger CL. It makes fallback ARGB glyphs use
the same strike lookup, and it introduces the two cases
for fallback -- source and device. Source assumes that the
strike data will be transformed while rendering. Device
assumes that the data in the strike is already in device
space.

Change-Id: I5857bc17c6aaec21d48de9ac9102adafff9688fe
Reviewed-on: https://skia-review.googlesource.com/c/192120
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-02-26 17:05:04 +00:00
Chris Dalton
b8af5ad73a sksl: Negate dFdy when the Y axis is flipped
Bug: skia:
Change-Id: Icbdaa6b1ebbe00168f57ebb888c2345d4f7a5e7d
Reviewed-on: https://skia-review.googlesource.com/c/195160
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2019-02-25 23:32:23 +00:00
Chris Dalton
35a3abe765 Revert "Stack-allocate pipelines for GrMeshDrawOp"
This reverts commit dfe5000a5f.

Reason for revert: HWAA pipeline flag not getting set for dashing.

Original change's description:
> Stack-allocate pipelines for GrMeshDrawOp
> 
> Stack-allocates the pipelines in onExecute. This saves us from having
> to store the pipelines on the heap, as well as delaying the need to
> detach processors until onExecute. The delay is an improvement because
> it allows us to keep visiting proxies after onPrepare. (Previously,
> they were moved out of GrProcessorSet and into a pipeline during
> onPrepare, so visiting proxies was impossible after that point.)
> 
> Bug: skia:8731
> Change-Id: Idc05063fb0dfbfed42b434e429fa5a497097bdae
> Reviewed-on: https://skia-review.googlesource.com/c/193368
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: If706f19423310846de70288f393ac12f17ffeee5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8731
Reviewed-on: https://skia-review.googlesource.com/c/195161
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-02-25 23:11:47 +00:00
Ben Wagner
4212a7d948 SkTypeface::onOpenStream to return unique_ptr.
This moves the smart pointer use up one more level in preparation for
changing SkTypeface::openStream to return unique_ptr as well.

Change-Id: Ib8173d59e03de38b06f6e1b4e6776f1961055ae7
Reviewed-on: https://skia-review.googlesource.com/c/195121
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-25 22:30:04 +00:00
Ethan Nicholas
0b2c05470b fixed SPIR-V constant swizzling
Bug: skia:
Change-Id: I27ccb48351eab7faa46ba65d0c4ec26592da383d
Reviewed-on: https://skia-review.googlesource.com/c/195122
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-02-25 21:06:53 +00:00
Chris Dalton
dfe5000a5f Stack-allocate pipelines for GrMeshDrawOp
Stack-allocates the pipelines in onExecute. This saves us from having
to store the pipelines on the heap, as well as delaying the need to
detach processors until onExecute. The delay is an improvement because
it allows us to keep visiting proxies after onPrepare. (Previously,
they were moved out of GrProcessorSet and into a pipeline during
onPrepare, so visiting proxies was impossible after that point.)

Bug: skia:8731
Change-Id: Idc05063fb0dfbfed42b434e429fa5a497097bdae
Reviewed-on: https://skia-review.googlesource.com/c/193368
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-25 21:02:23 +00:00
Herbert Derby
22a4af020d Calculate SDFT strike in common code
Change-Id: I525d2fa083a84e03029a2babdac2933e32077d56
Reviewed-on: https://skia-review.googlesource.com/c/195020
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-02-25 20:51:23 +00:00
Leon Scroggins III
194580dc60 Reland "Treat kWEBP encode with quality=100 as lossless"
This reverts commit 22170b3178.

It was reverted due to the test breaking Google3. This includes a
workaround.

    Original change's description:
    > Treat kWEBP encode with quality=100 as lossless
    >
    > In SkEncodeImage and friends, treat quality of 100 as a lossless encode
    > when using kWEBP. This seems a good fit for the intent - which is
    > presumably to save the highest quality image. This also matches
    > Chromium's blink::ImageEncoder::ComputeWebpOptions, which treats a
    > quality of 1 (on a float scale from 0 to 1) as a lossless encode.
    >
    > FWIW, Chromium has had this behavior since
    > https://codereview.chromium.org/1937433002, in response to
    > crbug.com/523098. The goal is to "maintain sharpness to
    > match the JPEG encoder behavior (use WEBP lossless encoding)".
    >
    > Add a test to verify the new behavior. This requires making tests
    > depend on libwebp to use WebPGetFeatures, since the Skia API does not
    > provide a way to determine whether an encoded webp file was encoded
    > lossless-ly or lossily.
    >
    > Bug: skia:8586
    > Change-Id: Ie9e09c2f7414ab701d696c4ad9edf405868a716f
    > Reviewed-on: https://skia-review.googlesource.com/c/175823
    > Commit-Queue: Leon Scroggins <scroggo@google.com>
    > Reviewed-by: Derek Sollenberger <djsollen@google.com>
    > Reviewed-by: Mike Reed <reed@google.com>

TBR=reed@google.com, based on prior approval

Bug: skia:8586
Change-Id: I09c73f71996422f797fd9456fef5dfad9af36839
Reviewed-on: https://skia-review.googlesource.com/c/194194
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
2019-02-25 18:42:22 +00:00