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

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

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_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 8e4971658ccafc642dcee0821d40ce2346683a8b..94c9d0f53b67c1831cc4f5e832938a4de260f178 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -859,9 +859,8 @@ void RenderWidgetHostViewMac::CopyFromCompositingSurface(
gfx::Rect src_gl_subrect = src_subrect;
src_gl_subrect.set_y(GetViewBounds().height() - src_subrect.bottom());
- 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);
+ gfx::Rect src_pixel_gl_subrect = gfx::ToEnclosingRect(
+ gfx::ScaleRect(src_gl_subrect, scale));
compositing_iosurface_->CopyTo(
src_pixel_gl_subrect,
dst_pixel_size,
@@ -2278,8 +2277,7 @@ 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;
- paintRect.Intersect(damagedRect);
+ gfx::Rect paintRect = gfx::IntersectRects(bitmapRect, 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