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

Unified Diff: content/browser/renderer_host/render_widget_host_view_gtk.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: rebased 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_gtk.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/content/browser/renderer_host/render_widget_host_view_gtk.cc
index b429496f183fdb244b2c752c32c0aaaf3bf85220..849166352e763dde1af6f899436ad911b78b620f 100644
--- a/content/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -865,8 +865,7 @@ void RenderWidgetHostViewGtk::DidUpdateBackingStore(
for (size_t i = 0; i < copy_rects.size(); ++i) {
// Avoid double painting. NOTE: This is only relevant given the call to
// Paint(scroll_rect) above.
- gfx::Rect rect = copy_rects[i];
- rect.Subtract(scroll_rect);
+ gfx::Rect rect = gfx::SubtractRects(copy_rects[i], scroll_rect);
if (rect.IsEmpty())
continue;
@@ -969,9 +968,7 @@ void RenderWidgetHostViewGtk::SelectionBoundsChanged(
WebKit::WebTextDirection start_direction,
const gfx::Rect& end_rect,
WebKit::WebTextDirection end_direction) {
- gfx::Rect combined_rect = start_rect;
- combined_rect.Union(end_rect);
- im_context_->UpdateCaretBounds(combined_rect);
+ im_context_->UpdateCaretBounds(gfx::UnionRects(start_rect, end_rect));
}
GdkEventButton* RenderWidgetHostViewGtk::GetLastMouseDown() {

Powered by Google App Engine
This is Rietveld 408576698