Index: remoting/host/differ.cc |
diff --git a/remoting/host/differ.cc b/remoting/host/differ.cc |
index d5e618a80d25314b41ef45b3793eae40de439a7f..582521ced70e3229cc55a2972944cd1d112d3b07 100644 |
--- a/remoting/host/differ.cc |
+++ b/remoting/host/differ.cc |
@@ -26,12 +26,12 @@ Differ::Differ(int width, int height, int bpp, int stride) { |
Differ::~Differ() {} |
-void Differ::CalcDirtyRects(const void* prev_buffer, const void* curr_buffer, |
- InvalidRects* rects) { |
- if (!rects) { |
+void Differ::CalcDirtyRegion(const void* prev_buffer, const void* curr_buffer, |
+ SkRegion* region) { |
+ if (!region) { |
return; |
} |
- rects->clear(); |
+ region->setEmpty(); |
if (!prev_buffer || !curr_buffer) { |
return; |
@@ -42,7 +42,7 @@ void Differ::CalcDirtyRects(const void* prev_buffer, const void* curr_buffer, |
// Now that we've identified the blocks that have changed, merge adjacent |
// blocks to minimize the number of rects that we return. |
- MergeBlocks(rects); |
+ MergeBlocks(region); |
} |
void Differ::MarkDirtyBlocks(const void* prev_buffer, const void* curr_buffer) { |
@@ -131,9 +131,9 @@ DiffInfo Differ::DiffPartialBlock(const uint8* prev_buffer, |
return 0; |
} |
-void Differ::MergeBlocks(InvalidRects* rects) { |
- DCHECK(rects); |
- rects->clear(); |
+void Differ::MergeBlocks(SkRegion* region) { |
+ DCHECK(region); |
+ region->setEmpty(); |
uint8* diff_info_row_start = static_cast<uint8*>(diff_info_.get()); |
int diff_info_stride = diff_info_width_ * sizeof(DiffInfo); |
@@ -195,7 +195,8 @@ void Differ::MergeBlocks(InvalidRects* rects) { |
if (top + height > height_) { |
height = height_ - top; |
} |
- rects->insert(gfx::Rect(left, top, width, height)); |
+ region->op(SkIRect::MakeXYWH(left, top, width, height), |
+ SkRegion::kUnion_Op); |
} |
// Increment to next block in this row. |