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

Side by Side Diff: ui/gfx/icc_profile.h

Issue 2299193005: Layout tests: Parameterize color space to use by default (Closed)
Patch Set: Actually specify generic Created 4 years, 3 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/test/layouttest_support.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef UI_GFX_ICC_PROFILE_H_ 5 #ifndef UI_GFX_ICC_PROFILE_H_
6 #define UI_GFX_ICC_PROFILE_H_ 6 #define UI_GFX_ICC_PROFILE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 28 matching lines...) Expand all
39 static ICCProfile FromBestMonitor(); 39 static ICCProfile FromBestMonitor();
40 #if defined(OS_MACOSX) 40 #if defined(OS_MACOSX)
41 static ICCProfile FromCGColorSpace(CGColorSpaceRef cg_color_space); 41 static ICCProfile FromCGColorSpace(CGColorSpaceRef cg_color_space);
42 #endif 42 #endif
43 43
44 // This will recover a ICCProfile from a compact ColorSpace representation. 44 // This will recover a ICCProfile from a compact ColorSpace representation.
45 // Internally, this will make an effort to create an identical ICCProfile 45 // Internally, this will make an effort to create an identical ICCProfile
46 // to the one that created |color_space|, but this is not guaranteed. 46 // to the one that created |color_space|, but this is not guaranteed.
47 static ICCProfile FromColorSpace(const gfx::ColorSpace& color_space); 47 static ICCProfile FromColorSpace(const gfx::ColorSpace& color_space);
48 48
49 // Create directly from profile data.
50 static ICCProfile FromData(const char* icc_profile, size_t size);
51
49 // This will perform a potentially-lossy conversion to a more compact color 52 // This will perform a potentially-lossy conversion to a more compact color
50 // space representation. 53 // space representation.
51 ColorSpace GetColorSpace() const; 54 ColorSpace GetColorSpace() const;
52 55
53 const std::vector<char>& GetData() const; 56 const std::vector<char>& GetData() const;
54 57
55 #if defined(OS_WIN) 58 #if defined(OS_WIN)
56 // This will read monitor ICC profiles from disk and cache the results for the 59 // This will read monitor ICC profiles from disk and cache the results for the
57 // other functions to read. This should not be called on the UI or IO thread. 60 // other functions to read. This should not be called on the UI or IO thread.
58 static void UpdateCachedProfilesOnBackgroundThread(); 61 static void UpdateCachedProfilesOnBackgroundThread();
59 static bool CachedProfilesNeedUpdate(); 62 static bool CachedProfilesNeedUpdate();
60 #endif 63 #endif
61 64
62 private: 65 private:
63 static ICCProfile FromData(const char* icc_profile, size_t size);
64 static bool IsValidProfileLength(size_t length); 66 static bool IsValidProfileLength(size_t length);
65 67
66 bool valid_ = false; 68 bool valid_ = false;
67 std::vector<char> data_; 69 std::vector<char> data_;
68 70
69 // This globally identifies this ICC profile. It is used to look up this ICC 71 // This globally identifies this ICC profile. It is used to look up this ICC
70 // profile from a ColorSpace object created from it. 72 // profile from a ColorSpace object created from it.
71 uint64_t id_ = 0; 73 uint64_t id_ = 0;
72 74
73 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, BT709toSRGBICC); 75 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, BT709toSRGBICC);
74 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace); 76 FRIEND_TEST_ALL_PREFIXES(SimpleColorSpace, GetColorSpace);
75 friend int ::LLVMFuzzerTestOneInput(const uint8_t*, size_t); 77 friend int ::LLVMFuzzerTestOneInput(const uint8_t*, size_t);
76 friend class ColorSpace; 78 friend class ColorSpace;
77 friend struct IPC::ParamTraits<gfx::ICCProfile>; 79 friend struct IPC::ParamTraits<gfx::ICCProfile>;
78 }; 80 };
79 81
80 } // namespace gfx 82 } // namespace gfx
81 83
82 #endif // UI_GFX_ICC_PROFILE_H_ 84 #endif // UI_GFX_ICC_PROFILE_H_
OLDNEW
« no previous file with comments | « content/test/layouttest_support.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698