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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 // Only update the part of the plugin that actually changed. | 979 // Only update the part of the plugin that actually changed. |
980 optimized_copy_rect.Intersect(bounds); | 980 optimized_copy_rect.Intersect(bounds); |
981 pending_update_params_->bitmap = dib->id(); | 981 pending_update_params_->bitmap = dib->id(); |
982 pending_update_params_->bitmap_rect = optimized_copy_location; | 982 pending_update_params_->bitmap_rect = optimized_copy_location; |
983 pending_update_params_->copy_rects.push_back(optimized_copy_rect); | 983 pending_update_params_->copy_rects.push_back(optimized_copy_rect); |
984 pending_update_params_->scale_factor = dib_scale_factor; | 984 pending_update_params_->scale_factor = dib_scale_factor; |
985 } else if (!is_accelerated_compositing_active_) { | 985 } else if (!is_accelerated_compositing_active_) { |
986 // Compute a buffer for painting and cache it. | 986 // Compute a buffer for painting and cache it. |
987 gfx::RectF scaled_bounds = bounds; | 987 gfx::RectF scaled_bounds = bounds; |
988 scaled_bounds.Scale(device_scale_factor_); | 988 scaled_bounds.Scale(device_scale_factor_); |
989 gfx::Rect pixel_bounds = gfx::ToEnclosingRect(scaled_bounds); | 989 gfx::Rect pixel_bounds = |
| 990 gfx::ToFlooredRectDeprecated(scaled_bounds); |
990 scoped_ptr<skia::PlatformCanvas> canvas( | 991 scoped_ptr<skia::PlatformCanvas> canvas( |
991 RenderProcess::current()->GetDrawingCanvas(¤t_paint_buf_, | 992 RenderProcess::current()->GetDrawingCanvas(¤t_paint_buf_, |
992 pixel_bounds)); | 993 pixel_bounds)); |
993 if (!canvas.get()) { | 994 if (!canvas.get()) { |
994 NOTREACHED(); | 995 NOTREACHED(); |
995 return; | 996 return; |
996 } | 997 } |
997 | 998 |
998 // We may get back a smaller canvas than we asked for. | 999 // We may get back a smaller canvas than we asked for. |
999 // TODO(darin): This seems like it could cause painting problems! | 1000 // TODO(darin): This seems like it could cause painting problems! |
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1902 | 1903 |
1903 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 1904 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
1904 return false; | 1905 return false; |
1905 } | 1906 } |
1906 | 1907 |
1907 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1908 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
1908 return false; | 1909 return false; |
1909 } | 1910 } |
1910 | 1911 |
1911 } // namespace content | 1912 } // namespace content |
OLD | NEW |