OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef REMOTING_HOST_CAPTURER_H_ |
6 #define REMOTING_HOST_CAPTURER_H_ | 6 #define REMOTING_HOST_CAPTURER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback_old.h" | 9 #include "base/callback_old.h" |
10 #include "remoting/base/capture_data.h" | 10 #include "remoting/base/capture_data.h" |
11 #include "remoting/base/types.h" | 11 #include "third_party/skia/include/core/SkRegion.h" |
12 | 12 |
13 namespace remoting { | 13 namespace remoting { |
14 | 14 |
15 // A class to perform the task of capturing the image of a window. | 15 // A class to perform the task of capturing the image of a window. |
16 // The capture action is asynchronous to allow maximum throughput. | 16 // The capture action is asynchronous to allow maximum throughput. |
17 // | 17 // |
18 // The full capture process is as follows: | 18 // The full capture process is as follows: |
19 // | 19 // |
20 // (1) InvalidateRects | 20 // (1) InvalidateRects |
21 // This is an optional step where regions of the screen are marked as | 21 // This is an optional step where regions of the screen are marked as |
(...skipping 22 matching lines...) Expand all Loading... | |
44 | 44 |
45 // Create platform-specific capturer. | 45 // Create platform-specific capturer. |
46 static Capturer* Create(); | 46 static Capturer* Create(); |
47 | 47 |
48 // Called when the screen configuration is changed. | 48 // Called when the screen configuration is changed. |
49 virtual void ScreenConfigurationChanged() = 0; | 49 virtual void ScreenConfigurationChanged() = 0; |
50 | 50 |
51 // Return the pixel format of the screen. | 51 // Return the pixel format of the screen. |
52 virtual media::VideoFrame::Format pixel_format() const = 0; | 52 virtual media::VideoFrame::Format pixel_format() const = 0; |
53 | 53 |
54 // Clear out the list of invalid rects. | 54 // Clear out the invalid region. |
55 virtual void ClearInvalidRects() = 0; | 55 virtual void ClearInvalidRegion() = 0; |
56 | 56 |
57 // Invalidate the specified screen rects. | 57 // Invalidate the specified region. |
58 virtual void InvalidateRects(const InvalidRects& inval_rects) = 0; | 58 virtual void InvalidateRegion(const SkRegion& inval_region) = 0; |
Wez
2011/08/10 22:05:43
|inval_region|? ORLY?
| |
59 | 59 |
60 // Invalidate the entire screen, of a given size. | 60 // Invalidate the entire screen, of a given size. |
61 virtual void InvalidateScreen(const gfx::Size& size) = 0; | 61 virtual void InvalidateScreen(const gfx::Size& size) = 0; |
62 | 62 |
63 // Invalidate the entire screen, using the size of the most recently | 63 // Invalidate the entire screen, using the size of the most recently |
64 // captured screen. | 64 // captured screen. |
65 virtual void InvalidateFullScreen() = 0; | 65 virtual void InvalidateFullScreen() = 0; |
66 | 66 |
67 // Capture the screen data associated with each of the accumulated | 67 // Capture the screen data associated with each of the accumulated |
68 // rects in |inval_rects|. | 68 // dirty region. |
69 // This routine will first call CalculateInvalidRects to update the | 69 // When the capture is complete, |callback| is called even If the dirty region |
Wez
2011/08/10 22:05:43
nit: "If" -> "if".
| |
70 // list of |inval_rects|. | 70 // is empty. |
71 // When the capture is complete, |callback| is called. | |
72 // | |
73 // If |inval_rects_| is empty, then this does nothing except | |
74 // call the |callback| routine. | |
75 // | 71 // |
76 // It is OK to call this method while another thread is reading | 72 // It is OK to call this method while another thread is reading |
77 // data of the last capture. | 73 // data of the last capture. |
Wez
2011/08/10 22:05:43
nit: "last"->"previous".
| |
78 // There can be at most one concurrent read going on when this | 74 // There can be at most one concurrent read going on when this |
79 // method is called. | 75 // method is called. |
80 virtual void CaptureInvalidRects(CaptureCompletedCallback* callback) = 0; | 76 virtual void CaptureInvalidRegion(CaptureCompletedCallback* callback) = 0; |
81 | 77 |
82 // Get the size of the most recently captured screen. | 78 // Get the size of the most recently captured screen. |
83 virtual const gfx::Size& size_most_recent() const = 0; | 79 virtual const gfx::Size& size_most_recent() const = 0; |
84 }; | 80 }; |
85 | 81 |
86 } // namespace remoting | 82 } // namespace remoting |
87 | 83 |
88 #endif // REMOTING_HOST_CAPTURER_H_ | 84 #endif // REMOTING_HOST_CAPTURER_H_ |
OLD | NEW |