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

Side by Side Diff: ui/gfx/color_space.cc

Issue 2106303002: Color: Rename gfx::ColorProfile to gfx::ColorSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/color_space.h ('k') | ui/gfx/color_space_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_space.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 ColorSpace::ColorSpace() = default;
16 ColorSpace::ColorSpace(ColorSpace&& other) = default;
17 ColorSpace::ColorSpace(const ColorSpace& other) = default;
18 ColorSpace& ColorSpace::operator=(const ColorSpace& other) = default;
19 ColorSpace::~ColorSpace() = default;
20
21 bool ColorSpace::operator==(const ColorSpace& other) const {
22 return icc_profile_ == other.icc_profile_;
23 }
24
25 ColorSpace ColorSpace::FromICCProfile(const std::vector<char>& icc_profile) {
26 ColorSpace color_space;
27 if (IsValidProfileLength(icc_profile.size()))
28 color_space.icc_profile_ = icc_profile;
29 return color_space;
30 }
31
32 #if !defined(OS_WIN) && !defined(OS_MACOSX)
33 // static
34 ColorSpace ColorSpace::FromBestMonitor() {
35 return ColorSpace();
36 }
37 #endif
38
39 // static
40 bool ColorSpace::IsValidProfileLength(size_t length) {
41 return length >= kMinProfileLength && length <= kMaxProfileLength;
42 }
43
44 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/color_space.h ('k') | ui/gfx/color_space_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698