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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

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_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index a8d05a8235e3586b5629ed96d82d27156d2a0af1..69bb0cfb5655eea510d05e766782eee9c0de14e0 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -852,8 +852,9 @@ void RenderWidgetHostViewMac::CopyFromCompositingSurface(
gfx::Rect src_gl_subrect = src_subrect;
src_gl_subrect.set_y(GetViewBounds().height() - src_subrect.bottom());
- gfx::Rect src_pixel_gl_subrect =
- gfx::ToEnclosingRect(src_gl_subrect.Scale(scale));
+ gfx::RectF scaled_src_gl_subrect = src_gl_subrect;
+ scaled_src_gl_subrect.Scale(scale);
+ gfx::Rect src_pixel_gl_subrect = gfx::ToEnclosingRect(scaled_src_gl_subrect);
compositing_iosurface_->CopyTo(
src_pixel_gl_subrect,
dst_pixel_size,
@@ -1118,7 +1119,7 @@ gfx::Rect RenderWidgetHostViewMac::GetFirstRectForCompositionRange(
*actual_range = ui::Range(range.start(), end_idx);
gfx::Rect rect = composition_bounds_[range.start()];
for (size_t i = range.start() + 1; i < end_idx; ++i) {
- rect = rect.Union(composition_bounds_[i]);
+ rect.Union(composition_bounds_[i]);
}
return rect;
}
@@ -2269,7 +2270,8 @@ void RenderWidgetHostViewMac::SetTextInputActive(bool active) {
// smaller and the renderer hasn't yet repainted.
int yOffset = NSHeight([self bounds]) - backingStore->size().height();
- gfx::Rect paintRect = bitmapRect.Intersect(damagedRect);
+ gfx::Rect paintRect = bitmapRect;
+ paintRect.Intersect(damagedRect);
if (!paintRect.IsEmpty()) {
// if we have a CGLayer, draw that into the window
if (backingStore->cg_layer()) {

Powered by Google App Engine
This is Rietveld 408576698