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

Side by Side Diff: media/video/capture/screen/mac/desktop_configuration.h

Issue 12221103: Fix ScreenCapturerMac handling of secondary configurations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review nits. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | media/video/capture/screen/mac/desktop_configuration.mm » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 MEDIA_VIDEO_CAPTURE_SCREEN_MAC_DESKTOP_CONFIGURATION_H_ 5 #ifndef MEDIA_VIDEO_CAPTURE_SCREEN_MAC_DESKTOP_CONFIGURATION_H_
6 #define MEDIA_VIDEO_CAPTURE_SCREEN_MAC_DESKTOP_CONFIGURATION_H_ 6 #define MEDIA_VIDEO_CAPTURE_SCREEN_MAC_DESKTOP_CONFIGURATION_H_
7 7
8 #include <ApplicationServices/ApplicationServices.h> 8 #include <ApplicationServices/ApplicationServices.h>
9 #include <Carbon/Carbon.h> 9 #include <Carbon/Carbon.h>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "media/base/media_export.h" 13 #include "media/base/media_export.h"
14 #include "third_party/skia/include/core/SkPoint.h" 14 #include "third_party/skia/include/core/SkPoint.h"
15 #include "third_party/skia/include/core/SkRect.h" 15 #include "third_party/skia/include/core/SkRect.h"
16 16
17 namespace media { 17 namespace media {
18 18
19 // Describes the configuration of a specific display. 19 // Describes the configuration of a specific display.
20 struct MEDIA_EXPORT MacDisplayConfiguration { 20 struct MEDIA_EXPORT MacDisplayConfiguration {
21 MacDisplayConfiguration(); 21 MacDisplayConfiguration();
22 22
23 // Returns the current configuration of the specified display.
24 MEDIA_EXPORT static MacDisplayConfiguration ForDisplay(
25 CGDirectDisplayID display_id);
26
27 // Cocoa identifier for this display. 23 // Cocoa identifier for this display.
28 CGDirectDisplayID id; 24 CGDirectDisplayID id;
29 25
30 // Bounds of this display in Density-Independent Pixels (DIPs). 26 // Bounds of this display in Density-Independent Pixels (DIPs).
31 SkIRect bounds; 27 SkIRect bounds;
32 28
33 // Bounds of this display in physical pixels. 29 // Bounds of this display in physical pixels.
34 SkIRect pixel_bounds; 30 SkIRect pixel_bounds;
35 31
36 // Scale factor from DIPs to physical pixels. 32 // Scale factor from DIPs to physical pixels.
37 float dip_to_pixel_scale; 33 float dip_to_pixel_scale;
38 }; 34 };
39 35
40 typedef std::vector<MacDisplayConfiguration> MacDisplayConfigurations; 36 typedef std::vector<MacDisplayConfiguration> MacDisplayConfigurations;
41 37
42 // Describes the configuration of the whole desktop. 38 // Describes the configuration of the whole desktop.
43 struct MEDIA_EXPORT MacDesktopConfiguration { 39 struct MEDIA_EXPORT MacDesktopConfiguration {
40 // Used to request Cartesian or inverse-Cartesian coordinates.
41 enum Origin { BottomLeftOrigin, TopLeftOrigin };
42
44 MacDesktopConfiguration(); 43 MacDesktopConfiguration();
45 ~MacDesktopConfiguration(); 44 ~MacDesktopConfiguration();
46 45
47 // Returns the current configuration of the desktop. 46 // Returns the desktop & display configurations in Cartesian (bottom-left
48 MEDIA_EXPORT static MacDesktopConfiguration GetCurrent(); 47 // origin) or inverse-Cartesian (top-left origin) coordinates.
48 MEDIA_EXPORT static MacDesktopConfiguration GetCurrent(Origin origin);
Sergey Ulanov 2013/02/11 23:16:02 Do we really need |origin| here? This function is
49 49
50 // Bounds of the desktop in Density-Independent Pixels (DIPs). 50 // Bounds of the desktop in Density-Independent Pixels (DIPs).
51 SkIRect bounds; 51 SkIRect bounds;
52 52
53 // Bounds of the desktop in physical pixels. 53 // Bounds of the desktop in physical pixels.
54 SkIRect pixel_bounds; 54 SkIRect pixel_bounds;
55 55
56 // Scale factor from DIPs to physical pixels. 56 // Scale factor from DIPs to physical pixels.
57 float dip_to_pixel_scale; 57 float dip_to_pixel_scale;
58 58
59 // Configurations of the displays making up the desktop area. 59 // Configurations of the displays making up the desktop area.
60 MacDisplayConfigurations displays; 60 MacDisplayConfigurations displays;
61 }; 61 };
62 62
63 } // namespace media 63 } // namespace media
64 64
65 #endif // MEDIA_VIDEO_CAPTURE_SCREEN_MAC_DESKTOP_CONFIGURATION_H_ 65 #endif // MEDIA_VIDEO_CAPTURE_SCREEN_MAC_DESKTOP_CONFIGURATION_H_
OLDNEW
« no previous file with comments | « no previous file | media/video/capture/screen/mac/desktop_configuration.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698