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

Issue 2294683002: Simplify contain constraint calculation (Closed)

Created:
4 years, 3 months ago by davve
Modified:
4 years, 3 months ago
Reviewers:
fs
CC:
chromium-reviews, krit, rwlbuis, f(malita), blink-reviews, gyuyoung2, Stephen Chennney, kouhei+svg_chromium.org, pdr+svgwatchlist_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Simplify contain constraint calculation We're selecting between two rectangles given by the intrinsic aspect ratio: (defaultWidth / aspect ratio, defaultHeight) or (defaultWidth, defaultHeight x aspect ratio). One rectangle is 'contained' and the other one 'covers'. Select the 'contained' rectangle by trying out the first to see if its width fit, and if so we're done. Otherwise compute and select the other rectangle. Due to how floating point math works, it's possible that both computed rectangles, or neither computed rectangle, will fit the case when the two ratios are equal. See https://bugs.chromium.org/p/chromium/issues/detail?id=641221 for one example. However, in this case it doesn't matter much which rectangle we choose, the contained and and cover rectangle would be the same rectangle and the floating point discrepancy has no known practical implication. BUG=641221 Committed: https://crrev.com/c7b1ab58edd0776579bbf921a7cf905b83883eda Cr-Commit-Position: refs/heads/master@{#416238}

Patch Set 1 #

Patch Set 2 : Rebase and slight re-structure. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -12 lines) Patch
M third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp View 1 1 chunk +2 lines, -12 lines 0 comments Download

Messages

Total messages: 15 (8 generated)
davve
Alternative solution to BUG=641221 Looking at https://chromium.googlesource.com/chromium/src/+/894b126742579240faefd9ededfbc6f0178a3d4e%5E%21/#F95 I see no motivation for the slightly more ...
4 years, 3 months ago (2016-09-02 08:53:26 UTC) #6
davve
Looking at sizing tests in LayoutTests/svg I think we have most of this covered. Perhaps ...
4 years, 3 months ago (2016-09-02 09:01:04 UTC) #7
fs
On 2016/09/02 at 09:01:04, davve wrote: > Looking at sizing tests in LayoutTests/svg I think ...
4 years, 3 months ago (2016-09-02 09:24:37 UTC) #8
davve
On 2016/09/02 09:24:37, fs wrote: > That might be good, although I suspect they are ...
4 years, 3 months ago (2016-09-02 10:02:54 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2294683002/20001
4 years, 3 months ago (2016-09-02 10:03:16 UTC) #11
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 3 months ago (2016-09-02 11:34:49 UTC) #13
commit-bot: I haz the power
4 years, 3 months ago (2016-09-02 11:36:14 UTC) #15
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/c7b1ab58edd0776579bbf921a7cf905b83883eda
Cr-Commit-Position: refs/heads/master@{#416238}

Powered by Google App Engine
This is Rietveld 408576698