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

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

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes 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 4d497cfb5f6885eed6ebf481a430f559f09369a0..6896797ea5ec633f904e12bd1372fc20f29ee11e 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -437,7 +437,7 @@ void RenderWidgetHostViewAura::MovePluginWindows(
gfx::Rect clip = moves[i].clip_rect;
clip.Offset(moves[i].window_rect.origin());
clip.Offset(scroll_offset);
- clip = clip.Intersect(view_port);
+ clip.Intersect(view_port);
clip.Offset(-moves[i].window_rect.x(), -moves[i].window_rect.y());
clip.Offset(-scroll_offset.x(), -scroll_offset.y());
moves[i].clip_rect = clip;
@@ -558,7 +558,8 @@ void RenderWidgetHostViewAura::DidUpdateBackingStore(
SchedulePaintIfNotInClip(scroll_rect, clip_rect);
for (size_t i = 0; i < copy_rects.size(); ++i) {
- gfx::Rect rect = copy_rects[i].Subtract(scroll_rect);
+ gfx::Rect rect = copy_rects[i];
+ rect.Subtract(scroll_rect);
if (rect.IsEmpty())
continue;
@@ -871,7 +872,7 @@ void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer(
// Damage may not have been DIP aligned, so inflate damage to compensate
// for any round-off error.
rect_to_paint.Inset(-1, -1);
- rect_to_paint = rect_to_paint.Intersect(window_->bounds());
+ rect_to_paint.Intersect(window_->bounds());
window_->SchedulePaintInRect(rect_to_paint);
@@ -1168,7 +1169,8 @@ gfx::Rect RenderWidgetHostViewAura::ConvertRectToScreen(const gfx::Rect& rect) {
}
gfx::Rect RenderWidgetHostViewAura::GetCaretBounds() {
- const gfx::Rect rect = selection_start_rect_.Union(selection_end_rect_);
+ gfx::Rect rect = selection_start_rect_;
+ rect.Union(selection_end_rect_);
return ConvertRectToScreen(rect);
}
@@ -1796,7 +1798,8 @@ void RenderWidgetHostViewAura::SchedulePaintIfNotInClip(
const gfx::Rect& rect,
const gfx::Rect& clip) {
if (!clip.IsEmpty()) {
- gfx::Rect to_paint = rect.Subtract(clip);
+ gfx::Rect to_paint = rect;
+ to_paint.Subtract(clip);
if (!to_paint.IsEmpty())
window_->SchedulePaintInRect(to_paint);
} else {
« no previous file with comments | « content/browser/renderer_host/gtk_window_utils.cc ('k') | content/browser/renderer_host/render_widget_host_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698