diff options
Diffstat (limited to 'content/browser/renderer_host')
9 files changed, 48 insertions, 30 deletions
diff --git a/content/browser/renderer_host/accelerated_surface_container_mac.cc b/content/browser/renderer_host/accelerated_surface_container_mac.cc index 40115e7..5009b53 100644 --- a/content/browser/renderer_host/accelerated_surface_container_mac.cc +++ b/content/browser/renderer_host/accelerated_surface_container_mac.cc @@ -228,7 +228,7 @@ void AcceleratedSurfaceContainerMac::set_was_painted_to( uint64 surface_handle, const gfx::Rect& update_rect) { set_was_painted_to_common(surface_handle); - update_rect_ = update_rect_.Union(update_rect); + update_rect_.Union(update_rect); } void AcceleratedSurfaceContainerMac::EnqueueTextureForDeletion() { diff --git a/content/browser/renderer_host/backing_store_aura.cc b/content/browser/renderer_host/backing_store_aura.cc index 4a7adaf..5d1149a 100644 --- a/content/browser/renderer_host/backing_store_aura.cc +++ b/content/browser/renderer_host/backing_store_aura.cc @@ -91,8 +91,9 @@ void BackingStoreAura::PaintToBackingStore( if (bitmap_rect.IsEmpty()) return; - gfx::Rect pixel_bitmap_rect = - gfx::ToEnclosedRect(bitmap_rect.Scale(scale_factor)); + gfx::RectF scaled_bitmap_rect = bitmap_rect; + scaled_bitmap_rect.Scale(scale_factor); + gfx::Rect pixel_bitmap_rect = gfx::ToEnclosedRect(scaled_bitmap_rect); const int width = pixel_bitmap_rect.width(); const int height = pixel_bitmap_rect.height(); @@ -112,16 +113,19 @@ void BackingStoreAura::PaintToBackingStore( sk_bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height); sk_bitmap.setPixels(dib->memory()); for (size_t i = 0; i < copy_rects.size(); i++) { - const gfx::Rect pixel_copy_rect = - gfx::ToEnclosingRect(copy_rects[i].Scale(scale_factor)); + gfx::RectF scaled_copy_rect = copy_rects[i]; + scaled_copy_rect.Scale(scale_factor); + const gfx::Rect pixel_copy_rect = gfx::ToEnclosingRect(scaled_copy_rect); int x = pixel_copy_rect.x() - pixel_bitmap_rect.x(); int y = pixel_copy_rect.y() - pixel_bitmap_rect.y(); SkIRect srcrect = SkIRect::MakeXYWH(x, y, pixel_copy_rect.width(), pixel_copy_rect.height()); + gfx::RectF scaled_copy_dst_rect = copy_rects[i]; + scaled_copy_dst_rect.Scale(device_scale_factor_); const gfx::Rect pixel_copy_dst_rect = - gfx::ToEnclosingRect(copy_rects[i].Scale(device_scale_factor_)); + gfx::ToEnclosingRect(scaled_copy_dst_rect); SkRect dstrect = SkRect::MakeXYWH( SkIntToScalar(pixel_copy_dst_rect.x()), SkIntToScalar(pixel_copy_dst_rect.y()), @@ -134,8 +138,9 @@ void BackingStoreAura::PaintToBackingStore( void BackingStoreAura::ScrollBackingStore(int dx, int dy, const gfx::Rect& clip_rect, const gfx::Size& view_size) { - gfx::Rect pixel_rect = - gfx::ToEnclosingRect(clip_rect.Scale(device_scale_factor_)); + gfx::RectF scaled_clip_rect = clip_rect; + scaled_clip_rect.Scale(device_scale_factor_); + gfx::Rect pixel_rect = gfx::ToEnclosingRect(scaled_clip_rect); int pixel_dx = dx * device_scale_factor_; int pixel_dy = dy * device_scale_factor_; diff --git a/content/browser/renderer_host/backing_store_mac.mm b/content/browser/renderer_host/backing_store_mac.mm index 0cb5a3b..d8513e4 100644 --- a/content/browser/renderer_host/backing_store_mac.mm +++ b/content/browser/renderer_host/backing_store_mac.mm @@ -101,8 +101,9 @@ void BackingStoreMac::PaintToBackingStore( gfx::Size pixel_size = gfx::ToFlooredSize( size().Scale(device_scale_factor_)); - gfx::Rect pixel_bitmap_rect = - ToFlooredRect(bitmap_rect.Scale(scale_factor)); + gfx::RectF scaled_bitmap_rect = bitmap_rect; + scaled_bitmap_rect.Scale(scale_factor); + gfx::Rect pixel_bitmap_rect = ToFlooredRect(scaled_bitmap_rect); size_t bitmap_byte_count = pixel_bitmap_rect.width() * pixel_bitmap_rect.height() * 4; @@ -121,8 +122,9 @@ void BackingStoreMac::PaintToBackingStore( for (size_t i = 0; i < copy_rects.size(); i++) { const gfx::Rect& copy_rect = copy_rects[i]; - gfx::Rect pixel_copy_rect = - ToFlooredRect(copy_rect.Scale(scale_factor)); + gfx::RectF scaled_copy_rect = copy_rect; + scaled_copy_rect.Scale(scale_factor); + gfx::Rect pixel_copy_rect = ToFlooredRect(scaled_copy_rect); // Only the subpixels given by copy_rect have pixels to copy. base::mac::ScopedCFTypeRef<CGImageRef> image( diff --git a/content/browser/renderer_host/backing_store_win.cc b/content/browser/renderer_host/backing_store_win.cc index 2c8d435..a16bd80 100644 --- a/content/browser/renderer_host/backing_store_win.cc +++ b/content/browser/renderer_host/backing_store_win.cc @@ -143,7 +143,8 @@ void BackingStoreWin::PaintToBackingStore( gfx::Rect view_rect(size()); for (size_t i = 0; i < copy_rects.size(); i++) { - gfx::Rect paint_rect = view_rect.Intersect(copy_rects[i]); + gfx::Rect paint_rect = view_rect; + paint_rect.Intersect(copy_rects[i]); CallStretchDIBits(hdc_, paint_rect.x(), paint_rect.y(), diff --git a/content/browser/renderer_host/gtk_window_utils.cc b/content/browser/renderer_host/gtk_window_utils.cc index de62f45..c47972a 100644 --- a/content/browser/renderer_host/gtk_window_utils.cc +++ b/content/browser/renderer_host/gtk_window_utils.cc @@ -63,7 +63,7 @@ void GetScreenInfoFromNativeWindow( gfx::Rect available_rect = results->rect; gfx::Rect work_area = GetWorkArea(GDK_WINDOW_XID(gdk_window)); if (!work_area.IsEmpty()) - available_rect = available_rect.Intersect(work_area); + available_rect.Intersect(work_area); results->availableRect = available_rect; } 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 4d497cf..6896797 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 { 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 c68dfb1..dbe534d4 100644 --- a/content/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc @@ -858,19 +858,20 @@ void RenderWidgetHostViewGtk::DidUpdateBackingStore( // be done using XCopyArea? Perhaps similar to // BackingStore::ScrollBackingStore? if (about_to_validate_and_paint_) - invalid_rect_ = invalid_rect_.Union(scroll_rect); + invalid_rect_.Union(scroll_rect); else Paint(scroll_rect); 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].Subtract(scroll_rect); + gfx::Rect rect = copy_rects[i]; + rect.Subtract(scroll_rect); if (rect.IsEmpty()) continue; if (about_to_validate_and_paint_) - invalid_rect_ = invalid_rect_.Union(rect); + invalid_rect_.Union(rect); else Paint(rect); } @@ -968,7 +969,9 @@ void RenderWidgetHostViewGtk::SelectionBoundsChanged( WebKit::WebTextDirection start_direction, const gfx::Rect& end_rect, WebKit::WebTextDirection end_direction) { - im_context_->UpdateCaretBounds(start_rect.Union(end_rect)); + gfx::Rect combined_rect = start_rect; + combined_rect.Union(end_rect); + im_context_->UpdateCaretBounds(combined_rect); } GdkEventButton* RenderWidgetHostViewGtk::GetLastMouseDown() { @@ -1175,7 +1178,7 @@ void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) { about_to_validate_and_paint_ = false; gfx::Rect paint_rect = gfx::Rect(0, 0, kMaxWindowWidth, kMaxWindowHeight); - paint_rect = paint_rect.Intersect(invalid_rect_); + paint_rect.Intersect(invalid_rect_); if (backing_store) { // Only render the widget if it is attached to a window; there's a short 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 a8d05a8..69bb0cf 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()) { diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc index 508619a..03e7d6e 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.cc +++ b/content/browser/renderer_host/render_widget_host_view_win.cc @@ -771,7 +771,8 @@ void RenderWidgetHostViewWin::SelectionBoundsChanged( text_input_type_ != ui::TEXT_INPUT_TYPE_PASSWORD); // Only update caret position if the input method is enabled. if (is_enabled) { - caret_rect_ = start_rect.Union(end_rect); + caret_rect_ = start_rect; + caret_rect_.Union(end_rect); ime_input_.UpdateCaretRect(m_hWnd, caret_rect_); } } @@ -1357,7 +1358,8 @@ void RenderWidgetHostViewWin::OnPaint(HDC unused_dc) { } for (DWORD i = 0; i < region_data->rdh.nCount; ++i) { - gfx::Rect paint_rect = bitmap_rect.Intersect(gfx::Rect(region_rects[i])); + gfx::Rect paint_rect = bitmap_rect; + paint_rect.Intersect(gfx::Rect(region_rects[i])); if (!paint_rect.IsEmpty()) { BitBlt(paint_dc.m_hDC, paint_rect.x(), |