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

Issue 12787007: Fix for displacement mapping (Closed)

Created:
7 years, 9 months ago by sugoi1
Modified:
7 years, 9 months ago
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Fix for displacement mapping Fixed the skia displacement map effect to match the WebKit displacement map fix. Committed: https://code.google.com/p/skia/source/detail?r=8225

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -27 lines) Patch
M gm/displacement.cpp View 1 1 chunk +9 lines, -9 lines 0 comments Download
M include/core/SkScalar.h View 1 2 chunks +2 lines, -0 lines 0 comments Download
M src/effects/SkDisplacementMapEffect.cpp View 1 5 chunks +19 lines, -18 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
sugoi
I fixed the displacement mapping : - The CPU path in Skia now fits the ...
7 years, 9 months ago (2013-03-15 17:47:06 UTC) #1
bsalomon
https://codereview.chromium.org/12787007/diff/1/src/effects/SkDisplacementMapEffect.cpp File src/effects/SkDisplacementMapEffect.cpp (right): https://codereview.chromium.org/12787007/diff/1/src/effects/SkDisplacementMapEffect.cpp#newcode68 src/effects/SkDisplacementMapEffect.cpp:68: // Truncate the displacement values On 2013/03/15 17:47:06, sugoi ...
7 years, 9 months ago (2013-03-15 19:09:53 UTC) #2
sugoi
> Doesn't cast do what you want? If we care about fixed point perhaps it ...
7 years, 9 months ago (2013-03-15 20:11:40 UTC) #3
bsalomon
On 2013/03/15 20:11:40, sugoi wrote: > > Doesn't cast do what you want? If we ...
7 years, 9 months ago (2013-03-15 20:13:37 UTC) #4
sugoi
7 years, 9 months ago (2013-03-15 20:38:01 UTC) #5
bsalomon
On 2013/03/15 20:38:01, sugoi wrote: lgtm
7 years, 9 months ago (2013-03-15 20:39:05 UTC) #6
sugoi1
Committed patchset #2 manually as r8225 (presubmit successful).
7 years, 9 months ago (2013-03-19 15:07:50 UTC) #7
reed1
Sorry to comment late. Why are we "truncating" the float values, instead of floor/ceiling/round? How ...
7 years, 9 months ago (2013-03-19 15:19:14 UTC) #8
sugoi
Truncating is the default behavior of doing : static_cast<int>(float_value) Reason 1 : I need this ...
7 years, 9 months ago (2013-03-19 15:39:39 UTC) #9
reed1
7 years, 9 months ago (2013-03-19 15:46:23 UTC) #10
Message was sent while issue was closed.
On 2013/03/19 15:39:39, sugoi wrote:
> Truncating is the default behavior of doing :
> static_cast<int>(float_value)
> 
> Reason 1 :
> I need this algorithm to be exactly the same as the WebKit algorithm so that I
> don't break the WebKit tests when I integrate this change into WebKit
> 
> Reason 2 :
> You need your center values to be 0 (i.e. no displacement) and since half of
255
> is 127.5, but 0 can only be represented by either 127 or 128, a small rounding
> error could offset the entire image by 1 pixel, so all values in the range
> [-0.999..., 0.999...] are considered to be a 0 displacement value.

Thanks, that would be a good comment in the code, rather than "Truncate the
values".

Powered by Google App Engine
This is Rietveld 408576698