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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 11270042: Add non-member non-mutating methods for common gfx::Rect operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 2b7bff8a079c9060a367804516672b795b754884..fa2b8aca180dde2780c5eb8c73840088f980aa2c 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -557,8 +557,7 @@ void RenderWidgetHostViewAura::DidUpdateBackingStore(
SchedulePaintIfNotInClip(scroll_rect, clip_rect);
for (size_t i = 0; i < copy_rects.size(); ++i) {
- gfx::Rect rect = copy_rects[i];
- rect.Subtract(scroll_rect);
+ gfx::Rect rect = gfx::Subtraction(copy_rects[i], scroll_rect);
if (rect.IsEmpty())
continue;
@@ -1168,8 +1167,7 @@ gfx::Rect RenderWidgetHostViewAura::ConvertRectToScreen(const gfx::Rect& rect) {
}
gfx::Rect RenderWidgetHostViewAura::GetCaretBounds() {
- gfx::Rect rect = selection_start_rect_;
- rect.Union(selection_end_rect_);
+ const gfx::Rect rect = gfx::Union(selection_start_rect_, selection_end_rect_);
return ConvertRectToScreen(rect);
}
@@ -1799,8 +1797,7 @@ void RenderWidgetHostViewAura::SchedulePaintIfNotInClip(
const gfx::Rect& rect,
const gfx::Rect& clip) {
if (!clip.IsEmpty()) {
- gfx::Rect to_paint = rect;
- to_paint.Subtract(clip);
+ gfx::Rect to_paint = gfx::Subtraction(rect, clip);
if (!to_paint.IsEmpty())
window_->SchedulePaintInRect(to_paint);
} else {

Powered by Google App Engine
This is Rietveld 408576698