diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-11 05:23:47 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-11 05:23:47 +0000 |
commit | 2db534007e92ba616b61e7a65f76e738151620f5 (patch) | |
tree | 9057712927d66f7e29e2981840cc86304e3d2d59 /remoting/host/capturer_helper.h | |
parent | 274e372af7a6d457e4773fdce215e3e6d70efcea (diff) | |
download | chromium_src-2db534007e92ba616b61e7a65f76e738151620f5.zip chromium_src-2db534007e92ba616b61e7a65f76e738151620f5.tar.gz chromium_src-2db534007e92ba616b61e7a65f76e738151620f5.tar.bz2 |
Revert 96327 - Switch over to using SkRegions to calculate dirty areas.
BUG=91619
TEST=Set up a remoting sesssion and make sure it works.
Review URL: http://codereview.chromium.org/7491070
TBR=dmaclach@chromium.org
Review URL: http://codereview.chromium.org/7622002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96328 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/capturer_helper.h')
-rw-r--r-- | remoting/host/capturer_helper.h | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/remoting/host/capturer_helper.h b/remoting/host/capturer_helper.h index 36968a1..b7650c0 100644 --- a/remoting/host/capturer_helper.h +++ b/remoting/host/capturer_helper.h @@ -6,24 +6,24 @@ #define REMOTING_HOST_CAPTURER_HELPER_H_ #include "base/synchronization/lock.h" -#include "third_party/skia/include/core/SkRegion.h" -#include "ui/gfx/size.h" +#include "remoting/base/types.h" namespace remoting { // CapturerHelper is intended to be used by an implementation of the Capturer -// interface. It maintains a thread-safe invalid region, and the size of the -// most recently captured screen, on behalf of the Capturer that owns it. +// interface. It maintains a thread-safe list of invalid rectangles, and the +// size of the most recently captured screen, on behalf of the Capturer that +// owns it. class CapturerHelper { public: CapturerHelper(); ~CapturerHelper(); - // Clear out the invalid region. - void ClearInvalidRegion(); + // Clear out the list of invalid rects. + void ClearInvalidRects(); - // Invalidate the specified region. - void InvalidateRegion(const SkRegion& invalid_region); + // Invalidate the specified screen rects. + void InvalidateRects(const InvalidRects& inval_rects); // Invalidate the entire screen, of a given size. void InvalidateScreen(const gfx::Size& size); @@ -35,21 +35,29 @@ class CapturerHelper { // Whether the invalid region is a full screen of a given size. bool IsCaptureFullScreen(const gfx::Size& size); - // Swap the given region with the stored invalid region. - void SwapInvalidRegion(SkRegion* invalid_region); + // Swap the given set of rects with the stored invalid rects. + // This should be used like this: + // + // InvalidRects inval_rects; + // common.SwapInvalidRects(inval_rects); + // + // This passes the invalid rects to the caller, and removes them from this + // object. The caller should then pass the raster data in those rects to the + // client. + void SwapInvalidRects(InvalidRects& inval_rects); // Access the size of the most recently captured screen. const gfx::Size& size_most_recent() const; void set_size_most_recent(const gfx::Size& size); private: - // A region that has been manually invalidated (through InvalidateRegion). - // These will be returned as dirty_region in the capture data during the next + // Rects that have been manually invalidated (through InvalidateRect). + // These will be returned as dirty_rects in the capture data during the next // capture. - SkRegion invalid_region_; + InvalidRects inval_rects_; - // A lock protecting |invalid_region_| across threads. - base::Lock invalid_region_lock_; + // A lock protecting |inval_rects_| across threads. + base::Lock inval_rects_lock_; // The size of the most recently captured screen. gfx::Size size_most_recent_; |