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

Unified Diff: ui/gfx/icc_profile.h

Issue 2502703002: Add more robust gfx::ColorSpace<->gfx::ICCProfile conversion (Closed)
Patch Set: Clean up includes Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/color_space.cc ('k') | ui/gfx/icc_profile.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/icc_profile.h
diff --git a/ui/gfx/icc_profile.h b/ui/gfx/icc_profile.h
index fd08ba8e68c9f58663fe69ca04b3235adefb1dac..ef5ab20790ed7d01dcda25a1d7428555ca023c5a 100644
--- a/ui/gfx/icc_profile.h
+++ b/ui/gfx/icc_profile.h
@@ -70,10 +70,22 @@ class GFX_EXPORT ICCProfile {
static bool CachedProfilesNeedUpdate();
#endif
+ enum class Type {
+ // This is not a valid profile.
+ INVALID,
+ // This is from a gfx::ColorSpace. This ensures that GetColorSpace returns
+ // the exact same object as was used to create this.
+ FROM_COLOR_SPACE,
+ // This was created from ICC profile data.
+ FROM_DATA,
+ LAST = FROM_DATA
+ };
+
private:
static bool IsValidProfileLength(size_t length);
- bool valid_ = false;
+ Type type_ = Type::INVALID;
+ gfx::ColorSpace color_space_;
std::vector<char> data_;
// This globally identifies this ICC profile. It is used to look up this ICC
@@ -85,6 +97,7 @@ class GFX_EXPORT ICCProfile {
friend int ::LLVMFuzzerTestOneInput(const uint8_t*, size_t);
friend class ColorSpace;
friend struct IPC::ParamTraits<gfx::ICCProfile>;
+ friend struct IPC::ParamTraits<gfx::ICCProfile::Type>;
friend struct mojo::StructTraits<gfx::mojom::ICCProfileDataView,
gfx::ICCProfile>;
};
« no previous file with comments | « ui/gfx/color_space.cc ('k') | ui/gfx/icc_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698