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

Issue 10996037: Do not convert from RectF to Rect by flooring. (Closed)

Created:
8 years, 2 months ago by Ian Vollick
Modified:
8 years, 2 months ago
Reviewers:
jamesr, sky
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, rsesek+watch_chromium.org, jam, danakj, shawnsingh, cc-bugs_chromium.org
Visibility:
Public.

Description

Fixes cases where we incorrectly convert from RectF to Rect by flooring. In all cases we should be taking the enclosing or enclosed int rect as appropriate. This mainly affects bits of code using the old Rect Rect::Scale(float) function. There are, thankfully, not too many. I've replaced this legacy function with Rect Rect::ScaleUnsafe(float) and when this lands, I will open a bug for switching from ScaleUnsafe to a Scale followed by a ToEnclosedRect or ToEnclosingRect. BUG=152596 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=159256

Patch Set 1 : . #

Total comments: 2

Patch Set 2 : . #

Total comments: 6

Patch Set 3 : . #

Patch Set 4 : . #

Patch Set 5 : Fixing mac build. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+327 lines, -85 lines) Patch
M content/browser/renderer_host/backing_store_aura.cc View 1 5 chunks +8 lines, -4 lines 0 comments Download
M content/browser/renderer_host/backing_store_mac.mm View 1 2 3 4 3 chunks +5 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
M content/renderer/browser_plugin/browser_plugin_backing_store.cc View 1 4 chunks +6 lines, -3 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 chunks +3 lines, -1 line 0 comments Download
M ui/gfx/image/image_skia_operations.cc View 1 2 chunks +4 lines, -2 lines 0 comments Download
M ui/gfx/rect.h View 1 2 chunks +13 lines, -0 lines 0 comments Download
M ui/gfx/rect_base.h View 1 chunk +0 lines, -10 lines 0 comments Download
A ui/gfx/rect_conversions.h View 1 2 1 chunk +21 lines, -0 lines 0 comments Download
A ui/gfx/rect_conversions.cc View 1 chunk +32 lines, -0 lines 0 comments Download
M ui/gfx/rect_f.h View 1 3 chunks +11 lines, -3 lines 0 comments Download
M ui/gfx/rect_f.cc View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M ui/gfx/rect_unittest.cc View 2 chunks +155 lines, -0 lines 0 comments Download
A ui/gfx/safe_floor_ceil.h View 1 chunk +16 lines, -0 lines 0 comments Download
A ui/gfx/safe_floor_ceil.cc View 1 2 3 1 chunk +29 lines, -0 lines 0 comments Download
M ui/gfx/size.cc View 1 1 chunk +0 lines, -1 line 0 comments Download
M ui/gfx/size_base.h View 1 2 2 chunks +15 lines, -6 lines 0 comments Download
D ui/gfx/size_base_impl.h View 1 1 chunk +0 lines, -45 lines 0 comments Download
M ui/gfx/size_f.cc View 1 1 chunk +0 lines, -1 line 0 comments Download
M ui/ui.gyp View 1 2 chunks +4 lines, -1 line 0 comments Download
M webkit/plugins/ppapi/ppapi_plugin_instance.cc View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 11 (0 generated)
Ian Vollick
8 years, 2 months ago (2012-09-27 16:34:20 UTC) #1
sky
https://codereview.chromium.org/10996037/diff/8001/ui/gfx/rect.h File ui/gfx/rect.h (right): https://codereview.chromium.org/10996037/diff/8001/ui/gfx/rect.h#newcode78 ui/gfx/rect.h:78: Rect ScaleUnsafe(float scale) const WARN_UNUSED_RESULT; Why do we need ...
8 years, 2 months ago (2012-09-27 17:48:30 UTC) #2
Ian Vollick
On 2012/09/27 17:48:30, sky wrote: > https://codereview.chromium.org/10996037/diff/8001/ui/gfx/rect.h > File ui/gfx/rect.h (right): > > https://codereview.chromium.org/10996037/diff/8001/ui/gfx/rect.h#newcode78 > ...
8 years, 2 months ago (2012-09-27 18:22:53 UTC) #3
sky
webkit/plugins/ppapi/ppb_graphics_2d_impl could likely use ths new code too. https://codereview.chromium.org/10996037/diff/11001/ui/gfx/rect.cc File ui/gfx/rect.cc (right): https://codereview.chromium.org/10996037/diff/11001/ui/gfx/rect.cc#newcode17 ui/gfx/rect.cc:17: #include ...
8 years, 2 months ago (2012-09-27 20:33:55 UTC) #4
Ian Vollick
On 2012/09/27 20:33:55, sky wrote: > webkit/plugins/ppapi/ppb_graphics_2d_impl could likely use ths new code too. > ...
8 years, 2 months ago (2012-09-27 22:02:39 UTC) #5
sky
Search for ScaleRectBounds here: http://src.chromium.org/viewvc/chrome/trunk/src/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc?revision=159112&view=markup and spe . That's the one I can think you ...
8 years, 2 months ago (2012-09-27 23:39:24 UTC) #6
jamesr
lgtm (i have webkit/ owners)
8 years, 2 months ago (2012-09-27 23:42:36 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vollick@chromium.org/10996037/7005
8 years, 2 months ago (2012-09-28 01:47:32 UTC) #8
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build. Your ...
8 years, 2 months ago (2012-09-28 02:20:55 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vollick@chromium.org/10996037/9010
8 years, 2 months ago (2012-09-28 11:02:23 UTC) #10
commit-bot: I haz the power
8 years, 2 months ago (2012-09-28 14:32:39 UTC) #11
Change committed as 159256

Powered by Google App Engine
This is Rietveld 408576698