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 #ifndef UI_GFX_COLOR_SPACE_H_ | 5 #ifndef UI_GFX_COLOR_SPACE_H_ |
6 #define UI_GFX_COLOR_SPACE_H_ | 6 #define UI_GFX_COLOR_SPACE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "ui/gfx/gfx_export.h" | 13 #include "ui/gfx/gfx_export.h" |
14 | 14 |
15 #if defined(OS_MACOSX) | 15 #if defined(OS_MACOSX) |
16 #include <CoreGraphics/CGColorSpace.h> | 16 #include <CoreGraphics/CGColorSpace.h> |
17 #endif | 17 #endif |
18 | 18 |
| 19 namespace IPC { |
| 20 template <class P> |
| 21 struct ParamTraits; |
| 22 } // namespace IPC |
| 23 |
19 namespace gfx { | 24 namespace gfx { |
20 | 25 |
21 class GFX_EXPORT ColorSpace { | 26 class GFX_EXPORT ColorSpace { |
22 public: | 27 public: |
23 ColorSpace(); | 28 ColorSpace(); |
24 ColorSpace(ColorSpace&& other); | 29 ColorSpace(ColorSpace&& other); |
25 ColorSpace(const ColorSpace& other); | 30 ColorSpace(const ColorSpace& other); |
26 ColorSpace& operator=(const ColorSpace& other); | 31 ColorSpace& operator=(const ColorSpace& other); |
27 ~ColorSpace(); | 32 ~ColorSpace(); |
28 bool operator==(const ColorSpace& other) const; | 33 bool operator==(const ColorSpace& other) const; |
(...skipping 15 matching lines...) Expand all Loading... |
44 // other functions to read. This should not be called on the UI or IO thread. | 49 // other functions to read. This should not be called on the UI or IO thread. |
45 static void UpdateCachedProfilesOnBackgroundThread(); | 50 static void UpdateCachedProfilesOnBackgroundThread(); |
46 static bool CachedProfilesNeedUpdate(); | 51 static bool CachedProfilesNeedUpdate(); |
47 #endif | 52 #endif |
48 | 53 |
49 static bool IsValidProfileLength(size_t length); | 54 static bool IsValidProfileLength(size_t length); |
50 | 55 |
51 private: | 56 private: |
52 struct Key; | 57 struct Key; |
53 class GlobalData; | 58 class GlobalData; |
54 friend struct Key; | |
55 friend class GlobalData; | |
56 enum class Type { | 59 enum class Type { |
57 UNDEFINED, | 60 UNDEFINED, |
58 ICC_PROFILE, | 61 ICC_PROFILE, |
| 62 LAST = ICC_PROFILE |
59 }; | 63 }; |
60 Type type_ = Type::UNDEFINED; | 64 Type type_ = Type::UNDEFINED; |
61 | 65 |
62 // GlobalData stores large or expensive-to-compute data about a color space | 66 // GlobalData stores large or expensive-to-compute data about a color space |
63 // (e.g, ICC profile). This structure is shared by all identical ColorSpace | 67 // (e.g, ICC profile). This structure is shared by all identical ColorSpace |
64 // objects in the process. It is lazily initialized for named color spaces. | 68 // objects in the process. It is lazily initialized for named color spaces. |
65 mutable scoped_refptr<GlobalData> global_data_; | 69 mutable scoped_refptr<GlobalData> global_data_; |
| 70 |
| 71 friend struct Key; |
| 72 friend class GlobalData; |
| 73 friend struct IPC::ParamTraits<gfx::ColorSpace>; |
| 74 friend struct IPC::ParamTraits<gfx::ColorSpace::Type>; |
66 }; | 75 }; |
67 | 76 |
68 } // namespace gfx | 77 } // namespace gfx |
69 | 78 |
70 #endif // UI_GFX_COLOR_SPACE_H_ | 79 #endif // UI_GFX_COLOR_SPACE_H_ |
OLD | NEW |