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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 DCHECK(!pending_update_params_.get()); | 904 DCHECK(!pending_update_params_.get()); |
905 pending_update_params_.reset(new ViewHostMsg_UpdateRect_Params); | 905 pending_update_params_.reset(new ViewHostMsg_UpdateRect_Params); |
906 pending_update_params_->dx = update.scroll_delta.x(); | 906 pending_update_params_->dx = update.scroll_delta.x(); |
907 pending_update_params_->dy = update.scroll_delta.y(); | 907 pending_update_params_->dy = update.scroll_delta.y(); |
908 pending_update_params_->scroll_rect = update.scroll_rect; | 908 pending_update_params_->scroll_rect = update.scroll_rect; |
909 pending_update_params_->view_size = size_; | 909 pending_update_params_->view_size = size_; |
910 pending_update_params_->plugin_window_moves.swap(plugin_window_moves_); | 910 pending_update_params_->plugin_window_moves.swap(plugin_window_moves_); |
911 pending_update_params_->flags = next_paint_flags_; | 911 pending_update_params_->flags = next_paint_flags_; |
912 pending_update_params_->scroll_offset = GetScrollOffset(); | 912 pending_update_params_->scroll_offset = GetScrollOffset(); |
913 pending_update_params_->needs_ack = true; | 913 pending_update_params_->needs_ack = true; |
| 914 pending_update_params_->scale_factor = device_scale_factor_; |
914 next_paint_flags_ = 0; | 915 next_paint_flags_ = 0; |
915 need_update_rect_for_auto_resize_ = false; | 916 need_update_rect_for_auto_resize_ = false; |
916 | 917 |
917 if (update.scroll_rect.IsEmpty() && | 918 if (update.scroll_rect.IsEmpty() && |
918 !is_accelerated_compositing_active_ && | 919 !is_accelerated_compositing_active_ && |
919 GetBitmapForOptimizedPluginPaint(bounds, &dib, &optimized_copy_location, | 920 GetBitmapForOptimizedPluginPaint(bounds, &dib, &optimized_copy_location, |
920 &optimized_copy_rect)) { | 921 &optimized_copy_rect)) { |
921 // Only update the part of the plugin that actually changed. | 922 // Only update the part of the plugin that actually changed. |
922 optimized_copy_rect = optimized_copy_rect.Intersect(bounds); | 923 optimized_copy_rect = optimized_copy_rect.Intersect(bounds); |
923 pending_update_params_->bitmap = dib->id(); | 924 pending_update_params_->bitmap = dib->id(); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 !plugin_window_moves_.size()) { | 1160 !plugin_window_moves_.size()) { |
1160 return; | 1161 return; |
1161 } | 1162 } |
1162 | 1163 |
1163 ViewHostMsg_UpdateRect_Params params; | 1164 ViewHostMsg_UpdateRect_Params params; |
1164 params.view_size = size_; | 1165 params.view_size = size_; |
1165 params.plugin_window_moves.swap(plugin_window_moves_); | 1166 params.plugin_window_moves.swap(plugin_window_moves_); |
1166 params.flags = next_paint_flags_; | 1167 params.flags = next_paint_flags_; |
1167 params.scroll_offset = GetScrollOffset(); | 1168 params.scroll_offset = GetScrollOffset(); |
1168 params.needs_ack = false; | 1169 params.needs_ack = false; |
| 1170 params.scale_factor = device_scale_factor_; |
1169 | 1171 |
1170 Send(new ViewHostMsg_UpdateRect(routing_id_, params)); | 1172 Send(new ViewHostMsg_UpdateRect(routing_id_, params)); |
1171 next_paint_flags_ = 0; | 1173 next_paint_flags_ = 0; |
1172 need_update_rect_for_auto_resize_ = false; | 1174 need_update_rect_for_auto_resize_ = false; |
1173 } | 1175 } |
1174 | 1176 |
1175 void RenderWidget::scheduleComposite() { | 1177 void RenderWidget::scheduleComposite() { |
1176 if (WebWidgetHandlesCompositorScheduling()) { | 1178 if (WebWidgetHandlesCompositorScheduling()) { |
1177 webwidget_->composite(false); | 1179 webwidget_->composite(false); |
1178 } else { | 1180 } else { |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1741 } | 1743 } |
1742 } | 1744 } |
1743 | 1745 |
1744 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 1746 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
1745 return false; | 1747 return false; |
1746 } | 1748 } |
1747 | 1749 |
1748 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1750 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
1749 return false; | 1751 return false; |
1750 } | 1752 } |
OLD | NEW |