OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 REMOTING_HOST_CAPTURER_MAC_H_ | 5 #ifndef REMOTING_HOST_CAPTURER_MAC_H_ |
6 #define REMOTING_HOST_CAPTURER_MAC_H_ | 6 #define REMOTING_HOST_CAPTURER_MAC_H_ |
7 | 7 |
8 #include "remoting/host/capturer.h" | 8 #include "remoting/host/capturer.h" |
9 #include <ApplicationServices/ApplicationServices.h> | 9 #include <ApplicationServices/ApplicationServices.h> |
10 #include <OpenGL/OpenGL.h> | 10 #include <OpenGL/OpenGL.h> |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
12 | 12 |
13 namespace remoting { | 13 namespace remoting { |
14 | 14 |
15 // A class to perform capturing for mac. | 15 // A class to perform capturing for mac. |
16 class CapturerMac : public Capturer { | 16 class CapturerMac : public Capturer { |
17 public: | 17 public: |
18 CapturerMac(); | 18 CapturerMac(); |
19 virtual ~CapturerMac(); | 19 virtual ~CapturerMac(); |
20 | 20 |
21 virtual void CaptureRects(const RectVector& rects, | |
22 CaptureCompletedCallback* callback); | |
23 | |
24 virtual void ScreenConfigurationChanged(); | 21 virtual void ScreenConfigurationChanged(); |
25 | 22 |
26 private: | 23 private: |
| 24 virtual void CalculateInvalidRects(); |
| 25 virtual void CaptureRects(const InvalidRects& rects, |
| 26 CaptureCompletedCallback* callback); |
| 27 |
27 void ScreenRefresh(CGRectCount count, const CGRect *rect_array); | 28 void ScreenRefresh(CGRectCount count, const CGRect *rect_array); |
28 void ScreenUpdateMove(CGScreenUpdateMoveDelta delta, | 29 void ScreenUpdateMove(CGScreenUpdateMoveDelta delta, |
29 size_t count, | 30 size_t count, |
30 const CGRect *rect_array); | 31 const CGRect *rect_array); |
31 static void ScreenRefreshCallback(CGRectCount count, | 32 static void ScreenRefreshCallback(CGRectCount count, |
32 const CGRect *rect_array, | 33 const CGRect *rect_array, |
33 void *user_parameter); | 34 void *user_parameter); |
34 static void ScreenUpdateMoveCallback(CGScreenUpdateMoveDelta delta, | 35 static void ScreenUpdateMoveCallback(CGScreenUpdateMoveDelta delta, |
35 size_t count, | 36 size_t count, |
36 const CGRect *rect_array, | 37 const CGRect *rect_array, |
37 void *user_parameter); | 38 void *user_parameter); |
38 static void DisplaysReconfiguredCallback(CGDirectDisplayID display, | 39 static void DisplaysReconfiguredCallback(CGDirectDisplayID display, |
39 CGDisplayChangeSummaryFlags flags, | 40 CGDisplayChangeSummaryFlags flags, |
40 void *user_parameter); | 41 void *user_parameter); |
41 | 42 |
42 void ReleaseBuffers(); | 43 void ReleaseBuffers(); |
43 CGLContextObj cgl_context_; | 44 CGLContextObj cgl_context_; |
44 scoped_array<uint8> buffers_[kNumBuffers]; | 45 scoped_array<uint8> buffers_[kNumBuffers]; |
45 DISALLOW_COPY_AND_ASSIGN(CapturerMac); | 46 DISALLOW_COPY_AND_ASSIGN(CapturerMac); |
46 }; | 47 }; |
47 | 48 |
48 } // namespace remoting | 49 } // namespace remoting |
49 | 50 |
50 #endif // REMOTING_HOST_CAPTURER_MAC_H_ | 51 #endif // REMOTING_HOST_CAPTURER_MAC_H_ |
OLD | NEW |