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

Unified Diff: webrtc/modules/desktop_capture/win/dxgi_output_duplicator.cc

Issue 2495143002: DirectX capturer flickers on the second monitor (Closed)
Patch Set: Created 4 years, 1 month 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 | « webrtc/modules/desktop_capture/win/dxgi_output_duplicator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/win/dxgi_output_duplicator.cc
diff --git a/webrtc/modules/desktop_capture/win/dxgi_output_duplicator.cc b/webrtc/modules/desktop_capture/win/dxgi_output_duplicator.cc
index 122ad1f6e159cab692eb28394588145173f075f2..9c0f14c43d2a8a1552d9c0c619a81a0ef7c2b218 100644
--- a/webrtc/modules/desktop_capture/win/dxgi_output_duplicator.cc
+++ b/webrtc/modules/desktop_capture/win/dxgi_output_duplicator.cc
@@ -163,8 +163,8 @@ bool DxgiOutputDuplicator::Duplicate(Context* context,
const DesktopFrame& source = texture_->AsDesktopFrame();
for (DesktopRegion::Iterator it(updated_region); !it.IsAtEnd();
it.Advance()) {
- target->CopyPixelsFrom(source, SourceRect(it.rect()).top_left(),
- TargetRect(it.rect(), offset));
+ target->CopyPixelsFrom(
+ source, SourceRect(it.rect()).top_left(), it.rect());
}
last_frame_ = target->Share();
last_frame_offset_ = offset;
@@ -177,8 +177,7 @@ bool DxgiOutputDuplicator::Duplicate(Context* context,
// export last frame to the target.
for (DesktopRegion::Iterator it(updated_region); !it.IsAtEnd();
it.Advance()) {
- target->CopyPixelsFrom(*last_frame_, SourceRect(it.rect()).top_left(),
- TargetRect(it.rect(), offset));
+ target->CopyPixelsFrom(*last_frame_, it.rect().top_left(), it.rect());
}
target->mutable_updated_region()->AddRegion(updated_region);
}
@@ -302,11 +301,4 @@ DesktopRect DxgiOutputDuplicator::SourceRect(DesktopRect rect) {
return rect;
}
-DesktopRect DxgiOutputDuplicator::TargetRect(DesktopRect rect,
- DesktopVector offset) {
- rect = SourceRect(rect);
- rect.Translate(offset);
- return rect;
-}
-
} // namespace webrtc
« no previous file with comments | « webrtc/modules/desktop_capture/win/dxgi_output_duplicator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698