Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: remoting/host/capturer.h

Issue 7491070: Switch over to using SkRegions to calculate dirty areas. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up comments Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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/08 20:49:34 nit: This should be |region|, |dirty_region| or |i
dmac 2011/08/10 20:30:36 Seriously? Fixed all over :-)
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
70 // list of |inval_rects|.
71 // When the capture is complete, |callback| is called. 69 // When the capture is complete, |callback| is called.
72 // 70 //
73 // If |inval_rects_| is empty, then this does nothing except 71 // If the dirty region is empty, then this does nothing except
74 // call the |callback| routine. 72 // call the |callback| routine.
Wez 2011/08/08 20:49:34 nit: These two sentences could be combined, i.e. "
dmac 2011/08/10 20:30:36 Done.
75 // 73 //
76 // It is OK to call this method while another thread is reading 74 // It is OK to call this method while another thread is reading
77 // data of the last capture. 75 // data of the last capture.
78 // There can be at most one concurrent read going on when this 76 // There can be at most one concurrent read going on when this
79 // method is called. 77 // method is called.
80 virtual void CaptureInvalidRects(CaptureCompletedCallback* callback) = 0; 78 virtual void CaptureInvalidRegion(CaptureCompletedCallback* callback) = 0;
81 79
82 // Get the size of the most recently captured screen. 80 // Get the size of the most recently captured screen.
83 virtual const gfx::Size& size_most_recent() const = 0; 81 virtual const gfx::Size& size_most_recent() const = 0;
84 }; 82 };
85 83
86 } // namespace remoting 84 } // namespace remoting
87 85
88 #endif // REMOTING_HOST_CAPTURER_H_ 86 #endif // REMOTING_HOST_CAPTURER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698