| 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 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 DCHECK(!params.needs_resize_ack || !next_paint_is_resize_ack()); | 1189 DCHECK(!params.needs_resize_ack || !next_paint_is_resize_ack()); |
| 1190 } | 1190 } |
| 1191 | 1191 |
| 1192 // Ignore this during shutdown. | 1192 // Ignore this during shutdown. |
| 1193 if (!GetWebWidget()) | 1193 if (!GetWebWidget()) |
| 1194 return; | 1194 return; |
| 1195 | 1195 |
| 1196 if (compositor_) { | 1196 if (compositor_) { |
| 1197 compositor_->setViewportSize(params.physical_backing_size); | 1197 compositor_->setViewportSize(params.physical_backing_size); |
| 1198 compositor_->setBottomControlsHeight(params.bottom_controls_height); | 1198 compositor_->setBottomControlsHeight(params.bottom_controls_height); |
| 1199 compositor_->SetDeviceColorSpace(screen_info_.icc_profile.GetColorSpace()); | 1199 compositor_->SetRasterColorSpace(screen_info_.icc_profile.GetColorSpace()); |
| 1200 } | 1200 } |
| 1201 | 1201 |
| 1202 visible_viewport_size_ = params.visible_viewport_size; | 1202 visible_viewport_size_ = params.visible_viewport_size; |
| 1203 | 1203 |
| 1204 // NOTE: We may have entered fullscreen mode without changing our size. | 1204 // NOTE: We may have entered fullscreen mode without changing our size. |
| 1205 bool fullscreen_change = | 1205 bool fullscreen_change = |
| 1206 is_fullscreen_granted_ != params.is_fullscreen_granted; | 1206 is_fullscreen_granted_ != params.is_fullscreen_granted; |
| 1207 is_fullscreen_granted_ = params.is_fullscreen_granted; | 1207 is_fullscreen_granted_ = params.is_fullscreen_granted; |
| 1208 display_mode_ = params.display_mode; | 1208 display_mode_ = params.display_mode; |
| 1209 | 1209 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 | 1279 |
| 1280 auto layer_tree_host = RenderWidgetCompositor::CreateLayerTreeHost( | 1280 auto layer_tree_host = RenderWidgetCompositor::CreateLayerTreeHost( |
| 1281 compositor_.get(), compositor_.get(), animation_host.get(), | 1281 compositor_.get(), compositor_.get(), animation_host.get(), |
| 1282 compositor_deps_, device_scale_factor_, screen_info_); | 1282 compositor_deps_, device_scale_factor_, screen_info_); |
| 1283 compositor_->Initialize(std::move(layer_tree_host), | 1283 compositor_->Initialize(std::move(layer_tree_host), |
| 1284 std::move(animation_host)); | 1284 std::move(animation_host)); |
| 1285 | 1285 |
| 1286 compositor_->SetIsForOopif(for_oopif_); | 1286 compositor_->SetIsForOopif(for_oopif_); |
| 1287 compositor_->setViewportSize(physical_backing_size_); | 1287 compositor_->setViewportSize(physical_backing_size_); |
| 1288 OnDeviceScaleFactorChanged(); | 1288 OnDeviceScaleFactorChanged(); |
| 1289 compositor_->SetDeviceColorSpace(screen_info_.icc_profile.GetColorSpace()); | 1289 compositor_->SetRasterColorSpace(screen_info_.icc_profile.GetColorSpace()); |
| 1290 compositor_->SetContentSourceId(current_content_source_id_); | 1290 compositor_->SetContentSourceId(current_content_source_id_); |
| 1291 // For background pages and certain tests, we don't want to trigger | 1291 // For background pages and certain tests, we don't want to trigger |
| 1292 // CompositorFrameSink creation. | 1292 // CompositorFrameSink creation. |
| 1293 if (compositor_never_visible_ || !RenderThreadImpl::current()) | 1293 if (compositor_never_visible_ || !RenderThreadImpl::current()) |
| 1294 compositor_->SetNeverVisible(); | 1294 compositor_->SetNeverVisible(); |
| 1295 | 1295 |
| 1296 StartCompositor(); | 1296 StartCompositor(); |
| 1297 DCHECK_NE(MSG_ROUTING_NONE, routing_id_); | 1297 DCHECK_NE(MSG_ROUTING_NONE, routing_id_); |
| 1298 compositor_->SetFrameSinkId( | 1298 compositor_->SetFrameSinkId( |
| 1299 cc::FrameSinkId(RenderThread::Get()->GetClientId(), routing_id_)); | 1299 cc::FrameSinkId(RenderThread::Get()->GetClientId(), routing_id_)); |
| (...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2323 // browser side (https://crbug.com/669219). | 2323 // browser side (https://crbug.com/669219). |
| 2324 // If there is no WebFrameWidget, then there will be no | 2324 // If there is no WebFrameWidget, then there will be no |
| 2325 // InputMethodControllers for a WebLocalFrame. | 2325 // InputMethodControllers for a WebLocalFrame. |
| 2326 return nullptr; | 2326 return nullptr; |
| 2327 } | 2327 } |
| 2328 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) | 2328 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) |
| 2329 ->getActiveWebInputMethodController(); | 2329 ->getActiveWebInputMethodController(); |
| 2330 } | 2330 } |
| 2331 | 2331 |
| 2332 } // namespace content | 2332 } // namespace content |
| OLD | NEW |