Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Issue 2198263002: Image filters: force near-zero floating point parameters to zero.

Created:
4 years, 4 months ago by Stephen White
Modified:
4 years, 3 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Image filters: force near-zero floating point parameters to zero. Computation with subnormal (aka denormal) floating point values can be an order of magnitude slower than normal values. Limiting near-zero values to zero prevents these cases, without overly affecting the visual result. BUG=615851 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2198263002

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -31 lines) Patch
M include/core/SkPoint3.h View 1 chunk +2 lines, -0 lines 0 comments Download
M include/core/SkScalar.h View 1 chunk +5 lines, -0 lines 1 comment Download
M src/core/SkPoint3.cpp View 1 chunk +4 lines, -0 lines 0 comments Download
M src/effects/SkArithmeticMode.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M src/effects/SkDisplacementMapEffect.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkLightingImageFilter.cpp View 10 chunks +22 lines, -22 lines 0 comments Download
M src/effects/SkMatrixConvolutionImageFilter.cpp View 1 chunk +5 lines, -3 lines 0 comments Download
M src/effects/SkPerlinNoiseShader.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 18 (10 generated)
Stephen White
reed@: PTAL. Thanks!
4 years, 4 months ago (2016-08-01 20:39:15 UTC) #2
Stephen White
reed@: PTAL. Thanks!
4 years, 4 months ago (2016-08-01 20:57:40 UTC) #5
reed1
4 years, 4 months ago (2016-08-01 21:12:41 UTC) #7
reed1
is this strictly an opportunistic performance change, as I notice we're not change *all* floats ...
4 years, 4 months ago (2016-08-01 21:13:55 UTC) #8
Stephen White
On 2016/08/01 21:13:55, reed1 wrote: > is this strictly an opportunistic performance change, as I ...
4 years, 4 months ago (2016-08-01 21:17:08 UTC) #9
inferno
friendly ping ? Is this security fix ready to land ?
4 years, 4 months ago (2016-08-25 02:55:42 UTC) #16
Stephen White
On 2016/08/25 02:55:42, inferno wrote: > friendly ping ? Is this security fix ready to ...
4 years, 4 months ago (2016-08-25 04:32:31 UTC) #17
reed1
4 years, 3 months ago (2016-08-26 17:49:44 UTC) #18
If we're going to land this in skia, do we have a test that can tell us if/when
we accidentally add new code that *doesn't* remember to manually filter its
values? This seems very fragile without that sort of thing.

https://codereview.chromium.org/2198263002/diff/1/include/core/SkScalar.h
File include/core/SkScalar.h (right):

https://codereview.chromium.org/2198263002/diff/1/include/core/SkScalar.h#new...
include/core/SkScalar.h:231: static inline SkScalar SkScalarNormalize(SkScalar
x)
Given this name, should it trigger only when x is denormalized?
SkScalarNearlyZero is some made up value, mostly not related to denormalized
issues.

Powered by Google App Engine
This is Rietveld 408576698