OLD | NEW |
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 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 &dib_scale_factor)) { | 975 &dib_scale_factor)) { |
976 // Only update the part of the plugin that actually changed. | 976 // Only update the part of the plugin that actually changed. |
977 optimized_copy_rect = optimized_copy_rect.Intersect(bounds); | 977 optimized_copy_rect = optimized_copy_rect.Intersect(bounds); |
978 pending_update_params_->bitmap = dib->id(); | 978 pending_update_params_->bitmap = dib->id(); |
979 pending_update_params_->bitmap_rect = optimized_copy_location; | 979 pending_update_params_->bitmap_rect = optimized_copy_location; |
980 pending_update_params_->copy_rects.push_back(optimized_copy_rect); | 980 pending_update_params_->copy_rects.push_back(optimized_copy_rect); |
981 pending_update_params_->scale_factor = dib_scale_factor; | 981 pending_update_params_->scale_factor = dib_scale_factor; |
982 } else if (!is_accelerated_compositing_active_) { | 982 } else if (!is_accelerated_compositing_active_) { |
983 // Compute a buffer for painting and cache it. | 983 // Compute a buffer for painting and cache it. |
984 gfx::Rect pixel_bounds = | 984 gfx::Rect pixel_bounds = |
985 gfx::ToEnclosingRect(bounds.Scale(device_scale_factor_)); | 985 gfx::ToFlooredRectDeprecated(bounds.Scale(device_scale_factor_)); |
986 scoped_ptr<skia::PlatformCanvas> canvas( | 986 scoped_ptr<skia::PlatformCanvas> canvas( |
987 RenderProcess::current()->GetDrawingCanvas(¤t_paint_buf_, | 987 RenderProcess::current()->GetDrawingCanvas(¤t_paint_buf_, |
988 pixel_bounds)); | 988 pixel_bounds)); |
989 if (!canvas.get()) { | 989 if (!canvas.get()) { |
990 NOTREACHED(); | 990 NOTREACHED(); |
991 return; | 991 return; |
992 } | 992 } |
993 | 993 |
994 // We may get back a smaller canvas than we asked for. | 994 // We may get back a smaller canvas than we asked for. |
995 // TODO(darin): This seems like it could cause painting problems! | 995 // TODO(darin): This seems like it could cause painting problems! |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 | 1890 |
1891 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 1891 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
1892 return false; | 1892 return false; |
1893 } | 1893 } |
1894 | 1894 |
1895 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1895 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
1896 return false; | 1896 return false; |
1897 } | 1897 } |
1898 | 1898 |
1899 } // namespace content | 1899 } // namespace content |
OLD | NEW |