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 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 DCHECK(!params.needs_resize_ack || !next_paint_is_resize_ack()); | 1036 DCHECK(!params.needs_resize_ack || !next_paint_is_resize_ack()); |
1037 } | 1037 } |
1038 | 1038 |
1039 // Ignore this during shutdown. | 1039 // Ignore this during shutdown. |
1040 if (!webwidget_) | 1040 if (!webwidget_) |
1041 return; | 1041 return; |
1042 | 1042 |
1043 if (compositor_) { | 1043 if (compositor_) { |
1044 compositor_->setViewportSize(params.physical_backing_size); | 1044 compositor_->setViewportSize(params.physical_backing_size); |
1045 compositor_->setBottomControlsHeight(params.bottom_controls_height); | 1045 compositor_->setBottomControlsHeight(params.bottom_controls_height); |
| 1046 compositor_->SetDeviceColorSpace(screen_info_.icc_profile.GetColorSpace()); |
1046 } | 1047 } |
1047 | 1048 |
1048 visible_viewport_size_ = params.visible_viewport_size; | 1049 visible_viewport_size_ = params.visible_viewport_size; |
1049 resizer_rect_ = params.resizer_rect; | 1050 resizer_rect_ = params.resizer_rect; |
1050 | 1051 |
1051 // NOTE: We may have entered fullscreen mode without changing our size. | 1052 // NOTE: We may have entered fullscreen mode without changing our size. |
1052 bool fullscreen_change = | 1053 bool fullscreen_change = |
1053 is_fullscreen_granted_ != params.is_fullscreen_granted; | 1054 is_fullscreen_granted_ != params.is_fullscreen_granted; |
1054 is_fullscreen_granted_ = params.is_fullscreen_granted; | 1055 is_fullscreen_granted_ = params.is_fullscreen_granted; |
1055 display_mode_ = params.display_mode; | 1056 display_mode_ = params.display_mode; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 compositor_->setViewportSize(physical_backing_size_); | 1119 compositor_->setViewportSize(physical_backing_size_); |
1119 } | 1120 } |
1120 | 1121 |
1121 void RenderWidget::initializeLayerTreeView() { | 1122 void RenderWidget::initializeLayerTreeView() { |
1122 DCHECK(!host_closing_); | 1123 DCHECK(!host_closing_); |
1123 | 1124 |
1124 compositor_ = RenderWidgetCompositor::Create(this, device_scale_factor_, | 1125 compositor_ = RenderWidgetCompositor::Create(this, device_scale_factor_, |
1125 compositor_deps_); | 1126 compositor_deps_); |
1126 compositor_->setViewportSize(physical_backing_size_); | 1127 compositor_->setViewportSize(physical_backing_size_); |
1127 OnDeviceScaleFactorChanged(); | 1128 OnDeviceScaleFactorChanged(); |
| 1129 compositor_->SetDeviceColorSpace(screen_info_.icc_profile.GetColorSpace()); |
1128 // For background pages and certain tests, we don't want to trigger | 1130 // For background pages and certain tests, we don't want to trigger |
1129 // OutputSurface creation. | 1131 // OutputSurface creation. |
1130 if (compositor_never_visible_ || !RenderThreadImpl::current()) | 1132 if (compositor_never_visible_ || !RenderThreadImpl::current()) |
1131 compositor_->SetNeverVisible(); | 1133 compositor_->SetNeverVisible(); |
1132 | 1134 |
1133 StartCompositor(); | 1135 StartCompositor(); |
1134 } | 1136 } |
1135 | 1137 |
1136 void RenderWidget::WillCloseLayerTreeView() { | 1138 void RenderWidget::WillCloseLayerTreeView() { |
1137 if (host_closing_) | 1139 if (host_closing_) |
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2115 void RenderWidget::requestPointerUnlock() { | 2117 void RenderWidget::requestPointerUnlock() { |
2116 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); | 2118 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); |
2117 } | 2119 } |
2118 | 2120 |
2119 bool RenderWidget::isPointerLocked() { | 2121 bool RenderWidget::isPointerLocked() { |
2120 return mouse_lock_dispatcher_->IsMouseLockedTo( | 2122 return mouse_lock_dispatcher_->IsMouseLockedTo( |
2121 webwidget_mouse_lock_target_.get()); | 2123 webwidget_mouse_lock_target_.get()); |
2122 } | 2124 } |
2123 | 2125 |
2124 } // namespace content | 2126 } // namespace content |
OLD | NEW |