|
|
Descriptioncc: Removed DCHECK that asserted MapPoint returns clipped as true
When we apply a perspective to a div, we could end up with a
situation where the mapped points end up behind the view. When
this happened we would DCHECK, but since this a valid scenario
and the rendered results look correct (as far as I can tell),
I'm removing the DCHECK.
Please see http://jsfiddle.net/kkryf2v4/ for an example where
we animate from non-clipped to clipped div.
BUG=416367
Committed: https://crrev.com/06aebb2f4b89f7bb0a511fa12881e919a860287a
Cr-Commit-Position: refs/heads/master@{#297082}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Added a comment eplaining why we ignore clipped #Messages
Total messages: 16 (3 generated)
hendrikw@chromium.org changed reviewers: + reveman@chromium.org
PTAL, thanks!
danakj@chromium.org changed reviewers: + danakj@chromium.org
https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc File cc/output/gl_renderer.cc (left): https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc#old... cc/output/gl_renderer.cc:1426: DCHECK(!clipped); If it's clipped then the coordinates returned by MapPoint are not valid: https://code.google.com/p/chromium/codesearch#chromium/src/cc/base/math_util....
On 2014/09/26 21:09:19, danakj wrote: > https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc > File cc/output/gl_renderer.cc (left): > > https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc#old... > cc/output/gl_renderer.cc:1426: DCHECK(!clipped); > If it's clipped then the coordinates returned by MapPoint are not valid: > https://code.google.com/p/chromium/codesearch#chromium/src/cc/base/math_util.... Actually, they are. Well, unless w happens to be zero, but I've never seen that happen.
On 2014/09/26 21:11:31, Hendrik wrote: > On 2014/09/26 21:09:19, danakj wrote: > > https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc > > File cc/output/gl_renderer.cc (left): > > > > > https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc#old... > > cc/output/gl_renderer.cc:1426: DCHECK(!clipped); > > If it's clipped then the coordinates returned by MapPoint are not valid: > > > https://code.google.com/p/chromium/codesearch#chromium/src/cc/base/math_util.... > > Actually, they are. > > Well, unless w happens to be zero, but I've never seen that happen. Well, I should be more clear on that. The value they return produces results that you would expect in that situation.
On 2014/09/26 21:15:02, Hendrik wrote: > On 2014/09/26 21:11:31, Hendrik wrote: > > On 2014/09/26 21:09:19, danakj wrote: > > > https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc > > > File cc/output/gl_renderer.cc (left): > > > > > > > > > https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc#old... > > > cc/output/gl_renderer.cc:1426: DCHECK(!clipped); > > > If it's clipped then the coordinates returned by MapPoint are not valid: > > > > > > https://code.google.com/p/chromium/codesearch#chromium/src/cc/base/math_util.... > > > > Actually, they are. > > > > Well, unless w happens to be zero, but I've never seen that happen. > > Well, I should be more clear on that. The value they return produces results > that you would expect in that situation. To get correct values it should be doing something more like this with the point, no? https://code.google.com/p/chromium/codesearch#chromium/src/cc/base/math_util....
On 2014/09/26 21:21:58, danakj wrote: > On 2014/09/26 21:15:02, Hendrik wrote: > > On 2014/09/26 21:11:31, Hendrik wrote: > > > On 2014/09/26 21:09:19, danakj wrote: > > > > https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc > > > > File cc/output/gl_renderer.cc (left): > > > > > > > > > > > > > > https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc#old... > > > > cc/output/gl_renderer.cc:1426: DCHECK(!clipped); > > > > If it's clipped then the coordinates returned by MapPoint are not valid: > > > > > > > > > > https://code.google.com/p/chromium/codesearch#chromium/src/cc/base/math_util.... > > > > > > Actually, they are. > > > > > > Well, unless w happens to be zero, but I've never seen that happen. > > > > Well, I should be more clear on that. The value they return produces results > > that you would expect in that situation. > > To get correct values it should be doing something more like this with the > point, no? > > https://code.google.com/p/chromium/codesearch#chromium/src/cc/base/math_util.... I'm assuming pixels drawn outside of the viewport will not be drawn? Right? The near plane is zero (i.e. right at the 'camera', if you can call it that), so I would never expect the quad to be clipped in such a way that it would be visible (unless its normal is perpendicular to the view direction in which case it could only draw a line, or nothing maybe). That code seems like overkill for this. Maybe I'm wrong.
On 2014/09/26 21:34:04, Hendrik wrote: > On 2014/09/26 21:21:58, danakj wrote: > > On 2014/09/26 21:15:02, Hendrik wrote: > > > On 2014/09/26 21:11:31, Hendrik wrote: > > > > On 2014/09/26 21:09:19, danakj wrote: > > > > > > https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc > > > > > File cc/output/gl_renderer.cc (left): > > > > > > > > > > > > > > > > > > > > https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc#old... > > > > > cc/output/gl_renderer.cc:1426: DCHECK(!clipped); > > > > > If it's clipped then the coordinates returned by MapPoint are not valid: > > > > > > > > > > > > > > > https://code.google.com/p/chromium/codesearch#chromium/src/cc/base/math_util.... > > > > > > > > Actually, they are. > > > > > > > > Well, unless w happens to be zero, but I've never seen that happen. > > > > > > Well, I should be more clear on that. The value they return produces > results > > > that you would expect in that situation. > > > > To get correct values it should be doing something more like this with the > > point, no? > > > > > https://code.google.com/p/chromium/codesearch#chromium/src/cc/base/math_util.... > > I'm assuming pixels drawn outside of the viewport will not be drawn? Right? > The near plane is zero (i.e. right at the 'camera', if you can call it that), so > I would never expect the quad to be clipped in such a way that it would be > visible (unless its normal is perpendicular to the view direction in which case > it could only draw a line, or nothing maybe). That code seems like overkill for > this. Maybe I'm wrong. For fun, I tried to set up the situation where we sweep across the camera (and behind). http://jsfiddle.net/1n8qppoo/2/ Looks right to me.
ok LGTM https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc File cc/output/gl_renderer.cc (left): https://codereview.chromium.org/610603003/diff/1/cc/output/gl_renderer.cc#old... cc/output/gl_renderer.cc:1425: bottom_right = MathUtil::MapPoint(device_transform, bottom_right, &clipped); can you add comment explaining why we are ignoring the clipped value here and point it at the bug
Updated comment
Thanks! LGTM
The CQ bit was checked by hendrikw@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/610603003/20001
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as 7541b6443a24fd77ffb6ef75babe24762e4b16d9
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/06aebb2f4b89f7bb0a511fa12881e919a860287a Cr-Commit-Position: refs/heads/master@{#297082} |