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

Unified Diff: ui/gfx/color_profile.cc

Issue 2092533002: Clean up gfx::ColorProfile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl try Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/color_profile.h ('k') | ui/gfx/color_profile_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_profile.cc
diff --git a/ui/gfx/color_profile.cc b/ui/gfx/color_profile.cc
index 220d993599d09cfb4ed20a0b2433562db663de85..42d6967a056a4161d54e75fca80b4a8d78cba635 100644
--- a/ui/gfx/color_profile.cc
+++ b/ui/gfx/color_profile.cc
@@ -7,23 +7,27 @@
namespace gfx {
-#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS))
-void ReadColorProfile(std::vector<char>* profile);
-#else
-void ReadColorProfile(std::vector<char>* profile) { }
-GFX_EXPORT bool GetDisplayColorProfile(const gfx::Rect& bounds,
- std::vector<char>* profile) {
- // TODO(port): consider screen color profile support.
- return false;
+namespace {
+static const size_t kMinProfileLength = 128;
+static const size_t kMaxProfileLength = 4 * 1024 * 1024;
}
-#endif
-ColorProfile::ColorProfile() {
- // TODO: support multiple monitors.
- ReadColorProfile(&profile_);
+ColorProfile::ColorProfile() = default;
+ColorProfile::ColorProfile(ColorProfile&& other) = default;
+ColorProfile::ColorProfile(const ColorProfile& other) = default;
+ColorProfile& ColorProfile::operator=(const ColorProfile& other) = default;
+ColorProfile::~ColorProfile() = default;
+
+#if !defined(OS_WIN) && !defined(OS_MACOSX)
+// static
+ColorProfile ColorProfile::GetFromBestMonitor() {
+ return ColorProfile();
}
+#endif
-ColorProfile::~ColorProfile() {
+// static
+bool ColorProfile::IsValidProfileLength(size_t length) {
+ return length >= kMinProfileLength && length <= kMaxProfileLength;
}
} // namespace gfx
« no previous file with comments | « ui/gfx/color_profile.h ('k') | ui/gfx/color_profile_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698