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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ColorSpaceGamut.cpp

Issue 2954793002: color: Replace more instances of ICCProfile with ColorSpace (Closed)
Patch Set: Created 3 years, 5 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/renderer/render_widget.cc ('k') | third_party/WebKit/public/platform/WebScreenInfo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "platform/graphics/ColorSpaceGamut.h" 5 #include "platform/graphics/ColorSpaceGamut.h"
6 6
7 #include "public/platform/WebScreenInfo.h" 7 #include "public/platform/WebScreenInfo.h"
8 #include "third_party/skia/include/core/SkColorSpaceXform.h" 8 #include "third_party/skia/include/core/SkColorSpaceXform.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 namespace ColorSpaceUtilities { 12 namespace ColorSpaceUtilities {
13 13
14 ColorSpaceGamut GetColorSpaceGamut(const WebScreenInfo& screen_info) { 14 ColorSpaceGamut GetColorSpaceGamut(const WebScreenInfo& screen_info) {
15 const gfx::ICCProfile& profile = screen_info.icc_profile; 15 const gfx::ColorSpace& color_space = screen_info.color_space;
16 if (profile == gfx::ICCProfile()) 16 if (!color_space.IsValid())
17 return ColorSpaceGamut::kUnknown; 17 return ColorSpaceGamut::kUnknown;
18 18
19 return ColorSpaceUtilities::GetColorSpaceGamut( 19 return ColorSpaceUtilities::GetColorSpaceGamut(
20 profile.GetColorSpace().ToSkColorSpace().get()); 20 color_space.ToSkColorSpace().get());
21 } 21 }
22 22
23 ColorSpaceGamut GetColorSpaceGamut(SkColorSpace* color_space) { 23 ColorSpaceGamut GetColorSpaceGamut(SkColorSpace* color_space) {
24 sk_sp<SkColorSpace> sc_rgb(SkColorSpace::MakeSRGBLinear()); 24 sk_sp<SkColorSpace> sc_rgb(SkColorSpace::MakeSRGBLinear());
25 std::unique_ptr<SkColorSpaceXform> transform( 25 std::unique_ptr<SkColorSpaceXform> transform(
26 SkColorSpaceXform::New(color_space, sc_rgb.get())); 26 SkColorSpaceXform::New(color_space, sc_rgb.get()));
27 27
28 if (!transform) 28 if (!transform)
29 return ColorSpaceGamut::kUnknown; 29 return ColorSpaceGamut::kUnknown;
30 30
(...skipping 28 matching lines...) Expand all
59 if (score < 2.2) 59 if (score < 2.2)
60 return ColorSpaceGamut::BT2020; // actual score 2.104520 60 return ColorSpaceGamut::BT2020; // actual score 2.104520
61 if (score < 2.7) 61 if (score < 2.7)
62 return ColorSpaceGamut::kProPhoto; // actual score 2.913247 62 return ColorSpaceGamut::kProPhoto; // actual score 2.913247
63 return ColorSpaceGamut::kUltraWide; 63 return ColorSpaceGamut::kUltraWide;
64 } 64 }
65 65
66 } // namespace ColorSpaceUtilities 66 } // namespace ColorSpaceUtilities
67 67
68 } // namespace blink 68 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | third_party/WebKit/public/platform/WebScreenInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698