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 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 if (!GetWebWidget()) | 1212 if (!GetWebWidget()) |
1213 return; | 1213 return; |
1214 | 1214 |
1215 if (params.local_surface_id) | 1215 if (params.local_surface_id) |
1216 local_surface_id_ = *params.local_surface_id; | 1216 local_surface_id_ = *params.local_surface_id; |
1217 | 1217 |
1218 if (compositor_) { | 1218 if (compositor_) { |
1219 compositor_->SetViewportSize(params.physical_backing_size); | 1219 compositor_->SetViewportSize(params.physical_backing_size); |
1220 compositor_->setBottomControlsHeight(params.bottom_controls_height); | 1220 compositor_->setBottomControlsHeight(params.bottom_controls_height); |
1221 compositor_->SetRasterColorSpace( | 1221 compositor_->SetRasterColorSpace( |
1222 screen_info_.icc_profile.GetParametricColorSpace()); | 1222 screen_info_.color_space.GetParametricApproximation()); |
1223 // If surface synchronization is enable, then this will use the provided | 1223 // If surface synchronization is enable, then this will use the provided |
1224 // |local_surface_id_| to submit the next generated CompositorFrame. | 1224 // |local_surface_id_| to submit the next generated CompositorFrame. |
1225 // If the ID is not valid, then the compositor will defer commits until | 1225 // If the ID is not valid, then the compositor will defer commits until |
1226 // it receives a valid surface ID. This is a no-op if surface | 1226 // it receives a valid surface ID. This is a no-op if surface |
1227 // synchronization is disabled. | 1227 // synchronization is disabled. |
1228 compositor_->SetLocalSurfaceId(local_surface_id_); | 1228 compositor_->SetLocalSurfaceId(local_surface_id_); |
1229 } | 1229 } |
1230 | 1230 |
1231 visible_viewport_size_ = params.visible_viewport_size; | 1231 visible_viewport_size_ = params.visible_viewport_size; |
1232 | 1232 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 compositor_->SetIsForOopif(for_oopif_); | 1310 compositor_->SetIsForOopif(for_oopif_); |
1311 auto layer_tree_host = RenderWidgetCompositor::CreateLayerTreeHost( | 1311 auto layer_tree_host = RenderWidgetCompositor::CreateLayerTreeHost( |
1312 compositor_.get(), compositor_.get(), animation_host.get(), | 1312 compositor_.get(), compositor_.get(), animation_host.get(), |
1313 compositor_deps_, device_scale_factor_, screen_info_); | 1313 compositor_deps_, device_scale_factor_, screen_info_); |
1314 compositor_->Initialize(std::move(layer_tree_host), | 1314 compositor_->Initialize(std::move(layer_tree_host), |
1315 std::move(animation_host)); | 1315 std::move(animation_host)); |
1316 | 1316 |
1317 compositor_->SetViewportSize(physical_backing_size_); | 1317 compositor_->SetViewportSize(physical_backing_size_); |
1318 OnDeviceScaleFactorChanged(); | 1318 OnDeviceScaleFactorChanged(); |
1319 compositor_->SetRasterColorSpace( | 1319 compositor_->SetRasterColorSpace( |
1320 screen_info_.icc_profile.GetParametricColorSpace()); | 1320 screen_info_.color_space.GetParametricApproximation()); |
1321 compositor_->SetContentSourceId(current_content_source_id_); | 1321 compositor_->SetContentSourceId(current_content_source_id_); |
1322 compositor_->SetLocalSurfaceId(local_surface_id_); | 1322 compositor_->SetLocalSurfaceId(local_surface_id_); |
1323 // For background pages and certain tests, we don't want to trigger | 1323 // For background pages and certain tests, we don't want to trigger |
1324 // LayerTreeFrameSink creation. | 1324 // LayerTreeFrameSink creation. |
1325 bool should_generate_frame_sink = | 1325 bool should_generate_frame_sink = |
1326 !compositor_never_visible_ && RenderThreadImpl::current(); | 1326 !compositor_never_visible_ && RenderThreadImpl::current(); |
1327 if (!should_generate_frame_sink) | 1327 if (!should_generate_frame_sink) |
1328 compositor_->SetNeverVisible(); | 1328 compositor_->SetNeverVisible(); |
1329 | 1329 |
1330 StartCompositor(); | 1330 StartCompositor(); |
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2161 #if BUILDFLAG(ENABLE_PLUGINS) | 2161 #if BUILDFLAG(ENABLE_PLUGINS) |
2162 if (focused_pepper_plugin_) | 2162 if (focused_pepper_plugin_) |
2163 return focused_pepper_plugin_->IsPluginAcceptingCompositionEvents(); | 2163 return focused_pepper_plugin_->IsPluginAcceptingCompositionEvents(); |
2164 #endif | 2164 #endif |
2165 return true; | 2165 return true; |
2166 } | 2166 } |
2167 | 2167 |
2168 blink::WebScreenInfo RenderWidget::GetScreenInfo() { | 2168 blink::WebScreenInfo RenderWidget::GetScreenInfo() { |
2169 blink::WebScreenInfo web_screen_info; | 2169 blink::WebScreenInfo web_screen_info; |
2170 web_screen_info.device_scale_factor = screen_info_.device_scale_factor; | 2170 web_screen_info.device_scale_factor = screen_info_.device_scale_factor; |
2171 web_screen_info.icc_profile = screen_info_.icc_profile; | 2171 web_screen_info.color_space = screen_info_.color_space; |
2172 web_screen_info.depth = screen_info_.depth; | 2172 web_screen_info.depth = screen_info_.depth; |
2173 web_screen_info.depth_per_component = screen_info_.depth_per_component; | 2173 web_screen_info.depth_per_component = screen_info_.depth_per_component; |
2174 web_screen_info.is_monochrome = screen_info_.is_monochrome; | 2174 web_screen_info.is_monochrome = screen_info_.is_monochrome; |
2175 web_screen_info.rect = blink::WebRect(screen_info_.rect); | 2175 web_screen_info.rect = blink::WebRect(screen_info_.rect); |
2176 web_screen_info.available_rect = blink::WebRect(screen_info_.available_rect); | 2176 web_screen_info.available_rect = blink::WebRect(screen_info_.available_rect); |
2177 switch (screen_info_.orientation_type) { | 2177 switch (screen_info_.orientation_type) { |
2178 case SCREEN_ORIENTATION_VALUES_PORTRAIT_PRIMARY: | 2178 case SCREEN_ORIENTATION_VALUES_PORTRAIT_PRIMARY: |
2179 web_screen_info.orientation_type = | 2179 web_screen_info.orientation_type = |
2180 blink::kWebScreenOrientationPortraitPrimary; | 2180 blink::kWebScreenOrientationPortraitPrimary; |
2181 break; | 2181 break; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2379 // browser side (https://crbug.com/669219). | 2379 // browser side (https://crbug.com/669219). |
2380 // If there is no WebFrameWidget, then there will be no | 2380 // If there is no WebFrameWidget, then there will be no |
2381 // InputMethodControllers for a WebLocalFrame. | 2381 // InputMethodControllers for a WebLocalFrame. |
2382 return nullptr; | 2382 return nullptr; |
2383 } | 2383 } |
2384 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) | 2384 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) |
2385 ->GetActiveWebInputMethodController(); | 2385 ->GetActiveWebInputMethodController(); |
2386 } | 2386 } |
2387 | 2387 |
2388 } // namespace content | 2388 } // namespace content |
OLD | NEW |