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_GDI_H_ | 5 #ifndef REMOTING_HOST_CAPTURER_GDI_H_ |
6 #define REMOTING_HOST_CAPTURER_GDI_H_ | 6 #define REMOTING_HOST_CAPTURER_GDI_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 typedef HBITMAP BitmapRef; | 9 typedef HBITMAP BitmapRef; |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 #include "remoting/host/capturer.h" | 11 #include "remoting/host/capturer.h" |
12 | 12 |
13 namespace remoting { | 13 namespace remoting { |
14 | 14 |
| 15 class Differ; |
| 16 |
15 // CapturerGdi captures 32bit RGB using GDI. | 17 // CapturerGdi captures 32bit RGB using GDI. |
16 // | 18 // |
17 // CapturerGdi is doubled buffered as required by Capturer. See | 19 // CapturerGdi is doubled buffered as required by Capturer. See |
18 // remoting/host/capturer.h. | 20 // remoting/host/capturer.h. |
19 class CapturerGdi : public Capturer { | 21 class CapturerGdi : public Capturer { |
20 public: | 22 public: |
21 CapturerGdi(); | 23 CapturerGdi(); |
22 virtual ~CapturerGdi(); | 24 virtual ~CapturerGdi(); |
23 | 25 |
24 virtual void CaptureRects(const RectVector& rects, | |
25 CaptureCompletedCallback* callback); | |
26 virtual void ScreenConfigurationChanged(); | 26 virtual void ScreenConfigurationChanged(); |
27 | 27 |
28 private: | 28 private: |
| 29 virtual void CalculateInvalidRects(); |
| 30 virtual void CaptureRects(const InvalidRects& rects, |
| 31 CaptureCompletedCallback* callback); |
| 32 |
29 void ReleaseBuffers(); | 33 void ReleaseBuffers(); |
30 // Generates an image in the current buffer. | 34 // Generates an image in the current buffer. |
31 void CaptureImage(); | 35 void CaptureImage(); |
32 | 36 |
33 // Gdi specific information about screen. | 37 // Gdi specific information about screen. |
34 HDC desktop_dc_; | 38 HDC desktop_dc_; |
35 HDC memory_dc_; | 39 HDC memory_dc_; |
36 HBITMAP target_bitmap_[kNumBuffers]; | 40 HBITMAP target_bitmap_[kNumBuffers]; |
37 | 41 |
38 // We have two buffers for the screen images as required by Capturer. | 42 // We have two buffers for the screen images as required by Capturer. |
39 void* buffers_[kNumBuffers]; | 43 void* buffers_[kNumBuffers]; |
40 | 44 |
| 45 // Class to calculate the difference between two screen bitmaps. |
| 46 scoped_ptr<Differ> differ_; |
| 47 |
| 48 // True if we should force a fullscreen capture. |
| 49 bool capture_fullscreen_; |
| 50 |
41 DISALLOW_COPY_AND_ASSIGN(CapturerGdi); | 51 DISALLOW_COPY_AND_ASSIGN(CapturerGdi); |
42 }; | 52 }; |
43 | 53 |
44 } // namespace remoting | 54 } // namespace remoting |
45 | 55 |
46 #endif // REMOTING_HOST_CAPTURER_GDI_H_ | 56 #endif // REMOTING_HOST_CAPTURER_GDI_H_ |
OLD | NEW |