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

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: Update comments. 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
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 {
44 MacDesktopConfiguration(); 40 MacDesktopConfiguration();
45 ~MacDesktopConfiguration(); 41 ~MacDesktopConfiguration();
46 42
47 // Returns the current configuration of the desktop. 43 // Returns the desktop & display configurations in Cartesian (bottom-left
48 MEDIA_EXPORT static MacDesktopConfiguration GetCurrent(); 44 // origin) or inverse-Cartesian (top-left origin) coordinates.
45 enum Origin { BottomLeftOrigin, TopLeftOrigin };
46 MEDIA_EXPORT static MacDesktopConfiguration GetCurrent(Origin origin);
Sergey Ulanov 2013/02/11 22:57:20 Not sure if we need |origin| - this function is al
Wez 2013/02/11 23:14:45 Mac's Cocoa uses Cartesian (bottom-left), so I cou
49 47
50 // Bounds of the desktop in Density-Independent Pixels (DIPs). 48 // Bounds of the desktop in Density-Independent Pixels (DIPs).
51 SkIRect bounds; 49 SkIRect bounds;
52 50
53 // Bounds of the desktop in physical pixels. 51 // Bounds of the desktop in physical pixels.
54 SkIRect pixel_bounds; 52 SkIRect pixel_bounds;
55 53
56 // Scale factor from DIPs to physical pixels. 54 // Scale factor from DIPs to physical pixels.
57 float dip_to_pixel_scale; 55 float dip_to_pixel_scale;
58 56
59 // Configurations of the displays making up the desktop area. 57 // Configurations of the displays making up the desktop area.
60 MacDisplayConfigurations displays; 58 MacDisplayConfigurations displays;
61 }; 59 };
62 60
63 } // namespace media 61 } // namespace media
64 62
65 #endif // MEDIA_VIDEO_CAPTURE_SCREEN_MAC_DESKTOP_CONFIGURATION_H_ 63 #endif // MEDIA_VIDEO_CAPTURE_SCREEN_MAC_DESKTOP_CONFIGURATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698