| 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 "third_party/skia/include/core/SkRegion.h" | 11 #include "remoting/base/types.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 invalid region. | 54 // Clear out the list of invalid rects. |
| 55 virtual void ClearInvalidRegion() = 0; | 55 virtual void ClearInvalidRects() = 0; |
| 56 | 56 |
| 57 // Invalidate the specified region. | 57 // Invalidate the specified screen rects. |
| 58 virtual void InvalidateRegion(const SkRegion& invalid_region) = 0; | 58 virtual void InvalidateRects(const InvalidRects& inval_rects) = 0; |
| 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 // dirty region. | 68 // rects in |inval_rects|. |
| 69 // When the capture is complete, |callback| is called even if the dirty region | 69 // This routine will first call CalculateInvalidRects to update the |
| 70 // is empty. | 70 // list of |inval_rects|. |
| 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. |
| 71 // | 75 // |
| 72 // It is OK to call this method while another thread is reading | 76 // It is OK to call this method while another thread is reading |
| 73 // data of the previous capture. | 77 // data of the last capture. |
| 74 // There can be at most one concurrent read going on when this | 78 // There can be at most one concurrent read going on when this |
| 75 // method is called. | 79 // method is called. |
| 76 virtual void CaptureInvalidRegion(CaptureCompletedCallback* callback) = 0; | 80 virtual void CaptureInvalidRects(CaptureCompletedCallback* callback) = 0; |
| 77 | 81 |
| 78 // Get the size of the most recently captured screen. | 82 // Get the size of the most recently captured screen. |
| 79 virtual const gfx::Size& size_most_recent() const = 0; | 83 virtual const gfx::Size& size_most_recent() const = 0; |
| 80 }; | 84 }; |
| 81 | 85 |
| 82 } // namespace remoting | 86 } // namespace remoting |
| 83 | 87 |
| 84 #endif // REMOTING_HOST_CAPTURER_H_ | 88 #endif // REMOTING_HOST_CAPTURER_H_ |
| OLD | NEW |