summaryrefslogtreecommitdiffstats
path: root/remoting/host/differ.h
diff options
context:
space:
mode:
authordmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-11 05:08:49 +0000
committerdmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-11 05:08:49 +0000
commit274e372af7a6d457e4773fdce215e3e6d70efcea (patch)
tree407836ad1a4f7a34fa14c8ff045e833d90b9b1d5 /remoting/host/differ.h
parent418b75e0f077a184e6f1ae81f7e41e98454706dd (diff)
downloadchromium_src-274e372af7a6d457e4773fdce215e3e6d70efcea.zip
chromium_src-274e372af7a6d457e4773fdce215e3e6d70efcea.tar.gz
chromium_src-274e372af7a6d457e4773fdce215e3e6d70efcea.tar.bz2
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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96327 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/differ.h')
-rw-r--r--remoting/host/differ.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/remoting/host/differ.h b/remoting/host/differ.h
index 9903680..c46f57a 100644
--- a/remoting/host/differ.h
+++ b/remoting/host/differ.h
@@ -9,13 +9,16 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
-#include "remoting/base/types.h"
-#include "ui/gfx/rect.h"
+#include "third_party/skia/include/core/SkRegion.h"
namespace remoting {
typedef uint8 DiffInfo;
+// TODO: Simplify differ now that we are working with SkRegions.
+// diff_info_ should no longer be needed, as we can put our data directly into
+// the region that we are calculating.
+// http://crbug.com/92379
class Differ {
public:
// Create a differ that operates on bitmaps with the specified width, height
@@ -28,24 +31,22 @@ class Differ {
int bytes_per_pixel() { return bytes_per_pixel_; }
int bytes_per_row() { return bytes_per_row_; }
- // Given the previous and current screen buffer, calculate the set of
- // rectangles that enclose all the changed pixels in the new screen.
- void CalcDirtyRects(const void* prev_buffer, const void* curr_buffer,
- InvalidRects* rects);
+ // Given the previous and current screen buffer, calculate the dirty region
+ // that encloses all of the changed pixels in the new screen.
+ void CalcDirtyRegion(const void* prev_buffer, const void* curr_buffer,
+ SkRegion* region);
+
+ private:
+ // Allow tests to access our private parts.
+ friend class DifferTest;
// Identify all of the blocks that contain changed pixels.
void MarkDirtyBlocks(const void* prev_buffer, const void* curr_buffer);
// After the dirty blocks have been identified, this routine merges adjacent
- // blocks into larger rectangular units.
- // The goal is to minimize the number of rects that cover the dirty blocks,
- // although it is not required to calc the absolute minimum of rects.
- void MergeBlocks(InvalidRects* rects);
-
- // Allow tests to access our private parts.
- friend class DifferTest;
-
- private:
+ // blocks into a region.
+ // The goal is to minimize the region that covers the dirty blocks.
+ void MergeBlocks(SkRegion* region);
// Check for diffs in upper-left portion of the block. The size of the portion
// to check is specified by the |width| and |height| values.