| 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_H_ | 5 #ifndef REMOTING_HOST_CAPTURER_H_ |
| 6 #define REMOTING_HOST_CAPTURER_H_ | 6 #define REMOTING_HOST_CAPTURER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // written into |rects|. | 70 // written into |rects|. |
| 71 virtual void GetDirtyRects(DirtyRects* rects) const; | 71 virtual void GetDirtyRects(DirtyRects* rects) const; |
| 72 | 72 |
| 73 // Get the width of the image captured. | 73 // Get the width of the image captured. |
| 74 virtual int GetWidth() const; | 74 virtual int GetWidth() const; |
| 75 | 75 |
| 76 // Get the height of the image captured. | 76 // Get the height of the image captured. |
| 77 virtual int GetHeight() const; | 77 virtual int GetHeight() const; |
| 78 | 78 |
| 79 // Get the pixel format of the image captured. | 79 // Get the pixel format of the image captured. |
| 80 virtual chromotocol_pb::PixelFormat GetPixelFormat() const; | 80 virtual PixelFormat GetPixelFormat() const; |
| 81 | 81 |
| 82 // Invalidate the specified screen rect. | 82 // Invalidate the specified screen rect. |
| 83 virtual void InvalidateRect(gfx::Rect dirty); | 83 virtual void InvalidateRect(gfx::Rect dirty); |
| 84 | 84 |
| 85 protected: | 85 protected: |
| 86 // Finish/cleanup capture task. | 86 // Finish/cleanup capture task. |
| 87 // This should be called at the end of each of the CaptureXxx() routines. | 87 // This should be called at the end of each of the CaptureXxx() routines. |
| 88 // This routine should (at least): | 88 // This routine should (at least): |
| 89 // (1) Call the |done_task| routine. | 89 // (1) Call the |done_task| routine. |
| 90 // (2) Select the next screen buffer. | 90 // (2) Select the next screen buffer. |
| 91 // Note that capturers are required to be double-buffered so that we can | 91 // Note that capturers are required to be double-buffered so that we can |
| 92 // read from one which capturing into another. | 92 // read from one which capturing into another. |
| 93 virtual void FinishCapture(Task* done_task); | 93 virtual void FinishCapture(Task* done_task); |
| 94 | 94 |
| 95 // Number of screen buffers. | 95 // Number of screen buffers. |
| 96 static const int kNumBuffers = 2; | 96 static const int kNumBuffers = 2; |
| 97 | 97 |
| 98 // Capture screen dimensions. | 98 // Capture screen dimensions. |
| 99 int width_; | 99 int width_; |
| 100 int height_; | 100 int height_; |
| 101 | 101 |
| 102 // Format of pixels returned in buffer. | 102 // Format of pixels returned in buffer. |
| 103 chromotocol_pb::PixelFormat pixel_format_; | 103 PixelFormat pixel_format_; |
| 104 | 104 |
| 105 // Information about screen. | 105 // Information about screen. |
| 106 int bytes_per_pixel_; | 106 int bytes_per_pixel_; |
| 107 int bytes_per_row_; | 107 int bytes_per_row_; |
| 108 | 108 |
| 109 // The current buffer with valid data for reading. | 109 // The current buffer with valid data for reading. |
| 110 int current_buffer_; | 110 int current_buffer_; |
| 111 | 111 |
| 112 // List of dirty rects. | 112 // List of dirty rects. |
| 113 // These are the rects that we send to the client to update. | 113 // These are the rects that we send to the client to update. |
| 114 DirtyRects dirty_rects_; | 114 DirtyRects dirty_rects_; |
| 115 | 115 |
| 116 // Rects that have been manually invalidated (through InvalidateRect). | 116 // Rects that have been manually invalidated (through InvalidateRect). |
| 117 // These will be merged into |dirty_rects_| during the next capture. | 117 // These will be merged into |dirty_rects_| during the next capture. |
| 118 DirtyRects inval_rects_; | 118 DirtyRects inval_rects_; |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 } // namespace remoting | 121 } // namespace remoting |
| 122 | 122 |
| 123 #endif // REMOTING_HOST_CAPTURER_H_ | 123 #endif // REMOTING_HOST_CAPTURER_H_ |
| OLD | NEW |