Chromium Code Reviews| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1107 compositor_deps_); | 1107 compositor_deps_); |
| 1108 compositor_->setViewportSize(physical_backing_size_); | 1108 compositor_->setViewportSize(physical_backing_size_); |
| 1109 OnDeviceScaleFactorChanged(); | 1109 OnDeviceScaleFactorChanged(); |
| 1110 compositor_->SetDeviceColorSpace(screen_info_.icc_profile.GetColorSpace()); | 1110 compositor_->SetDeviceColorSpace(screen_info_.icc_profile.GetColorSpace()); |
| 1111 // For background pages and certain tests, we don't want to trigger | 1111 // For background pages and certain tests, we don't want to trigger |
| 1112 // CompositorFrameSink creation. | 1112 // CompositorFrameSink creation. |
| 1113 if (compositor_never_visible_ || !RenderThreadImpl::current()) | 1113 if (compositor_never_visible_ || !RenderThreadImpl::current()) |
| 1114 compositor_->SetNeverVisible(); | 1114 compositor_->SetNeverVisible(); |
| 1115 | 1115 |
| 1116 StartCompositor(); | 1116 StartCompositor(); |
| 1117 int32_t client_id = 0; | |
| 1118 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
|
Fady Samuel
2016/10/28 18:14:40
DCHECK that we have the switch.
Alex Z.
2016/10/28 18:36:11
Done.
| |
| 1119 switches::kRendererClientId)) | |
| 1120 client_id = | |
| 1121 std::stoi(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | |
|
Fady Samuel
2016/10/28 18:14:40
Use base::StringToInt https://cs.chromium.org/chro
Alex Z.
2016/10/28 18:36:11
Done.
| |
| 1122 switches::kRendererClientId)); | |
| 1123 compositor_->SetFrameSinkId(cc::FrameSinkId(client_id, routing_id_)); | |
| 1117 } | 1124 } |
| 1118 | 1125 |
| 1119 void RenderWidget::WillCloseLayerTreeView() { | 1126 void RenderWidget::WillCloseLayerTreeView() { |
| 1120 if (host_closing_) | 1127 if (host_closing_) |
| 1121 return; | 1128 return; |
| 1122 | 1129 |
| 1123 // Prevent new compositors or output surfaces from being created. | 1130 // Prevent new compositors or output surfaces from being created. |
| 1124 host_closing_ = true; | 1131 host_closing_ = true; |
| 1125 | 1132 |
| 1126 // Always send this notification to prevent new layer tree views from | 1133 // Always send this notification to prevent new layer tree views from |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1501 } | 1508 } |
| 1502 | 1509 |
| 1503 void RenderWidget::OnUpdateWindowScreenRect( | 1510 void RenderWidget::OnUpdateWindowScreenRect( |
| 1504 const gfx::Rect& window_screen_rect) { | 1511 const gfx::Rect& window_screen_rect) { |
| 1505 if (screen_metrics_emulator_) | 1512 if (screen_metrics_emulator_) |
| 1506 screen_metrics_emulator_->OnUpdateWindowScreenRect(window_screen_rect); | 1513 screen_metrics_emulator_->OnUpdateWindowScreenRect(window_screen_rect); |
| 1507 else | 1514 else |
| 1508 window_screen_rect_ = window_screen_rect; | 1515 window_screen_rect_ = window_screen_rect; |
| 1509 } | 1516 } |
| 1510 | 1517 |
| 1511 void RenderWidget::OnSetFrameSinkId(const cc::FrameSinkId& frame_sink_id) { | 1518 void RenderWidget::OnSetFrameSinkId(const cc::FrameSinkId& frame_sink_id) { |
|
Fady Samuel
2016/10/28 18:14:40
delete this and the existing IPC. We don't need it
Alex Z.
2016/10/28 18:36:11
Done.
| |
| 1512 if (compositor_) | 1519 if (compositor_) |
| 1513 compositor_->SetFrameSinkId(frame_sink_id); | 1520 compositor_->SetFrameSinkId(frame_sink_id); |
| 1514 } | 1521 } |
| 1515 | 1522 |
| 1516 void RenderWidget::OnHandleCompositorProto(const std::vector<uint8_t>& proto) { | 1523 void RenderWidget::OnHandleCompositorProto(const std::vector<uint8_t>& proto) { |
| 1517 if (compositor_) | 1524 if (compositor_) |
| 1518 compositor_->OnHandleCompositorProto(proto); | 1525 compositor_->OnHandleCompositorProto(proto); |
| 1519 } | 1526 } |
| 1520 | 1527 |
| 1521 void RenderWidget::showImeIfNeeded() { | 1528 void RenderWidget::showImeIfNeeded() { |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2088 bool RenderWidget::isPointerLocked() { | 2095 bool RenderWidget::isPointerLocked() { |
| 2089 return mouse_lock_dispatcher_->IsMouseLockedTo( | 2096 return mouse_lock_dispatcher_->IsMouseLockedTo( |
| 2090 webwidget_mouse_lock_target_.get()); | 2097 webwidget_mouse_lock_target_.get()); |
| 2091 } | 2098 } |
| 2092 | 2099 |
| 2093 blink::WebWidget* RenderWidget::GetWebWidget() const { | 2100 blink::WebWidget* RenderWidget::GetWebWidget() const { |
| 2094 return webwidget_internal_; | 2101 return webwidget_internal_; |
| 2095 } | 2102 } |
| 2096 | 2103 |
| 2097 } // namespace content | 2104 } // namespace content |
| OLD | NEW |