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

Unified Diff: media/video/capture/screen/differ.cc

Issue 13983010: Use webrtc::DesktopCapturer for screen capturer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | « media/video/capture/screen/differ.h ('k') | media/video/capture/screen/differ_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/screen/differ.cc
diff --git a/media/video/capture/screen/differ.cc b/media/video/capture/screen/differ.cc
index 3296903824015b4d45275282e1a9f30385f0450f..addaea1bab260bf1724e0e647a5adbfd1cb3ca02 100644
--- a/media/video/capture/screen/differ.cc
+++ b/media/video/capture/screen/differ.cc
@@ -27,16 +27,7 @@ Differ::Differ(int width, int height, int bpp, int stride) {
Differ::~Differ() {}
void Differ::CalcDirtyRegion(const void* prev_buffer, const void* curr_buffer,
- SkRegion* region) {
- if (!region) {
- return;
- }
- region->setEmpty();
-
- if (!prev_buffer || !curr_buffer) {
- return;
- }
-
+ webrtc::DesktopRegion* region) {
// Identify all the blocks that contain changed pixels.
MarkDirtyBlocks(prev_buffer, curr_buffer);
@@ -131,9 +122,8 @@ DiffInfo Differ::DiffPartialBlock(const uint8* prev_buffer,
return 0;
}
-void Differ::MergeBlocks(SkRegion* region) {
- DCHECK(region);
- region->setEmpty();
+void Differ::MergeBlocks(webrtc::DesktopRegion* region) {
+ region->Clear();
uint8* diff_info_row_start = static_cast<uint8*>(diff_info_.get());
int diff_info_stride = diff_info_width_ * sizeof(DiffInfo);
@@ -195,8 +185,8 @@ void Differ::MergeBlocks(SkRegion* region) {
if (top + height > height_) {
height = height_ - top;
}
- region->op(SkIRect::MakeXYWH(left, top, width, height),
- SkRegion::kUnion_Op);
+ region->AddRect(
+ webrtc::DesktopRect::MakeXYWH(left, top, width, height));
}
// Increment to next block in this row.
« no previous file with comments | « media/video/capture/screen/differ.h ('k') | media/video/capture/screen/differ_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698