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

Unified Diff: remoting/host/differ.cc

Issue 7491070: Switch over to using SkRegions to calculate dirty areas. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed up shared lib compile 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/differ.h ('k') | remoting/host/differ_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « remoting/host/differ.h ('k') | remoting/host/differ_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698