| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "build/build_config.h" | |
| 6 #include "ui/gfx/color_profile.h" | |
| 7 | |
| 8 namespace gfx { | |
| 9 | |
| 10 namespace { | |
| 11 static const size_t kMinProfileLength = 128; | |
| 12 static const size_t kMaxProfileLength = 4 * 1024 * 1024; | |
| 13 } | |
| 14 | |
| 15 ColorProfile::ColorProfile(const std::vector<char>& profile) | |
| 16 : profile_(profile) { | |
| 17 if (!IsValidProfileLength(profile_.size())) | |
| 18 profile_.clear(); | |
| 19 } | |
| 20 | |
| 21 ColorProfile::ColorProfile() = default; | |
| 22 ColorProfile::ColorProfile(ColorProfile&& other) = default; | |
| 23 ColorProfile::ColorProfile(const ColorProfile& other) = default; | |
| 24 ColorProfile& ColorProfile::operator=(const ColorProfile& other) = default; | |
| 25 ColorProfile::~ColorProfile() = default; | |
| 26 | |
| 27 #if !defined(OS_WIN) && !defined(OS_MACOSX) | |
| 28 // static | |
| 29 ColorProfile ColorProfile::GetFromBestMonitor() { | |
| 30 return ColorProfile(); | |
| 31 } | |
| 32 #endif | |
| 33 | |
| 34 // static | |
| 35 bool ColorProfile::IsValidProfileLength(size_t length) { | |
| 36 return length >= kMinProfileLength && length <= kMaxProfileLength; | |
| 37 } | |
| 38 | |
| 39 } // namespace gfx | |
| OLD | NEW |