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

Side by Side Diff: content/renderer/render_widget.cc

Issue 10996037: Do not convert from RectF to Rect by flooring. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 &optimized_copy_rect, 964 &optimized_copy_rect,
965 &dib_scale_factor)) { 965 &dib_scale_factor)) {
966 // Only update the part of the plugin that actually changed. 966 // Only update the part of the plugin that actually changed.
967 optimized_copy_rect = optimized_copy_rect.Intersect(bounds); 967 optimized_copy_rect = optimized_copy_rect.Intersect(bounds);
968 pending_update_params_->bitmap = dib->id(); 968 pending_update_params_->bitmap = dib->id();
969 pending_update_params_->bitmap_rect = optimized_copy_location; 969 pending_update_params_->bitmap_rect = optimized_copy_location;
970 pending_update_params_->copy_rects.push_back(optimized_copy_rect); 970 pending_update_params_->copy_rects.push_back(optimized_copy_rect);
971 pending_update_params_->scale_factor = dib_scale_factor; 971 pending_update_params_->scale_factor = dib_scale_factor;
972 } else if (!is_accelerated_compositing_active_) { 972 } else if (!is_accelerated_compositing_active_) {
973 // Compute a buffer for painting and cache it. 973 // Compute a buffer for painting and cache it.
974 gfx::Rect pixel_bounds = bounds.Scale(device_scale_factor_); 974 gfx::Rect pixel_bounds = bounds.ScaleUnsafe(device_scale_factor_);
975 scoped_ptr<skia::PlatformCanvas> canvas( 975 scoped_ptr<skia::PlatformCanvas> canvas(
976 RenderProcess::current()->GetDrawingCanvas(&current_paint_buf_, 976 RenderProcess::current()->GetDrawingCanvas(&current_paint_buf_,
977 pixel_bounds)); 977 pixel_bounds));
978 if (!canvas.get()) { 978 if (!canvas.get()) {
979 NOTREACHED(); 979 NOTREACHED();
980 return; 980 return;
981 } 981 }
982 982
983 // We may get back a smaller canvas than we asked for. 983 // We may get back a smaller canvas than we asked for.
984 // TODO(darin): This seems like it could cause painting problems! 984 // TODO(darin): This seems like it could cause painting problems!
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
1863 pending_smooth_scroll_gestures_.insert(std::make_pair(id, callback)); 1863 pending_smooth_scroll_gestures_.insert(std::make_pair(id, callback));
1864 } 1864 }
1865 1865
1866 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { 1866 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) {
1867 return false; 1867 return false;
1868 } 1868 }
1869 1869
1870 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { 1870 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const {
1871 return false; 1871 return false;
1872 } 1872 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698