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/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1079 } | 1079 } |
1080 | 1080 |
1081 void RenderWidgetHostViewAura::OnLegacyWindowDestroyed() { | 1081 void RenderWidgetHostViewAura::OnLegacyWindowDestroyed() { |
1082 legacy_render_widget_host_HWND_ = NULL; | 1082 legacy_render_widget_host_HWND_ = NULL; |
1083 legacy_window_destroyed_ = true; | 1083 legacy_window_destroyed_ = true; |
1084 } | 1084 } |
1085 #endif | 1085 #endif |
1086 | 1086 |
1087 void RenderWidgetHostViewAura::OnSwapCompositorFrame( | 1087 void RenderWidgetHostViewAura::OnSwapCompositorFrame( |
1088 uint32_t output_surface_id, | 1088 uint32_t output_surface_id, |
| 1089 const cc::SurfaceId& surface_id, |
1089 cc::CompositorFrame frame) { | 1090 cc::CompositorFrame frame) { |
1090 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); | 1091 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); |
1091 | 1092 |
1092 last_scroll_offset_ = frame.metadata.root_scroll_offset; | 1093 last_scroll_offset_ = frame.metadata.root_scroll_offset; |
1093 if (!frame.delegated_frame_data) | 1094 if (!frame.delegated_frame_data) |
1094 return; | 1095 return; |
1095 | 1096 |
1096 cc::Selection<gfx::SelectionBound> selection = frame.metadata.selection; | 1097 cc::Selection<gfx::SelectionBound> selection = frame.metadata.selection; |
1097 if (IsUseZoomForDSFEnabled()) { | 1098 if (IsUseZoomForDSFEnabled()) { |
1098 float viewportToDIPScale = 1.0f / current_device_scale_factor_; | 1099 float viewportToDIPScale = 1.0f / current_device_scale_factor_; |
1099 gfx::PointF start_edge_top = selection.start.edge_top(); | 1100 gfx::PointF start_edge_top = selection.start.edge_top(); |
1100 gfx::PointF start_edge_bottom = selection.start.edge_bottom(); | 1101 gfx::PointF start_edge_bottom = selection.start.edge_bottom(); |
1101 gfx::PointF end_edge_top = selection.end.edge_top(); | 1102 gfx::PointF end_edge_top = selection.end.edge_top(); |
1102 gfx::PointF end_edge_bottom = selection.end.edge_bottom(); | 1103 gfx::PointF end_edge_bottom = selection.end.edge_bottom(); |
1103 | 1104 |
1104 start_edge_top.Scale(viewportToDIPScale); | 1105 start_edge_top.Scale(viewportToDIPScale); |
1105 start_edge_bottom.Scale(viewportToDIPScale); | 1106 start_edge_bottom.Scale(viewportToDIPScale); |
1106 end_edge_top.Scale(viewportToDIPScale); | 1107 end_edge_top.Scale(viewportToDIPScale); |
1107 end_edge_bottom.Scale(viewportToDIPScale); | 1108 end_edge_bottom.Scale(viewportToDIPScale); |
1108 | 1109 |
1109 selection.start.SetEdge(start_edge_top, start_edge_bottom); | 1110 selection.start.SetEdge(start_edge_top, start_edge_bottom); |
1110 selection.end.SetEdge(end_edge_top, end_edge_bottom); | 1111 selection.end.SetEdge(end_edge_top, end_edge_bottom); |
1111 } | 1112 } |
1112 | 1113 |
1113 delegated_frame_host_->SwapDelegatedFrame(output_surface_id, | 1114 delegated_frame_host_->SwapDelegatedFrame(output_surface_id, surface_id, |
1114 std::move(frame)); | 1115 std::move(frame)); |
1115 SelectionUpdated(selection.is_editable, selection.is_empty_text_form_control, | 1116 SelectionUpdated(selection.is_editable, selection.is_empty_text_form_control, |
1116 selection.start, selection.end); | 1117 selection.start, selection.end); |
1117 } | 1118 } |
1118 | 1119 |
1119 void RenderWidgetHostViewAura::ClearCompositorFrame() { | 1120 void RenderWidgetHostViewAura::ClearCompositorFrame() { |
1120 delegated_frame_host_->ClearDelegatedFrame(); | 1121 delegated_frame_host_->ClearDelegatedFrame(); |
1121 } | 1122 } |
1122 | 1123 |
1123 void RenderWidgetHostViewAura::DidStopFlinging() { | 1124 void RenderWidgetHostViewAura::DidStopFlinging() { |
(...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3001 | 3002 |
3002 //////////////////////////////////////////////////////////////////////////////// | 3003 //////////////////////////////////////////////////////////////////////////////// |
3003 // RenderWidgetHostViewBase, public: | 3004 // RenderWidgetHostViewBase, public: |
3004 | 3005 |
3005 // static | 3006 // static |
3006 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 3007 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
3007 GetScreenInfoForWindow(results, NULL); | 3008 GetScreenInfoForWindow(results, NULL); |
3008 } | 3009 } |
3009 | 3010 |
3010 } // namespace content | 3011 } // namespace content |
OLD | NEW |