Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1060)

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2748273003: HDR: Force raster into sRGB space when HDR is enabled (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <set> 9 #include <set>
10 #include <tuple> 10 #include <tuple>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 #include "content/public/common/web_preferences.h" 75 #include "content/public/common/web_preferences.h"
76 #include "gpu/GLES2/gl2extchromium.h" 76 #include "gpu/GLES2/gl2extchromium.h"
77 #include "gpu/command_buffer/service/gpu_switches.h" 77 #include "gpu/command_buffer/service/gpu_switches.h"
78 #include "gpu/ipc/common/gpu_messages.h" 78 #include "gpu/ipc/common/gpu_messages.h"
79 #include "net/base/filename_util.h" 79 #include "net/base/filename_util.h"
80 #include "skia/ext/image_operations.h" 80 #include "skia/ext/image_operations.h"
81 #include "skia/ext/platform_canvas.h" 81 #include "skia/ext/platform_canvas.h"
82 #include "storage/browser/fileapi/isolated_context.h" 82 #include "storage/browser/fileapi/isolated_context.h"
83 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" 83 #include "third_party/WebKit/public/web/WebCompositionUnderline.h"
84 #include "ui/base/clipboard/clipboard.h" 84 #include "ui/base/clipboard/clipboard.h"
85 #include "ui/base/ui_base_switches.h"
85 #include "ui/events/blink/web_input_event_traits.h" 86 #include "ui/events/blink/web_input_event_traits.h"
86 #include "ui/events/event.h" 87 #include "ui/events/event.h"
87 #include "ui/events/keycodes/keyboard_codes.h" 88 #include "ui/events/keycodes/keyboard_codes.h"
88 #include "ui/gfx/color_space.h" 89 #include "ui/gfx/color_space.h"
89 #include "ui/gfx/geometry/size_conversions.h" 90 #include "ui/gfx/geometry/size_conversions.h"
90 #include "ui/gfx/geometry/vector2d_conversions.h" 91 #include "ui/gfx/geometry/vector2d_conversions.h"
91 #include "ui/gfx/image/image.h" 92 #include "ui/gfx/image/image.h"
92 #include "ui/gfx/image/image_skia.h" 93 #include "ui/gfx/image/image_skia.h"
93 #include "ui/gfx/skbitmap_operations.h" 94 #include "ui/gfx/skbitmap_operations.h"
94 #include "ui/snapshot/snapshot.h" 95 #include "ui/snapshot/snapshot.h"
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 // could handle both the restore and resize at once. This isn't that big a 661 // could handle both the restore and resize at once. This isn't that big a
661 // deal as RenderWidget::WasShown delays updating, so that the resize from 662 // deal as RenderWidget::WasShown delays updating, so that the resize from
662 // WasResized is usually processed before the renderer is painted. 663 // WasResized is usually processed before the renderer is painted.
663 WasResized(); 664 WasResized();
664 } 665 }
665 666
666 bool RenderWidgetHostImpl::GetResizeParams(ResizeParams* resize_params) { 667 bool RenderWidgetHostImpl::GetResizeParams(ResizeParams* resize_params) {
667 *resize_params = ResizeParams(); 668 *resize_params = ResizeParams();
668 669
669 GetScreenInfo(&resize_params->screen_info); 670 GetScreenInfo(&resize_params->screen_info);
671
672 // Pretend that HDR displays are sRGB so that we do not have inconsistent
673 // coloring.
674 // TODO(ccameron): Disable this once color correct rasterization is functional
675 // https://crbug.com/701942
676 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) {
677 gfx::ColorSpace::CreateSRGB().GetICCProfile(
678 &resize_params->screen_info.icc_profile);
679 }
680
670 if (delegate_) { 681 if (delegate_) {
671 resize_params->is_fullscreen_granted = 682 resize_params->is_fullscreen_granted =
672 delegate_->IsFullscreenForCurrentTab(); 683 delegate_->IsFullscreenForCurrentTab();
673 resize_params->display_mode = delegate_->GetDisplayMode(this); 684 resize_params->display_mode = delegate_->GetDisplayMode(this);
674 } else { 685 } else {
675 resize_params->is_fullscreen_granted = false; 686 resize_params->is_fullscreen_granted = false;
676 resize_params->display_mode = blink::WebDisplayModeBrowser; 687 resize_params->display_mode = blink::WebDisplayModeBrowser;
677 } 688 }
678 689
679 if (view_) { 690 if (view_) {
(...skipping 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after
2548 // different from the receiver's. 2559 // different from the receiver's.
2549 file_system_file.url = 2560 file_system_file.url =
2550 GURL(storage::GetIsolatedFileSystemRootURIString( 2561 GURL(storage::GetIsolatedFileSystemRootURIString(
2551 file_system_url.origin(), filesystem_id, std::string()) 2562 file_system_url.origin(), filesystem_id, std::string())
2552 .append(register_name)); 2563 .append(register_name));
2553 file_system_file.filesystem_id = filesystem_id; 2564 file_system_file.filesystem_id = filesystem_id;
2554 } 2565 }
2555 } 2566 }
2556 2567
2557 } // namespace content 2568 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698