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

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: 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 f6cdfd4c2628be5560a7e30be016668793e1f20b..72c1e1c32b263baf7ef1dd6086742d3efcf0a5bf 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -855,9 +855,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::Scale(src_gl_subrect, scale));
compositing_iosurface_->CopyTo(
src_pixel_gl_subrect,
dst_pixel_size,
@@ -2273,8 +2272,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::Intersection(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