| 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_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 params->swapped_out = !is_active_; | 310 params->swapped_out = !is_active_; |
| 311 params->replicated_frame_state = replicated_frame_state; | 311 params->replicated_frame_state = replicated_frame_state; |
| 312 params->proxy_routing_id = proxy_route_id; | 312 params->proxy_routing_id = proxy_route_id; |
| 313 params->hidden = GetWidget()->is_hidden(); | 313 params->hidden = GetWidget()->is_hidden(); |
| 314 params->never_visible = delegate_->IsNeverVisible(); | 314 params->never_visible = delegate_->IsNeverVisible(); |
| 315 params->window_was_created_with_opener = window_was_created_with_opener; | 315 params->window_was_created_with_opener = window_was_created_with_opener; |
| 316 params->enable_auto_resize = GetWidget()->auto_resize_enabled(); | 316 params->enable_auto_resize = GetWidget()->auto_resize_enabled(); |
| 317 params->min_size = GetWidget()->min_size_for_auto_resize(); | 317 params->min_size = GetWidget()->min_size_for_auto_resize(); |
| 318 params->max_size = GetWidget()->max_size_for_auto_resize(); | 318 params->max_size = GetWidget()->max_size_for_auto_resize(); |
| 319 params->page_zoom_level = delegate_->GetPendingPageZoomLevel(); | 319 params->page_zoom_level = delegate_->GetPendingPageZoomLevel(); |
| 320 params->image_decode_color_space = gfx::ICCProfile::FromBestMonitor(); | |
| 321 | 320 |
| 321 bool force_srgb_image_decode_color_space = false; |
| 322 // Pretend that HDR displays are sRGB so that we do not have inconsistent | 322 // Pretend that HDR displays are sRGB so that we do not have inconsistent |
| 323 // coloring. | 323 // coloring. |
| 324 // TODO(ccameron): Disable this once color correct rasterization is functional | 324 // TODO(ccameron): Disable this once color correct rasterization is functional |
| 325 // https://crbug.com/701942 | 325 // https://crbug.com/701942 |
| 326 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) { | 326 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) |
| 327 force_srgb_image_decode_color_space = true; |
| 328 // When color correct rendering is enabled, the image_decode_color_space |
| 329 // parameter should not be used (and all users of it should be using sRGB). |
| 330 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 331 switches::kEnableColorCorrectRendering)) { |
| 332 force_srgb_image_decode_color_space = true; |
| 333 } |
| 334 if (force_srgb_image_decode_color_space) { |
| 327 gfx::ColorSpace::CreateSRGB().GetICCProfile( | 335 gfx::ColorSpace::CreateSRGB().GetICCProfile( |
| 328 ¶ms->image_decode_color_space); | 336 ¶ms->image_decode_color_space); |
| 337 } else { |
| 338 params->image_decode_color_space = gfx::ICCProfile::FromBestMonitor(); |
| 329 } | 339 } |
| 330 | 340 |
| 331 GetWidget()->GetResizeParams(¶ms->initial_size); | 341 GetWidget()->GetResizeParams(¶ms->initial_size); |
| 332 GetWidget()->SetInitialRenderSizeParams(params->initial_size); | 342 GetWidget()->SetInitialRenderSizeParams(params->initial_size); |
| 333 | 343 |
| 334 GetProcess()->GetRendererInterface()->CreateView(std::move(params)); | 344 GetProcess()->GetRendererInterface()->CreateView(std::move(params)); |
| 335 | 345 |
| 336 // Let our delegate know that we created a RenderView. | 346 // Let our delegate know that we created a RenderView. |
| 337 delegate_->RenderViewCreated(this); | 347 delegate_->RenderViewCreated(this); |
| 338 | 348 |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 } | 969 } |
| 960 | 970 |
| 961 void RenderViewHostImpl::ClosePageTimeout() { | 971 void RenderViewHostImpl::ClosePageTimeout() { |
| 962 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) | 972 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) |
| 963 return; | 973 return; |
| 964 | 974 |
| 965 ClosePageIgnoringUnloadEvents(); | 975 ClosePageIgnoringUnloadEvents(); |
| 966 } | 976 } |
| 967 | 977 |
| 968 } // namespace content | 978 } // namespace content |
| OLD | NEW |