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

Unified Diff: webrtc/modules/desktop_capture/desktop_geometry.cc

Issue 1845113002: DirectX based screen capturer logic (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove width change in Texture::Capture Created 4 years, 8 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
Index: webrtc/modules/desktop_capture/desktop_geometry.cc
diff --git a/webrtc/modules/desktop_capture/desktop_geometry.cc b/webrtc/modules/desktop_capture/desktop_geometry.cc
index 1ff7c683c79828a0d8c4e5f9c4c4cb23fd365243..0881c6f0175eb50798f0958630a8c657bcd36592 100644
--- a/webrtc/modules/desktop_capture/desktop_geometry.cc
+++ b/webrtc/modules/desktop_capture/desktop_geometry.cc
@@ -44,5 +44,18 @@ void DesktopRect::Translate(int32_t dx, int32_t dy) {
bottom_ += dy;
}
+DesktopRect DesktopRect::Expand(uint32_t padding,
+ const DesktopSize& size) const {
+ int32_t l = left() - padding;
+ int32_t t = top() - padding;
+ int32_t r = right() + padding;
+ int32_t b = bottom() + padding;
+ if (l < 0) l = 0;
+ if (t < 0) t = 0;
+ if (r > size.width()) r = size.width();
+ if (b > size.height()) b = size.height();
+ return DesktopRect(l, t, r, b);
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698