summaryrefslogtreecommitdiffstats
path: root/ui/gfx/color_profile.cc
blob: 81803495edd26dfda575e1dccee96f89ec3ede2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/gfx/color_profile.h"

namespace gfx {

#if defined(OS_WIN) || defined(OS_MACOSX)
void ReadColorProfile(std::vector<char>* profile);
#else
void ReadColorProfile(std::vector<char>* profile) { }
#endif

void GetColorProfile(std::vector<char>* profile) {
  // Called from the FILE thread on Windows and IO thread elsewhere.

  // TODO: support multiple monitors.
  CR_DEFINE_STATIC_LOCAL(std::vector<char>, screen_profile, ());
  static bool initialized = false;

  profile->clear();
  if (!initialized) {
    initialized = true;
    ReadColorProfile(&screen_profile);
  }

  profile->assign(screen_profile.begin(), screen_profile.end());
}

}  // namespace gfx