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 18 matching lines...) Expand all Loading... |
29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" |
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" |
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
32 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" |
33 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 33 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
34 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 34 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
35 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 35 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
36 #include "third_party/skia/include/core/SkShader.h" | 36 #include "third_party/skia/include/core/SkShader.h" |
37 #include "ui/base/ui_base_switches.h" | 37 #include "ui/base/ui_base_switches.h" |
38 #include "ui/gfx/point.h" | 38 #include "ui/gfx/point.h" |
| 39 #include "ui/gfx/rect_conversions.h" |
39 #include "ui/gfx/size.h" | 40 #include "ui/gfx/size.h" |
40 #include "ui/gfx/skia_util.h" | 41 #include "ui/gfx/skia_util.h" |
41 #include "ui/gl/gl_switches.h" | 42 #include "ui/gl/gl_switches.h" |
42 #include "ui/surface/transport_dib.h" | 43 #include "ui/surface/transport_dib.h" |
43 #include "webkit/glue/webkit_glue.h" | 44 #include "webkit/glue/webkit_glue.h" |
44 #include "webkit/plugins/npapi/webplugin.h" | 45 #include "webkit/plugins/npapi/webplugin.h" |
45 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 46 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
46 | 47 |
47 #if defined(OS_POSIX) | 48 #if defined(OS_POSIX) |
48 #include "ipc/ipc_channel_posix.h" | 49 #include "ipc/ipc_channel_posix.h" |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 &optimized_copy_rect, | 965 &optimized_copy_rect, |
965 &dib_scale_factor)) { | 966 &dib_scale_factor)) { |
966 // Only update the part of the plugin that actually changed. | 967 // Only update the part of the plugin that actually changed. |
967 optimized_copy_rect = optimized_copy_rect.Intersect(bounds); | 968 optimized_copy_rect = optimized_copy_rect.Intersect(bounds); |
968 pending_update_params_->bitmap = dib->id(); | 969 pending_update_params_->bitmap = dib->id(); |
969 pending_update_params_->bitmap_rect = optimized_copy_location; | 970 pending_update_params_->bitmap_rect = optimized_copy_location; |
970 pending_update_params_->copy_rects.push_back(optimized_copy_rect); | 971 pending_update_params_->copy_rects.push_back(optimized_copy_rect); |
971 pending_update_params_->scale_factor = dib_scale_factor; | 972 pending_update_params_->scale_factor = dib_scale_factor; |
972 } else if (!is_accelerated_compositing_active_) { | 973 } else if (!is_accelerated_compositing_active_) { |
973 // Compute a buffer for painting and cache it. | 974 // Compute a buffer for painting and cache it. |
974 gfx::Rect pixel_bounds = bounds.Scale(device_scale_factor_); | 975 gfx::Rect pixel_bounds = |
| 976 gfx::ToEnclosingRect(bounds.Scale(device_scale_factor_)); |
975 scoped_ptr<skia::PlatformCanvas> canvas( | 977 scoped_ptr<skia::PlatformCanvas> canvas( |
976 RenderProcess::current()->GetDrawingCanvas(¤t_paint_buf_, | 978 RenderProcess::current()->GetDrawingCanvas(¤t_paint_buf_, |
977 pixel_bounds)); | 979 pixel_bounds)); |
978 if (!canvas.get()) { | 980 if (!canvas.get()) { |
979 NOTREACHED(); | 981 NOTREACHED(); |
980 return; | 982 return; |
981 } | 983 } |
982 | 984 |
983 // We may get back a smaller canvas than we asked for. | 985 // We may get back a smaller canvas than we asked for. |
984 // TODO(darin): This seems like it could cause painting problems! | 986 // TODO(darin): This seems like it could cause painting problems! |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1863 pending_smooth_scroll_gestures_.insert(std::make_pair(id, callback)); | 1865 pending_smooth_scroll_gestures_.insert(std::make_pair(id, callback)); |
1864 } | 1866 } |
1865 | 1867 |
1866 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 1868 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
1867 return false; | 1869 return false; |
1868 } | 1870 } |
1869 | 1871 |
1870 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1872 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
1871 return false; | 1873 return false; |
1872 } | 1874 } |
OLD | NEW |