summaryrefslogtreecommitdiffstats
path: root/remoting/host/capturer_mac.h
diff options
context:
space:
mode:
authordmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-01 15:02:53 +0000
committerdmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-01 15:02:53 +0000
commit804c99625cc375da683a6c1a681178b0014e02fe (patch)
tree444c6deffd05f7744f0d2b50077aeabde0cc7170 /remoting/host/capturer_mac.h
parent9da1cedf45ee5bb54cc5558ca044dc24b999b8d9 (diff)
downloadchromium_src-804c99625cc375da683a6c1a681178b0014e02fe.zip
chromium_src-804c99625cc375da683a6c1a681178b0014e02fe.tar.gz
chromium_src-804c99625cc375da683a6c1a681178b0014e02fe.tar.bz2
Revamp capturer to clean up the interface, and to keep data as atomic as possible when making calls across threads.
TEST=build remoting BUG=none Review URL: http://codereview.chromium.org/2805025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/capturer_mac.h')
-rw-r--r--remoting/host/capturer_mac.h33
1 files changed, 25 insertions, 8 deletions
diff --git a/remoting/host/capturer_mac.h b/remoting/host/capturer_mac.h
index da4073e..1ca88ae1 100644
--- a/remoting/host/capturer_mac.h
+++ b/remoting/host/capturer_mac.h
@@ -6,6 +6,9 @@
#define REMOTING_HOST_CAPTURER_MAC_H_
#include "remoting/host/capturer.h"
+#include <ApplicationServices/ApplicationServices.h>
+#include <OpenGL/OpenGL.h>
+#include "base/scoped_ptr.h"
namespace remoting {
@@ -15,16 +18,30 @@ class CapturerMac : public Capturer {
CapturerMac();
virtual ~CapturerMac();
- virtual void CaptureFullScreen(Task* done_task);
- virtual void CaptureDirtyRects(Task* done_task);
- virtual void CaptureRect(const gfx::Rect& rect, Task* done_task);
- virtual void GetData(const uint8* planes[]) const;
- virtual void GetDataStride(int strides[]) const;
+ virtual void CaptureRects(const RectVector& rects,
+ CaptureCompletedCallback* callback);
- private:
- // Generates an image in the current buffer.
- void CaptureImage();
+ virtual void ScreenConfigurationChanged();
+ private:
+ void ScreenRefresh(CGRectCount count, const CGRect *rect_array);
+ void ScreenUpdateMove(CGScreenUpdateMoveDelta delta,
+ size_t count,
+ const CGRect *rect_array);
+ static void ScreenRefreshCallback(CGRectCount count,
+ const CGRect *rect_array,
+ void *user_parameter);
+ static void ScreenUpdateMoveCallback(CGScreenUpdateMoveDelta delta,
+ size_t count,
+ const CGRect *rect_array,
+ void *user_parameter);
+ static void DisplaysReconfiguredCallback(CGDirectDisplayID display,
+ CGDisplayChangeSummaryFlags flags,
+ void *user_parameter);
+
+ void ReleaseBuffers();
+ CGLContextObj cgl_context_;
+ scoped_array<uint8> buffers_[kNumBuffers];
DISALLOW_COPY_AND_ASSIGN(CapturerMac);
};