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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
... 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
... 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>
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>
This reverts commit c5e8e150c8.
Reason for revert: Reverting to revert 9ac0407006https://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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>