History log of /external/skia/src/effects/gradients/Sk4fGradientBase.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
da4545bfc58f8ec19df79f6ae75b7231477973d8 23-Mar-2017 Florin Malita <fmalita@chromium.org> Extract 4f gradient interval functionality

... into structures usable outside Sk4fGradient classes.

Change-Id: Ifffdbe8bafa4f027f2016ce71eefede6034dd3ae
Reviewed-on: https://skia-review.googlesource.com/10060
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
3d1a6bc5f3124dd5cd237ccc39ead26fe4b3355f 09-Feb-2017 Florin Malita <fmalita@chromium.org> [4fGradient] Relax interval checks for SkGradientShaderBase also

Similar to https://skia-review.googlesource.com/8270, treat intervals
as closed at both extremities in the 4f gradient fallback impl also.

BUG=skia:6212

Change-Id: I7f164868202ae6a0f76cbcdbcbf8e62db12a1bd4
Reviewed-on: https://skia-review.googlesource.com/8277
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
5b1a7c21006175d313aad09ef40f9453a21480e2 21-Nov-2016 Florin Malita <fmalita@chromium.org> Fuzzer assert in GradientShaderBase4fContext::TSampler

Similar to https://codereview.chromium.org/2472763002, we also need to
clamp the tiled value in kRepeat mode, to avoid snapping to 1.0f.

R=reed@google.com,herb@google.com
BUG=skia:5975

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5079

Change-Id: I8fdac36c0d112d5eb76e47c3e4156a79a4d13b36
Reviewed-on: https://skia-review.googlesource.com/5079
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
8ffb3e5d4c3731d02b3502a89c7a7eb18daf398c 09-Nov-2016 fmalita <fmalita@chromium.org> Fix fuzzer assert in GradientShaderBase4fContext::TSampler

The arithmetic in tileProc<kMirror> may cause the result to snap to the
open interval value - which violates invariants down the line.

We need to clamp the result to nextafterf(2, 0) to ensure it stays less
than two.

BUG=skia:5913
R=reed@google.com,herb@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2472763002

Review-Url: https://codereview.chromium.org/2472763002
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
cc34176c040c9703e351af7268dfc3a8b3cbf71d 02-Nov-2016 fmalita <fmalita@chromium.org> Fix GradientShaderBase4fContext::Interval fuzzer assert

Although the iterator ensures v0 != v1, 2 - v0 may still be equal to
2 - v1 for very small values due to limited float precision.

We need to recheck the inequality to avoid triggering Interval asserts.

BUG=skia:5903
R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2474463002

Review-Url: https://codereview.chromium.org/2474463002
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
8f457591e6a21c240fd2fca56a97281b556ce796 21-Oct-2016 fmalita <fmalita@chromium.org> [Sk4fGradient] Use infinity floats for clamp-mode extreme positions

In clamp mode, we use a couple of synthetic edges that are supposed to
extend to +/- infinity (-inf .. P0 and Pn .. inf). Currently we use
SK_ScalarMin/Max, but these can be overrun with large/malicious inputs.

Use SK_ScalarInfinity/SK_ScalarNegativeInfinity instead, and tweak
compute_interval_props() to handle inf values gracefully.

BUG=skia:5835
R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2441733002

Review-Url: https://chromiumcodereview.appspot.com/2441733002
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
3a2e45a6ed50c07cb1a710d3f7b74be796e61251 14-Oct-2016 fmalita <fmalita@chromium.org> Faster 4f gradient premul path

Similar to https://codereview.chromium.org/2409583003/, perform the
premul in 4f. It turns out it's even faster to avoid the 255 load
multiplication in this case.

Also includes some template plumbing because DstTraits<>::load now needs
to be premul-aware (previously it wasn't).

R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2416233002

Review-Url: https://codereview.chromium.org/2416233002
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
088e21ba652ceaa4abb4ba8cdd2ec1bc8afc32ed 05-Oct-2016 fmalita <fmalita@chromium.org> Harden degenerate gradient context handling

Certain inputs produce degenerate values at context creation time only.

Detect such cases after context creation, and abort drawing by returning
a null shader context instead.

BUG=skia:5821
R=reed@google.com,brianosman@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2397473003

Review-Url: https://codereview.chromium.org/2397473003
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
b931336f3b7913e64602562d7d6d9187086bbd5a 15-Apr-2016 fmalita <fmalita@chromium.org> Observe gTreatSkColorAsSRGB for 4f gradients.

Use SkColor4f::FromColor() in the color packer to convert srgb->linear
when needed.

R=reed@google.com,herb@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1890253002

Review URL: https://codereview.chromium.org/1890253002
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
dc6c9bf91c158e89cd9d5ef19dfbf1da98c598a6 21-Mar-2016 fmalita <fmalita@chromium.org> Refactor 4f gradients using trait templates

Some 4f gradient housekeeping.

1) replace <DstPtrType, ColorProfile> specialization tuples with an enum covering all dest types
(L32, S32, F16, F32)

2) group various template helpers into dest trait classes, specialized for each dest type

(2a - conflate current dst_swizzle and scale_for_dest ops into one load op)

R=reed@google.com,mtklein@google.com,herb@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1816883002

Review URL: https://codereview.chromium.org/1816883002
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
a928b288b3001eb34cc3c9caedbaac9a403b05ed 18-Mar-2016 fmalita <fmalita@chromium.org> 4f linear gradient shader blitters

Add F16 specializations to support writing to half-float dests.

Add color profile template arg across the board to support writing
to sRGB dests.

R=reed@google.com,mtklein@google.com,herb@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1808963005

Review URL: https://codereview.chromium.org/1808963005
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
7e6fcf890a1a63249136b8e6d9f4d5a606ef7508 10-Mar-2016 fmalita <fmalita@chromium.org> Generic 4f gradient T sampler fallback

Add a generic T sampler fallback impl which uses T series produced by
subclasses mapTs() overrides. The fallback path uses the same interval
structures as the current optimized linear4f impl, but always sorted
in stop order (never inverted to match dx/increasing x order).

Enable the new mechanism for 4f linear w/ perspective.

Other boring changes:

* relocate the interval builder (back) to the base class
* add a private header for shared templates

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1783823002

Review URL: https://codereview.chromium.org/1783823002
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
d8a4f772115bbb9d50c0e73613bdd879833da690 08-Mar-2016 fmalita <fmalita@chromium.org> Fix 4f gradient swizzle post http://crrev.com/1774523002

* store interval colors in pm4f-natural/RGBA order
* swizzle to dst order during interval advance

Also remove an unused Interval ctor.

R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1770153002

Review URL: https://codereview.chromium.org/1770153002
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
7520fc4ad3a12476a27f098e7c00847ae0e5bcf4 04-Mar-2016 fmalita <fmalita@chromium.org> Relocate the specialized linear gradient interval builder

The specialized interval setup works really well for (4f) linear
gradients, but it seems unlikely to benefit other gradient subclasses.

Since it gets in the way of a general/fallback gradient impl, let's move
this code to Sk4fLinearGradient.

R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1764183002

Review URL: https://codereview.chromium.org/1764183002
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
e27456a43c96648e05be746870124d14ff479fcb 02-Mar-2016 fmalita <fmalita@chromium.org> 4f gradient interval builder cleanup

Untangle the builder, for hopefully improved readability.

R=reed@google.com,mtklein@google.com,herb@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1753853002

Review URL: https://codereview.chromium.org/1753853002
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
b976b2761f0bb651edb1e7fe3becc1889cfe3fc4 25-Feb-2016 fmalita <fmalita@chromium.org> 4f gradient negative-dx interval fixup for kMirror_TileMode

4f intervals are meant to be monotonically increasing in X. This means
we invert the point order when dx < 0:

[0...1) -> (1...0]

For kMirror_TileMode, we also append a duplicate/flipped interval
sequence and expand the range to 2:

[0...1) -> [0...1)[1...2)

When dx < 0, the current logic yields

(1...0] -> (1...0](2...1]

which violates the interval monotonicity.

To achieve the proper order, we need to swap the two halves:

(1...0] -> (1...0](2...1] -> (2...1](1...0]

R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1735773003

Review URL: https://codereview.chromium.org/1735773003
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
ca058f57a399f5b8b7e9b7d4382c6eb0b36cf598 24-Feb-2016 fmalita <fmalita@chromium.org> Retire SkShader::kSupports4f_Flag

No longer used except in one test.

Introduce kPrefers4f_Flag instead.

R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1726983002

Review URL: https://codereview.chromium.org/1726983002
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp
bc590c01b00ef79e1e1f30058e7a70a29419f2a9 22-Feb-2016 fmalita <fmalita@chromium.org> Initial linear gradient 4f impl

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1688543002

Review URL: https://codereview.chromium.org/1688543002
/external/skia/src/effects/gradients/Sk4fGradientBase.cpp