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

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: 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
Index: ui/gfx/color_profile.cc
diff --git a/ui/gfx/color_profile.cc b/ui/gfx/color_profile.cc
index 220d993599d09cfb4ed20a0b2433562db663de85..da2fa0083a489ac8377978e9ab5b87dff854627c 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::GetFromDeepestMonitor() {
+ return ColorProfile();
}
+#endif
-ColorProfile::~ColorProfile() {
+// static
+bool ColorProfile::InvalidColorProfileLength(size_t length) {
enne (OOO) 2016/06/22 21:44:24 nit: I know this existed before, but maybe call th
ccameron 2016/06/22 22:33:31 Done.
+ return (length < kMinProfileLength) || (length > kMaxProfileLength);
}
} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698