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

Issue 11270042: Add non-member non-mutating methods for common gfx::Rect operations. (Closed)

Created:
8 years, 1 month ago by danakj
Modified:
8 years, 1 month ago
CC:
chromium-reviews, joi+watch-content_chromium.org, melevin, jam, sadrul, yusukes+watch_chromium.org, ben+watch_chromium.org, tfarina, samarth, gideonwald, apatrick_chromium, sreeram, dominich, rsesek+watch_chromium.org, David Black, Shishir, penghuang+watch_chromium.org, darin-cc_chromium.org, cc-bugs_chromium.org, James Su, Jered, enne (OOO), backer, piman, beng (no_code_reviews), Nico
Visibility:
Public.

Description

Add non-member non-mutating methods for common gfx::Rect operations. This adds non-member methods that return a new Rect (or RectF) object as their result instead of mutating an existing rect. We add: Rect gfx::IntersectRects(Rect, Rect) RectF gfx::IntersectRects(RectF, RectF) Rect gfx::UnionRects(Rect, Rect) RectF gfx::UnionRects(RectF, RectF) Rect gfx::SubtractRects(Rect, Rect) RectF gfx::SubtractRects(RectF, RectF) RectF gfx::ScaleRect(RectF, scale) RectF gfx::ScaleRect(RectF, x_scale, y_scale) In CL https://codereview.chromium.org/11110004/ we made all member methods of Rect (and RectF) mutate the existing object, so these methods are added for cases where we want the result to create a new object instead. BUG=147395 R=sky Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=164760

Patch Set 1 #

Total comments: 2

Patch Set 2 : rename and not inline #

Patch Set 3 : missed a Scale(), and add UI_EXPORTs #

Patch Set 4 : rebase #

Patch Set 5 : rebasefinal #

Patch Set 6 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+164 lines, -171 lines) Patch
M ash/display/multi_display_manager.cc View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
M ash/launcher/launcher_view_unittest.cc View 1 1 chunk +2 lines, -3 lines 0 comments Download
M ash/system/drive/tray_drive.cc View 1 3 chunks +6 lines, -6 lines 0 comments Download
M ash/wm/partial_screenshot_view.cc View 1 1 chunk +2 lines, -3 lines 0 comments Download
M ash/wm/workspace/workspace_window_resizer.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M cc/delegated_renderer_layer_impl.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M cc/direct_renderer.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M cc/draw_quad.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M cc/software_renderer.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/instant/instant_controller.cc View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/toolbar_view.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/backing_store_aura.cc View 1 3 chunks +8 lines, -13 lines 0 comments Download
M content/browser/renderer_host/backing_store_mac.mm View 1 2 3 2 chunks +4 lines, -6 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 2 3 4 3 chunks +4 lines, -6 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_gtk.cc View 1 2 3 4 2 chunks +2 lines, -5 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 5 2 chunks +3 lines, -5 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_win.cc View 1 2 3 4 2 chunks +3 lines, -4 lines 0 comments Download
M content/common/gpu/image_transport_surface.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_backing_store.cc View 1 2 3 3 chunks +6 lines, -10 lines 0 comments Download
M content/renderer/paint_aggregator.cc View 1 3 chunks +4 lines, -7 lines 0 comments Download
M content/renderer/paint_aggregator_unittest.cc View 1 4 chunks +4 lines, -8 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 3 4 5 5 chunks +7 lines, -14 lines 0 comments Download
M content/renderer/webplugin_delegate_proxy.cc View 1 4 chunks +5 lines, -8 lines 0 comments Download
M ui/app_list/page_switcher.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M ui/app_list/search_result_view.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M ui/gfx/blit.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M ui/gfx/image/image_skia_operations.cc View 1 2 3 2 chunks +5 lines, -7 lines 0 comments Download
M ui/gfx/rect.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M ui/gfx/rect.cc View 1 1 chunk +18 lines, -0 lines 0 comments Download
M ui/gfx/rect_f.h View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M ui/gfx/rect_f.cc View 1 2 1 chunk +24 lines, -0 lines 0 comments Download
M ui/gfx/rect_unittest.cc View 1 2 3 4 chunks +4 lines, -8 lines 0 comments Download
M ui/gfx/screen_gtk.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M ui/gfx/screen_mac.mm View 1 1 chunk +1 line, -2 lines 0 comments Download
M ui/views/animation/bounds_animator.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M ui/views/animation/bounds_animator_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/widget/root_view.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M webkit/plugins/ppapi/ppapi_plugin_instance.cc View 1 2 3 4 1 chunk +4 lines, -6 lines 0 comments Download
M webkit/plugins/ppapi/ppb_graphics_2d_impl.cc View 1 3 chunks +10 lines, -12 lines 0 comments Download
M webkit/plugins/webview_plugin.cc View 1 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
danakj
These new methods are similar to https://dev.mobileread.com/trac/webkitbrowser/browser/trunk/WebKit-r30377/WebCore/platform/graphics/IntRect.h#L163 I have added the same methods found in ...
8 years, 1 month ago (2012-10-25 18:31:19 UTC) #1
danakj
I went through https://codereview.chromium.org/11110004/ and looked at each case modified there, and switched them over ...
8 years, 1 month ago (2012-10-25 18:33:29 UTC) #2
sky
https://codereview.chromium.org/11270042/diff/1/ui/gfx/rect.h File ui/gfx/rect.h (right): https://codereview.chromium.org/11270042/diff/1/ui/gfx/rect.h#newcode78 ui/gfx/rect.h:78: inline Rect Intersection(const Rect& a, const Rect& b) { ...
8 years, 1 month ago (2012-10-25 23:31:52 UTC) #3
danakj
https://codereview.chromium.org/11270042/diff/1/ui/gfx/rect.h File ui/gfx/rect.h (right): https://codereview.chromium.org/11270042/diff/1/ui/gfx/rect.h#newcode78 ui/gfx/rect.h:78: inline Rect Intersection(const Rect& a, const Rect& b) { ...
8 years, 1 month ago (2012-10-26 00:16:04 UTC) #4
danakj
Made non-inline and renamed to IntersectRects, ScaleRect, etc.
8 years, 1 month ago (2012-10-26 00:24:26 UTC) #5
sky
LGTM
8 years, 1 month ago (2012-10-26 19:38:44 UTC) #6
danakj
Need some OWNERS review: +jamesr for cc/ webkit/ content/renderer/ +piman for content/common/gpu and webkit/plugins/ppapi
8 years, 1 month ago (2012-10-26 19:52:42 UTC) #7
jamesr
lgtm
8 years, 1 month ago (2012-10-26 19:59:36 UTC) #8
Ken Russell (switch to Gerrit)
content/common/gpu LGTM
8 years, 1 month ago (2012-10-27 01:16:18 UTC) #9
piman
lgtm lgtm
8 years, 1 month ago (2012-10-29 17:12:00 UTC) #10
piman
8 years, 1 month ago (2012-10-29 17:12:00 UTC) #11
lgtm

Powered by Google App Engine
This is Rietveld 408576698