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

Side by Side Diff: ui/gfx/color_profile.h

Issue 849523003: ui/gfx/color_profile: Add GetDisplayColorProfile for an NSWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | ui/gfx/color_profile.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GFX_COLOR_PROFILE_H_ 5 #ifndef UI_GFX_COLOR_PROFILE_H_
6 #define UI_GFX_COLOR_PROFILE_H_ 6 #define UI_GFX_COLOR_PROFILE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
11 #include "ui/gfx/gfx_export.h" 11 #include "ui/gfx/gfx_export.h"
12 #include "ui/gfx/native_widget_types.h"
12 13
13 namespace gfx { 14 namespace gfx {
14 15
15 static const size_t kMinProfileLength = 128; 16 static const size_t kMinProfileLength = 128;
16 static const size_t kMaxProfileLength = 4 * 1024 * 1024; 17 static const size_t kMaxProfileLength = 4 * 1024 * 1024;
17 18
18 class GFX_EXPORT ColorProfile { 19 class GFX_EXPORT ColorProfile {
19 public: 20 public:
20 // On Windows, this reads a file from disk so it should not be run on the UI 21 // On Windows, this reads a file from disk so it should not be run on the UI
21 // or IO thread. 22 // or IO thread.
(...skipping 13 matching lines...) Expand all
35 } 36 }
36 37
37 // Return the color profile of the display nearest the screen bounds. On Win32, 38 // Return the color profile of the display nearest the screen bounds. On Win32,
38 // this may read a file from disk so it should not be run on the UI/IO threads. 39 // this may read a file from disk so it should not be run on the UI/IO threads.
39 // If the given bounds are empty, or are off-screen, return false meaning there 40 // If the given bounds are empty, or are off-screen, return false meaning there
40 // is no color profile associated with the bounds. Otherwise return true after 41 // is no color profile associated with the bounds. Otherwise return true after
41 // storing the display's color profile in |profile|, which will be empty if the 42 // storing the display's color profile in |profile|, which will be empty if the
42 // standard sRGB color profile should be assumed. 43 // standard sRGB color profile should be assumed.
43 GFX_EXPORT bool GetDisplayColorProfile(const gfx::Rect& bounds, 44 GFX_EXPORT bool GetDisplayColorProfile(const gfx::Rect& bounds,
44 std::vector<char>* profile); 45 std::vector<char>* profile);
46 #if defined(OS_MACOSX)
47 // Return the color profile of the native window. If the window is null, or has
48 // empty bounds, return false meaning there is no color profile associated with
49 // the window. Otherwise return true after storing the window color profile in
50 // |profile|, which will be empty if the sRGB color profile should be assumed.
51 GFX_EXPORT bool GetDisplayColorProfile(gfx::NativeWindow window,
52 std::vector<char>* profile);
53 #endif
45 } // namespace gfx 54 } // namespace gfx
46 55
47 #endif // UI_GFX_COLOR_PROFILE_H_ 56 #endif // UI_GFX_COLOR_PROFILE_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/color_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698