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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 #include "ui/gfx/color_space.h" | 6 #include "ui/gfx/color_space.h" |
7 | 7 |
8 namespace gfx { | 8 namespace gfx { |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 11 matching lines...) Expand all Loading... |
22 return icc_profile_ == other.icc_profile_; | 22 return icc_profile_ == other.icc_profile_; |
23 } | 23 } |
24 | 24 |
25 ColorSpace ColorSpace::FromICCProfile(const std::vector<char>& icc_profile) { | 25 ColorSpace ColorSpace::FromICCProfile(const std::vector<char>& icc_profile) { |
26 ColorSpace color_space; | 26 ColorSpace color_space; |
27 if (IsValidProfileLength(icc_profile.size())) | 27 if (IsValidProfileLength(icc_profile.size())) |
28 color_space.icc_profile_ = icc_profile; | 28 color_space.icc_profile_ = icc_profile; |
29 return color_space; | 29 return color_space; |
30 } | 30 } |
31 | 31 |
32 #if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(USE_X11) | 32 #if !defined(OS_WIN) && !defined(OS_MACOSX) |
33 // static | 33 // static |
34 ColorSpace ColorSpace::FromBestMonitor() { | 34 ColorSpace ColorSpace::FromBestMonitor() { |
35 return ColorSpace(); | 35 return ColorSpace(); |
36 } | 36 } |
37 #endif | 37 #endif |
38 | 38 |
39 // static | 39 // static |
40 bool ColorSpace::IsValidProfileLength(size_t length) { | 40 bool ColorSpace::IsValidProfileLength(size_t length) { |
41 return length >= kMinProfileLength && length <= kMaxProfileLength; | 41 return length >= kMinProfileLength && length <= kMaxProfileLength; |
42 } | 42 } |
43 | 43 |
44 } // namespace gfx | 44 } // namespace gfx |
OLD | NEW |