|
Make gfx::Rect class operations consistently mutate the class they are called on.
Currently some methods mutate the class, and some return a new value, requiring
API users to know what kind of method they are calling each time, and making
inconsistent code. For example:
gfx::Rect rect;
rect.Inset(1, 1, 1, 1);
rect = rect.Intersect(other_rect);
rect.Offset(1, 1);
Instead of:
gfx::Rect rect;
rect.Inset(1, 1, 1, 1);
rect.Intersect(other_rect);
rect.Offset(1, 1);
We could go either way - making the class immutable or all methods return a new
instance - but I believe it is better to instead make all methods mutate the
class. This allows for shorter lines of code by avoiding having to repeat the
object's name twice in order to change it.
This patch changes gfx::Rect classes and all the callsites that uses these
methods. It should make no change in behaviour, so no new tests added.
R=sky
BUG= 147395
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=163579
Total comments: 7
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+380 lines, -279 lines) |
Patch |
 |
M |
ash/desktop_background/desktop_background_view.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
ash/display/multi_display_manager.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
ash/drag_drop/drag_drop_controller_unittest.cc
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
ash/launcher/launcher_view.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
ash/launcher/launcher_view_unittest.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
ash/system/drive/tray_drive.cc
|
View
|
1
2
|
3 chunks |
+6 lines, -3 lines |
0 comments
|
Download
|
 |
M |
ash/system/tray/tray_views.cc
|
View
|
1
2
|
1 chunk |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
ash/system/user/tray_user.cc
|
View
|
1
2
|
2 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
ash/tooltips/tooltip_controller.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
ash/tooltips/tooltip_controller_unittest.cc
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
ash/wm/base_layout_manager.cc
|
View
|
1
2
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
ash/wm/partial_screenshot_view.cc
|
View
|
1
2
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
ash/wm/shelf_layout_manager.cc
|
View
|
1
2
|
2 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
ash/wm/system_modal_container_layout_manager.cc
|
View
|
1
2
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
ash/wm/window_util.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
ash/wm/workspace/workspace_layout_manager2.cc
|
View
|
1
2
|
1 chunk |
+3 lines, -1 line |
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
2
3
4
5
6
7
8
9
10
11
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
cc/direct_renderer.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
|
3 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
cc/draw_quad.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
cc/gl_renderer.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
cc/software_renderer.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/instant/instant_controller.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/notifications/balloon_collection_impl.cc
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/gtk/browser_toolbar_gtk.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/panels/panel_manager.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/tabs/dock_info.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/views/extensions/extension_dialog.cc
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/views/notifications/balloon_view_views.cc
|
View
|
1
2
|
3 chunks |
+6 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/views/toolbar_view.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/window_sizer/window_sizer.cc
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc
|
View
|
1
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/accelerated_surface_container_mac.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/backing_store_aura.cc
|
View
|
1
2
|
3 chunks |
+12 lines, -7 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/backing_store_mac.mm
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+6 lines, -4 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/backing_store_win.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/gtk_window_utils.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/render_widget_host_view_aura.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
5 chunks |
+8 lines, -5 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/render_widget_host_view_gtk.cc
|
View
|
1
2
|
3 chunks |
+8 lines, -5 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/render_widget_host_view_mac.mm
|
View
|
1
2
3
4
5
|
3 chunks |
+6 lines, -4 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/render_widget_host_view_win.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
2 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
content/common/gpu/image_transport_surface.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
content/plugin/webplugin_proxy.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
content/renderer/browser_plugin/browser_plugin_backing_store.cc
|
View
|
|
3 chunks |
+9 lines, -5 lines |
0 comments
|
Download
|
 |
M |
content/renderer/disambiguation_popup_helper.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
content/renderer/paint_aggregator.cc
|
View
|
|
6 chunks |
+14 lines, -10 lines |
0 comments
|
Download
|
 |
M |
content/renderer/paint_aggregator_unittest.cc
|
View
|
1
2
|
4 chunks |
+8 lines, -4 lines |
0 comments
|
Download
|
 |
M |
content/renderer/render_widget.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
5 chunks |
+14 lines, -8 lines |
0 comments
|
Download
|
 |
M |
content/renderer/webplugin_delegate_proxy.cc
|
View
|
1
2
3
4
5
6
|
6 chunks |
+10 lines, -6 lines |
0 comments
|
Download
|
 |
M |
ui/app_list/apps_grid_view.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
ui/app_list/page_switcher.cc
|
View
|
1
2
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
ui/app_list/search_result_view.cc
|
View
|
1
2
|
3 chunks |
+7 lines, -3 lines |
0 comments
|
Download
|
 |
M |
ui/base/gestures/gesture_point.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
ui/base/native_theme/native_theme_base.cc
|
View
|
|
2 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
ui/base/win/hwnd_util.cc
|
View
|
1
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
ui/gfx/blit.cc
|
View
|
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
ui/gfx/image/image_skia_operations.cc
|
View
|
3
4
5
6
7
8
9
10
|
2 chunks |
+6 lines, -3 lines |
0 comments
|
Download
|
 |
M |
ui/gfx/rect.h
|
View
|
1
2
|
1 chunk |
+0 lines, -9 lines |
0 comments
|
Download
|
 |
M |
ui/gfx/rect_base.h
|
View
|
1
2
3
|
1 chunk |
+9 lines, -9 lines |
0 comments
|
Download
|
 |
M |
ui/gfx/rect_base_impl.h
|
View
|
1
2
3
|
7 chunks |
+30 lines, -23 lines |
0 comments
|
Download
|
 |
M |
ui/gfx/rect_f.h
|
View
|
1
2
3
|
1 chunk |
+5 lines, -4 lines |
0 comments
|
Download
|
 |
M |
ui/gfx/rect_unittest.cc
|
View
|
1
2
|
6 chunks |
+39 lines, -41 lines |
0 comments
|
Download
|
 |
M |
ui/gfx/render_text_win.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
ui/gfx/screen_gtk.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
ui/gfx/screen_mac.mm
|
View
|
1
2
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
ui/views/animation/bounds_animator.cc
|
View
|
1
2
|
1 chunk |
+3 lines, -5 lines |
0 comments
|
Download
|
 |
M |
ui/views/animation/bounds_animator_unittest.cc
|
View
|
1
2
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
ui/views/layout/box_layout.cc
|
View
|
1
2
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
ui/views/view.cc
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
ui/views/view_unittest.cc
|
View
|
1
2
|
2 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
 |
M |
ui/views/widget/desktop_root_window_host_linux.cc
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
ui/views/widget/native_widget_aura.cc
|
View
|
1
2
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
 |
M |
ui/views/widget/root_view.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
ui/views/widget/tooltip_manager_win.cc
|
View
|
1
2
3
4
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
ui/views/widget/widget.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
ui/views/win/hwnd_message_handler.cc
|
View
|
1
2
3
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc
|
View
|
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
webkit/plugins/npapi/webplugin_delegate_impl_mac.mm
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
webkit/plugins/ppapi/ppapi_plugin_instance.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+5 lines, -2 lines |
0 comments
|
Download
|
 |
M |
webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
|
View
|
|
3 chunks |
+11 lines, -4 lines |
0 comments
|
Download
|
 |
M |
webkit/plugins/ppapi/ppb_scrollbar_impl.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
webkit/plugins/webview_plugin.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
webkit/tools/test_shell/webwidget_host_gtk.cc
|
View
|
1
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
webkit/tools/test_shell/webwidget_host_mac.mm
|
View
|
1
2
3
4
5
6
7
|
5 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
 |
M |
webkit/tools/test_shell/webwidget_host_win.cc
|
View
|
1
2
3
|
5 chunks |
+7 lines, -7 lines |
0 comments
|
Download
|
Total messages: 30 (0 generated)
|