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

Issue 23440005: CC: Fix precision loss in scale reciprocal. (Closed)

Created:
7 years, 3 months ago by epenner
Modified:
7 years, 3 months ago
CC:
chromium-reviews, cc-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

CC: Fix precision loss in scale reciprocal. The content_scale_x/y are in single precision (and not full representable as floats), so if we want to multiply content scale by its reciprocal and get 1.0, we need the reciprocal to be in double precision. Otherwise, a floating point error epsilon leaks into our double matrices. BUG=259154

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M cc/trees/layer_tree_host_common.cc View 1 chunk +1 line, -1 line 1 comment Download

Messages

Total messages: 11 (0 generated)
epenner
PTAL. Two character change FTW! See here for an example of what was happening: http://ideone.com/S31WDk ...
7 years, 3 months ago (2013-08-27 01:53:38 UTC) #1
shawnsingh
On 2013/08/27 01:53:38, epenner wrote: > PTAL. > > Two character change FTW! > > ...
7 years, 3 months ago (2013-08-27 02:06:41 UTC) #2
epennerAtGoogle
On 2013/08/27 02:06:41, shawnsingh wrote: > On 2013/08/27 01:53:38, epenner wrote: > > PTAL. > ...
7 years, 3 months ago (2013-08-27 02:24:19 UTC) #3
danakj
https://codereview.chromium.org/23440005/diff/1/cc/trees/layer_tree_host_common.cc File cc/trees/layer_tree_host_common.cc (right): https://codereview.chromium.org/23440005/diff/1/cc/trees/layer_tree_host_common.cc#newcode1172 cc/trees/layer_tree_host_common.cc:1172: (1.0 / layer->contents_scale_x(), 1.0 / layer->contents_scale_y()); The input to ...
7 years, 3 months ago (2013-08-27 02:28:49 UTC) #4
epennerAtGoogle
On 2013/08/27 02:28:49, danakj wrote: > https://codereview.chromium.org/23440005/diff/1/cc/trees/layer_tree_host_common.cc > File cc/trees/layer_tree_host_common.cc (right): > > https://codereview.chromium.org/23440005/diff/1/cc/trees/layer_tree_host_common.cc#newcode1172 > ...
7 years, 3 months ago (2013-08-27 02:45:12 UTC) #5
enne (OOO)
On 2013/08/27 01:53:38, epenner wrote: > Two character change FTW! How do you fit a ...
7 years, 3 months ago (2013-08-27 18:37:14 UTC) #6
shawnsingh
On 2013/08/27 18:37:14, enne wrote: > On 2013/08/27 01:53:38, epenner wrote: > > > Two ...
7 years, 3 months ago (2013-08-27 18:52:28 UTC) #7
enne (OOO)
On 2013/08/27 18:52:28, shawnsingh wrote: > I'm not skeptical about this, but I'm just wondering ...
7 years, 3 months ago (2013-08-27 18:55:57 UTC) #8
epennerAtGoogle
On 2013/08/27 18:37:14, enne wrote: > On 2013/08/27 01:53:38, epenner wrote: > > > Two ...
7 years, 3 months ago (2013-08-27 19:03:51 UTC) #9
enne (OOO)
On 2013/08/27 19:03:51, epennerAtGoogle wrote: > For the test though, I can make one for ...
7 years, 3 months ago (2013-08-27 19:07:47 UTC) #10
epennerAtGoogle
7 years, 3 months ago (2013-08-27 19:10:30 UTC) #11
On 2013/08/27 19:07:47, enne wrote:
> On 2013/08/27 19:03:51, epennerAtGoogle wrote:
> 
> > For the test though, I can make one for doubles, but it's a bit tricky for
> > floats, as float rounding can actually mask this bug as well. For example,
> > here's an example where float rounding 'fixes' the issue:
> > http://ideone.com/VVCDfl
> 
> I think I was looking for a higher level test than that.  Like, adding a layer
> with a contents scale at some +20k translation offset, CalcDrawProps, generate
> quads, make sure those quads don't use AA.

I'm on the same page there, but I think float rounding might still 'fix' it
randomly. But maybe I'm wrong and there is enough math operations to guarantee a
float error (especially with a large enough scroll offset).  Can't hurt so I'll
put together that test. It also protects against 'double corruption' if nothing
else.

Powered by Google App Engine
This is Rietveld 408576698