This reverts commit e89b50ae05.
Reason for revert: landed Android fix at http://ag/13544365 (master) and
http://ag/13554983 (sc-dev)
Original change's description:
> Android roll broke with a compilation error:
> frameworks/base/libs/hwui/jni/Shader.cpp:243:37: error: no matching function for call to 'get'
> sk_sp<SkRuntimeEffect> effect = std::get<0>(result)
>
> Revert "Remove deprecated form of SkRuntimeEffect::Make."
>
> This reverts commit 1cda194366.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Remove deprecated form of SkRuntimeEffect::Make.
> >
> > Chromium has migrated to the new API at https://crrev.com/c/2675855.
> >
> > Change-Id: Id4af77db2c462348e8031d28f56e543ad619c19c
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367060
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
>
> TBR=mtklein@google.com,brianosman@google.com,johnstiles@google.com
>
> Change-Id: Ie18f865f3b7f5b0263db1e52b19cf6faa0500fdd
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368616
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>
TBR=mtklein@google.com,brianosman@google.com,stani@google.com,johnstiles@google.com
Change-Id: I9d679013cb275dc80aaaa977b7f1f4da31f36d1e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369037
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Implement support for COLRv1 color gradient vector forms. COLR v1 is an
extension to the OpenType COLR tables that introduces support for
gradients, transforms and compositing. [1]
COLRv1 fonts contain an OpenType COLR table with format v1. In a COLR v1
table, glyphs are defined by a directed, acyclic graph of Paint
operations. The task for the Skia implementation is to extract the COLR
v1 information from the font using FreeType's COLRv1 API, then traverse
the glyph graph and translate information from the font into Skia
operations on SkCanvas.
Care needs to be taken for transformations to work correctly. FreeType
sends a top level transform that includes the scaling from font units to
actual glyph size, as well as optional transforms configured on FreeType
using FT_Set_Transform. This is set up as the starting transform at the
beginning of drawing a COLRv1 glyph. At the stage of setting a clip for
a PaintGlyph operation, the glyph outline is retrieved from FreeType
unscaled and untransformed. Since the starting transformation is applied
to the SkCanvas, the unscaled glyph is properly scaled and positioned.
Similarly, computing the initial bounding box for the COLRv1 glyph needs
to consider transformations. COLRv1 glyphs have a base glyph entry in
the glyf table which can use a minimum of two points for defining a
bounding box. This bounding box is an imaged rectangle enclosing those
two points at the identity transform. We need to compute the bounding
box scaled, but at identity transform, then make a rectangle from it,
that we then transform so that we get a large enough area to paint
in. If those two points from the glyf table would be transformed first,
then we would compute the bounding box, the resulting bounding box ends
up too small.
As a test font, add a version of the samples-glyf_colr_1.ttf from [2]
with one glyph added for testing PaintColrGlyph functionality and
compositions.
Add a basic GM test that produces color glyphs untransformed, with
skew and with rotation and combinations of those.
[1] https://github.com/googlefonts/colr-gradients-spec/
[2] https://github.com/googlefonts/color-fonts
Bug: skia:11264
Change-Id: I8357cd0c7ac0039bb2eac18f21fa343bf61871eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300558
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
This also adds the relevant Start() / End() calls so that the DSL
is put into the correct state.
Change-Id: I844b0ab5dff06e3f7b0a69458bf4442a5da0f33e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/364857
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
https://docs.google.com/document/d/1z9ZODlZX4XXbfOjh2t1-1Z7FJcCCcOfbrEjiFzPE4vg/edit?usp=sharing&resourcekey=0-Io-07D1zm1yKMQN2UAiYBw
This approach lets us write color filters that want to work in
particular color spaces and alpha formats and adapt them to our normal
pipeline. It should work with pre-canned and runtime effects, and we
can do the same sort of thing for shaders too.
Some features are designed for using this with the high-contrast filter:
- ability to change working tf and gamut separately: as written the
HC effect only wants to work in linear space without changing
gamut, which is I bet will be a common desired mode. But other
effects may want to fully change the working color space, e.g. to
sRGB or XYZ.
- adapting the alpha type to unpremul is mostly a flourish: you could
do it yourself in sksl, but we might as well do it if doing other
transforms anyway (it's cheaper this way than doing it yourself),
and this may make it easier to adapt non-runtime effects.
(I bet most color filters actually want to be unpremul.)
I briefly also included a knob to control how this effect treats a
nullptr dst color space, but I've come back around to that not being a
parameter. I think this is a situation where we know best.
New GM to demo.
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I420e3a2aa648f314c019a98bfdcd44e810a3dac6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368336
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
The fuzzer test case was:
-15,-11 ------> huge,-11
^ |
| v
-15,5000 <------ huge,5000
where the 'huge' x-value caused the accumulated perimeter to overflow.
Bug:1175370, skia:11307
Change-Id: Ic6760d38c29c440d2d4fcb225a5c556e56a992f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368317
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Bug: chromium:1174186
Change-Id: I91a88d2d57150dee37f08bc4270d399abfd0d60d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368497
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
frameworks/base/libs/hwui/jni/Shader.cpp:243:37: error: no matching function for call to 'get'
sk_sp<SkRuntimeEffect> effect = std::get<0>(result)
Revert "Remove deprecated form of SkRuntimeEffect::Make."
This reverts commit 1cda194366.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Remove deprecated form of SkRuntimeEffect::Make.
>
> Chromium has migrated to the new API at https://crrev.com/c/2675855.
>
> Change-Id: Id4af77db2c462348e8031d28f56e543ad619c19c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367060
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
TBR=mtklein@google.com,brianosman@google.com,johnstiles@google.com
Change-Id: Ie18f865f3b7f5b0263db1e52b19cf6faa0500fdd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368616
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
Glyph advances are based on the origin, not on the glyph bounding box.
Draw the tick marks for the advances starting from where the run of
glyphs was drawn.
Change-Id: I217c10a79835ad46e0178bb77ab8e575e36704ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368418
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Chromium has migrated to the new API at https://crrev.com/c/2675855.
Change-Id: Id4af77db2c462348e8031d28f56e543ad619c19c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367060
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Useful in client code to document what we're doing as we switch away
from SkFilterQuality.
Change-Id: I05737beb99a567a46a3c3ec418b7f7da71b1ff62
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/366723
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
I think this was the rough idea? I'm a little fuzzy
on the SkMatrixProvider overloads that concat... I
really don't have a head for matrix transforms.
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Bug: skia:11260
Change-Id: I6eb8e4397da035d17fe6b96e5c5494dce0483e26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/365520
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
This is a reland of fa87f9c7b9
Went back to original approach of checking isFramebufferOnly outside
GrCopyRenderTask::Make().
Original change's description:
> Add backend texture and backend render target versions snapshot GMs
>
> GPU may behave differently depending on whether the SkSurface backing
> store is wrapped and whether it is a texture or not.
>
> Bug: skia:11208
> Change-Id: I5e9921d56c0840cfe34ed2926a55be7460409b23
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/364639
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:11208
Change-Id: I7af6078e904fdd772b97ad3a27e26cab577fc6a3
Cq-Include-Trybots: luci.skia.skia.primary:Test-Ubuntu18-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-PreAbandonGpuContext
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/365702
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Also adds an example particle system that uses uniforms, and an instance
of the particles GM that draws it.
Change-Id: I64e2514fd17c8ce615b4e13b9f82424f80b8424e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356840
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This reverts commit fa87f9c7b9.
Reason for revert: assert on n5x/n7
Original change's description:
> Add backend texture and backend render target versions snapshot GMs
>
> GPU may behave differently depending on whether the SkSurface backing
> store is wrapped and whether it is a texture or not.
>
> Bug: skia:11208
> Change-Id: I5e9921d56c0840cfe34ed2926a55be7460409b23
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/364639
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
Change-Id: Id1488586e2d17cdce35f95ea6aa9b2bffd9218d0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11208
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/365698
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Make SkImage_Gpu and SkImage_GpuYUVA have their own implementations
rather than sharing one in SkImage_GpuBase.
New function takes a GrImageTexGenPolicy to enable caller to
force a new texture to be made and choose it's budgeting status rather
than receive a cached view or a view owned by the image.
It also communicates any color type changes when converting a non-
texture image to a texture.
Bug: skia:11208
Change-Id: I6b389442bf9752276a83b21021070e3190610cd7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361356
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
GPU may behave differently depending on whether the SkSurface backing
store is wrapped and whether it is a texture or not.
Bug: skia:11208
Change-Id: I5e9921d56c0840cfe34ed2926a55be7460409b23
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/364639
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
The equivalent functionality is available in
include/effects/SkImageFilters.h via SkImageFilters::MatrixTransform.
Bug: skia:11230
Change-Id: I77b78d508d653a32c913a7599f1004ab634e3e6d
Docs-Preview: https://skia.org/?cl=361497
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361497
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This reverts commit ad8ce4dbb2.
Change-Id: I26077c56fa69e60a003359fa9da758bbfd6a3425
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/363777
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Moves the (SkRect + flags) struct into SkImageFilter_Base with protected
access only. Base constructor and all src/effects/imagefilters Make
functions now take a "const SkRect*" instead. CropRect is still what's
stored and used by filter implementations during filterImage(), but it's
no longer publicly available.
The SkImageFilters factory implementations now can go straight to the
Make functions in src/effects/imagefilters instead of wrapping its
"const SkRect*" in an SkImageFilter::CropRect.
Bug: skia:9296, skia:11230
Change-Id: I2c62f42031910ec405623d4519c8a434cd2b3bdd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361496
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
This reverts commit c48a23d774.
Reason for revert: Possibly breaking some builds on android roll
Original change's description:
> Initial support for DSL FPs
>
> Change-Id: I1abbe881f925ac6db4f7d672a391aadd349a33b5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361556
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>
TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
Change-Id: Ia76b24293ab676fbf9e43f470cf3c3d6b96b2d34
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362696
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This might help us narrow down misbehavior on older Intel GPUs when
running on ANGLE + DX9.
Change-Id: I32bfb1e5cfbaa6a8b8c1e197b806073a4cd717bc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362416
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This reverts commit 964b4465c4.
Reason for revert: Earlier CL needs revert
Original change's description:
> Add particle GM that uses uniforms, fix related bug in particle effect
>
> We weren't allocating uniform storage until after the first update, far
> too late for users to pump uniform values in. They're now allocated as
> soon as the effect is created, which is tested by the new GM.
>
> Change-Id: Ia0084bcec5986479c350ead27d14344c3ed82520
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362176
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
TBR=brianosman@google.com
Change-Id: Ib6f963840af2abba0a4e6b99185f4010b61dde54
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362418
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
We weren't allocating uniform storage until after the first update, far
too late for users to pump uniform values in. They're now allocated as
soon as the effect is created, which is tested by the new GM.
Change-Id: Ia0084bcec5986479c350ead27d14344c3ed82520
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362176
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 0bad6cf145.
Reason for revert: breaking perf bot!?!?
Original change's description:
> Remove maxTileSize from GrCaps, bleed GMs use max texture size override.
>
> This existed to enable shader-based versions of the old bleed GM that no
> longer exist. It is currently making it harder to simplify image->view
> consolidation without accidentally limiting the testing. This is because
> an attempt to create a texture from a bitmap will succeed if max texture
> size is not overridden by the test.
>
> Bug: skia:11208
> Change-Id: I432d1d2ab66c1e888c9d77583b3c9a9d673e7e8f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360609
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=bsalomon@google.com,robertphillips@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:11208
Change-Id: Ib8643aec37ac312ac0a2fb834cc3dbf116f7a898
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362099
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 3b01242199.
Cq-Include-Trybots: luci.skia.skia.primary:Canary-G3
Change-Id: I83ee324d5ca927413022b08fb4b48936adbc0e2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362058
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit f3274e035b.
Reason for revert: breaking google3 roll
ld.lld: error: undefined symbol: SkParticleEffect::RegisterParticleTypes()
>>> referenced by particles.cpp
>>> blaze-out/k8-fastbuild/bin/third_party/skia/HEAD/_objs/dm/particles.pic.o:(ParticlesGM::onOnceBeforeDraw())
ld.lld: error: undefined symbol: SkParticleEffectParams::SkParticleEffectParams()
>>> referenced by particles.cpp
>>> blaze-out/k8-fastbuild/bin/third_party/skia/HEAD/_objs/dm/particles.pic.o:(ParticlesGM::onOnceBeforeDraw())
ld.lld: error: undefined symbol: SkParticleEffectParams::visitFields(SkFieldVisitor*)
Original change's description:
> Add particle GMs
>
> They've only existed as a custom slide in Viewer until now, so it was
> easy to break them (and also hard for people to see a minimal set of
> code to use them).
>
> Change-Id: I2e3a0eb1948e05b87dbf21009214f8237c123b7d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360599
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
TBR=brianosman@google.com,reed@google.com
Change-Id: I3fdd079d076ce781e5a4e2b4f51908f0bd564c1a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361836
Reviewed-by: Mike Reed <reed@google.com>
They've only existed as a custom slide in Viewer until now, so it was
easy to break them (and also hard for people to see a minimal set of
code to use them).
Change-Id: I2e3a0eb1948e05b87dbf21009214f8237c123b7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360599
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Simplifies the op to always triangulate the inner fan. We ensure this
will always work by using breadcrumb triangles. Also removes the
fail-on-non-simple mode from GrInnerFanTriangulator since it isn't
being used anymore.
Bug: skia:10419
Change-Id: Idb849712bf2bc4e5ef785bc3f9b8db03119d230e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359565
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This existed to enable shader-based versions of the old bleed GM that no
longer exist. It is currently making it harder to simplify image->view
consolidation without accidentally limiting the testing. This is because
an attempt to create a texture from a bitmap will succeed if max texture
size is not overridden by the test.
Bug: skia:11208
Change-Id: I432d1d2ab66c1e888c9d77583b3c9a9d673e7e8f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360609
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: I0c343167e63f147f21afee805ea934bd5f161024
Bug: chromium:1170700
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360608
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Part of the larger work to remove drawImage from canvas (and in general
simplify our apis w.r.t. older patterns like skbitmap).
Change-Id: If208927e1d46256519036c42e68aec3d3c809a82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358836
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Allows creation of an image directly from a RTE. Caller provides the
effect input bindings, image info for the image, and optional local
matrix.
The info's alpha type and colorspace are tags for the output image. No
alpha type or color space conversions are applied to the output of RTE.
CPU does not yet support making kUnpremul images.
Bug: chromium:1151490
Change-Id: I69babc9dbbce4431d756cd7a3eef4753e727d6fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357284
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
1. Removes clamping of spotlight's specular exponent, which is not the
specified behavior of feSpotLight in SVG.
(note: we never clamped a specular lighting effect's
specular exponent/shininess parameter, although SVG 1.1 does clamp
that; that is the client's responsibility).
2. Fixes a bug in the GPU implementation of scale factor for spot lights.
3. Saturate computed lighting color after multiplying with color scale,
instead of just saturating the color scale (allows high intensity
lights to saturate to white which is more reasonable approximation of
an HDR effect stored in an LDR color).
Note: fixes 1 and 2 were originally addressed in https://bugs.chromium.org/p/chromium/issues/detail?id=472849
but the change was reverted for layout failure reasons and it was never
relanded after rebasing.
Note2: most of the layout test rebaselines necessary for chrome are
minor and related to fix 2. The exception is svg/dynamic-updates/SVGFESpecularLightingElement-dom-kernelUnitLength-attr.html
which is the result of fix 3. It took a little digging, but I believe
that fix 3 actually makes that generated SVG more correct (it's original
expected image was "wrong").
In that test, it has a specular constant of 4 (which is a multiplier)
and a shininess of 1 (which makes it practically a "diffuse" specular).
So basically we are multiplying the greenYellow color by 4 for most of
the image that has a normal pointing out of the screen. Firefox renders
a similarly yellow oversaturated appearance instead of clamping to the
base greenYellow.
Reading the feSpecularLighting spec, there is no saturation that is
specified where it had been performed before this change. Instead, all
that is mentioned is that the results of a given filter have to be pinned
to the color channel range (e.g. the last step).
Bug: skia:11007, skia:11057, skia:11153
Change-Id: I82e4a6f1742fecea59816fda75eb931c2a51d3e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355496
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Also cleanup some of the duplicate code in SkRecords
Bug: skia:7650
Change-Id: I4d3167a892c126c19a54002beab25c9a6c96fa5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357000
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This GM tests out the GrTextureEffect with non-normalizable textures.
Change-Id: I5b0ffc43241a29d64516d07a4388668f224ffefe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355676
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
We were replacing points with the intersection of opposite edges.
Because of the distance tolerance we're using that may fall outside
of the original quad. Detect those cases and use averages of
intersection points instead.
Bug: chromium:1167277
Change-Id: I36b172f19339839bb21c060ddfe8109c184e9327
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356311
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Migrate clients to use drawImage(... sampling)
rather than relying on paint's filter-quality.
This CL just gets started, introducing the build-flag.
Bug: skia:7650
Change-Id: I4afdd964c6f805058afee0a8f3a6887d501ad42b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356076
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This reverts commit f1650efc55.
Reason for revert: fix for cpu/ddl configs
Original change's description:
> Revert "Test all YUVA image factories with different encoded origins."
>
> This reverts commit 2ba80af000.
>
> Reason for revert: new test fails ddl and cpu configs on imggen
>
> Original change's description:
> > Test all YUVA image factories with different encoded origins.
> >
> > Now that SkImage_GpuYUVA stores a GrYUVATextureProxies it supports
> > encoded origins.
> >
> > Modify wacky_yuv_format GMs to use different origins and remove
> > restriction in SkImage::MakeFromYUVAPixmaps.
> >
> > Bug: skia:10632
> > Change-Id: I02477d592b7baba164944d629eeac48223698c10
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353623
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> TBR=jvanverth@google.com,bsalomon@google.com
>
> Change-Id: If909ee4769cc1c74e1682a5e2870ec85a83f65c5
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10632
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354661
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=jvanverth@google.com,bsalomon@google.com
# Not skipping CQ checks because this is a reland.
Bug: skia:10632
Change-Id: Iafe79ab5b3ce0ff9e3a4007e5d8fbc44edded196
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355630
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: chromium:1162942
Change-Id: Idc1dcb725ff9eae651b84de2fe792b188dcd1c1b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354671
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This reverts commit 2ba80af000.
Reason for revert: new test fails ddl and cpu configs on imggen
Original change's description:
> Test all YUVA image factories with different encoded origins.
>
> Now that SkImage_GpuYUVA stores a GrYUVATextureProxies it supports
> encoded origins.
>
> Modify wacky_yuv_format GMs to use different origins and remove
> restriction in SkImage::MakeFromYUVAPixmaps.
>
> Bug: skia:10632
> Change-Id: I02477d592b7baba164944d629eeac48223698c10
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353623
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=jvanverth@google.com,bsalomon@google.com
Change-Id: If909ee4769cc1c74e1682a5e2870ec85a83f65c5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354661
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Now that SkImage_GpuYUVA stores a GrYUVATextureProxies it supports
encoded origins.
Modify wacky_yuv_format GMs to use different origins and remove
restriction in SkImage::MakeFromYUVAPixmaps.
Bug: skia:10632
Change-Id: I02477d592b7baba164944d629eeac48223698c10
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353623
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
These need to change because type coercion in SkSL is about to become
more strict in a followup CL; we are disallowing expressions that mix
ints and floats without a cast.
Change-Id: Iff5e2820806b9419afdfcbf25d4a7f96f2eeeccb
Bug: skia:11164
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353416
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This is a reland of b60255033d
Original change's description:
> Push SkYUVAInfo into GrYUVToRGBEffect.
>
> Wrap up SkYUVAInfo and proxies into new type GrYUVATextureProxies.
>
> Bug: skia:10632
> Change-Id: Ic907d78a1a40af3c8ef838021749839c422d62dc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353042
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:10632
Change-Id: I1878609153e3fc763620cb71a85d3b012f915155
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353621
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit b60255033d.
Reason for revert: GM needs fix for abandoned context
Original change's description:
> Push SkYUVAInfo into GrYUVToRGBEffect.
>
> Wrap up SkYUVAInfo and proxies into new type GrYUVATextureProxies.
>
> Bug: skia:10632
> Change-Id: Ic907d78a1a40af3c8ef838021749839c422d62dc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353042
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,bsalomon@google.com
Change-Id: Ia5a1121ed388ad04ef86121a3f7905772316a200
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353618
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
... now that bitmap
- converts to image with just bitmap.asImage()
- canvas *always* converts bitmaps to images before they are drawn
Bug: skia:10037
Change-Id: I24292f62e0fd072b3b810d974d0fe5c6d9b9a68d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353582
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Wrap up SkYUVAInfo and proxies into new type GrYUVATextureProxies.
Bug: skia:10632
Change-Id: Ic907d78a1a40af3c8ef838021749839c422d62dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353042
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:10632
Change-Id: If4dd7779b0856f6d0b441381bf7f2f51527cdb9d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352497
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Is not used by a major client and can be implemented using runtime
effects for users who want this noise.
Bug: skia:10536
Change-Id: Iaa06e6e1406b808c7f8dc0f76621fecf2becabf5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352057
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This should fix the --preAbandonGpuContext bots.
Cq-Include-Trybots: luci.skia.skia.primary:Test-Ubuntu18-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-PreAbandonGpuContext
Change-Id: I5df65e730414c670e255eb786f16a43fee49c22f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352087
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
I figured while I was thinking of this I'd flesh it out with different
strategies for creating this same color space transform chain. This
new GM uses canvas->makeSurface() to create its midCS waypoint.
Change-Id: Id72dbc6010496342daa12f793111bb3b96be94fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/351951
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Same basic deal as skcms.
This new GM tests our treatment of color spaces as sources is consistent
with our treatment of color spaces as destinations. It looks good to me
now, and I have tested that this GM catches a "well-placed typo" in each
of the three implementations modified here.
Bug: chromium:1144260
Change-Id: I3eabc93bbd65855c60006751f68c171ccdce9d94
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/351336
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit bef02dca9d.
Reason for revert: PreAbandonGpuContext failing on tree
Original change's description:
> Fix GPU improved noise impl and add to perlinnoise GM.
>
> GPU was recently busted when switching alpha-color type swizzles from
> aaaa to 000a.
>
> There was no GM that exercised SkPerlinNoiseShader::MakeImprovedNoise.
>
> It draws wrong before and after this change with the CPU backend.
>
> Bug: skia:10536
> Change-Id: I514e304d022fcccae80699a99facafa8ce947e9f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350916
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com
Change-Id: Iac635028b402e6008e3a8050bdfa66052d94fd10
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10536
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350956
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
GPU was recently busted when switching alpha-color type swizzles from
aaaa to 000a.
There was no GM that exercised SkPerlinNoiseShader::MakeImprovedNoise.
It draws wrong before and after this change with the CPU backend.
Bug: skia:10536
Change-Id: I514e304d022fcccae80699a99facafa8ce947e9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350916
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This reverts commit 72bd9e8664.
Bug: skia:10913
Bug: skia:11133
Change-Id: Id822569166c7c2d53c3af5685550ae00c0dcfe01
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/349058
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This is a reland of 6ea387e7c7
Original change's description:
> Enable GrTessellationPathRenderer by default
>
> Moves GrTessellationPathRenderer to the end of the chain and enables
> it by default.
>
> Also updates nvpr to not draw volatile paths. The tessellator is much
> faster at these.
>
> Bug: skia:10419
> Change-Id: I97ca7d4d1dff65fc9d4040c267f9808c8c33b548
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344377
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:10419
Change-Id: I53b50d6aa01ae1bea697e05c3f60d57d132d6aad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345759
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit 8f924ac0ce.
Reason for revert: suppressions landed for fuchsia images to rebaseline
Original change's description:
> Revert "Add new virts, hide old ones"
>
> This reverts commit c56e2e5aa6.
>
> Reason for revert: suspected of breaking chrome roll
>
> Original change's description:
> > Add new virts, hide old ones
> >
> > Add virtuals for the draw methods that now take sampling/filtermode.
> >
> > drawImage
> > drawImageRect
> > drawImageLattice
> > drawAtlas
> >
> > Add a flag that can remove the older virtuals, once each client has
> > stopped overriding them. In that situation, the older public methods
> > will simplify extract the sampling from the paint, and call the new
> > public methods.
> >
> > Bug: skia:11105, skia:7650
> > Change-Id: I8b0029727295caa983e8148fc743a55cfbecd043
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347022
> > Commit-Queue: Mike Reed <reed@google.com>
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,fmalita@chromium.org,reed@google.com
>
> Change-Id: I0a90952c11a180d918126ea06a630f4a0bf9b49b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:11105
> Bug: skia:7650
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348194
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>
TBR=djsollen@google.com,bsalomon@google.com,fmalita@chromium.org,reed@google.com
# Not skipping CQ checks because this is a reland.
Bug: skia:11105
Bug: skia:7650
Change-Id: Ia2b4537a2d330460b7554278d2c05075cf27162a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348876
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Bug: skia:10913
Change-Id: I9f0a79f9d706eb2c0c8381088f0caf19940589ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347957
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Bug: skia:10913
Change-Id: I430e5eb3fecb0f15775db03699819194d44271b6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347958
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This reverts commit c56e2e5aa6.
Reason for revert: suspected of breaking chrome roll
Original change's description:
> Add new virts, hide old ones
>
> Add virtuals for the draw methods that now take sampling/filtermode.
>
> drawImage
> drawImageRect
> drawImageLattice
> drawAtlas
>
> Add a flag that can remove the older virtuals, once each client has
> stopped overriding them. In that situation, the older public methods
> will simplify extract the sampling from the paint, and call the new
> public methods.
>
> Bug: skia:11105, skia:7650
> Change-Id: I8b0029727295caa983e8148fc743a55cfbecd043
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347022
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,fmalita@chromium.org,reed@google.com
Change-Id: I0a90952c11a180d918126ea06a630f4a0bf9b49b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11105
Bug: skia:7650
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348194
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Add some helper functions to reduce copy-paste, make column advance
automatic, etc.
Change-Id: I65c7ed1b7b1b357017e79e14b211686584ed3b7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348186
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Add virtuals for the draw methods that now take sampling/filtermode.
drawImage
drawImageRect
drawImageLattice
drawAtlas
Add a flag that can remove the older virtuals, once each client has
stopped overriding them. In that situation, the older public methods
will simplify extract the sampling from the paint, and call the new
public methods.
Bug: skia:11105, skia:7650
Change-Id: I8b0029727295caa983e8148fc743a55cfbecd043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347022
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>