Reland "Reland "Reland "Implemented screen enumeration and selection for desktop capture under X11 using the X Resize and Rotate extension version 1.5."""

This is a reland of af51be7869994a299451e22e6382ae641767b26d

Original change's description:
> Reland "Reland "Implemented screen enumeration and selection for desktop capture under X11 using the X Resize and Rotate extension version 1.5.""
> 
> This is a reland of a0adf3d4409036d095480e9bfa0fc06990362f84
> 
> Original change's description:
> > Reland "Implemented screen enumeration and selection for desktop capture under X11 using the X Resize and Rotate extension version 1.5."
> > 
> > This is a reland of e7153012682ccd3d1eacc18f802cab7820e3bad3
> > 
> > Original change's description:
> > > Implemented screen enumeration and selection for desktop capture under X11 using the X Resize and Rotate entension version 1.5.
> > >
> > > Bug: chromium:396091
> > > Change-Id: Ia1b36c771632c536bb8d15322461b479fabc409e
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148768
> > > Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
> > > Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#29083}
> > 
> > Bug: chromium:396091
> > Change-Id: I0d9171ae5f340e0489e4b45ce5d97bc52b0a4904
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156067
> > Commit-Queue: Tommi <tommi@webrtc.org>
> > Reviewed-by: Tommi <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#29655}
> 
> Bug: chromium:396091
> Change-Id: I47525911095fabc6cee613d03b0d83134b95b084
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158900
> Reviewed-by: Tomas Gunnarsson <tommi@chromium.org>
> Reviewed-by: Tommi <tommi@webrtc.org>
> Commit-Queue: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30032}

Bug: chromium:396091
Change-Id: I03702c8ea935bb5fe1797defda1ba6b279b95217
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165724
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#30461}
This commit is contained in:
Trevor Hayes
2020-01-12 01:00:10 -05:00
committed by Commit Bot
parent 1cb929fb9e
commit 703a5d76d9
6 changed files with 182 additions and 21 deletions

View File

@ -66,8 +66,12 @@ void FastBlit(XImage* x_image,
uint8_t* src_pos,
const DesktopRect& rect,
DesktopFrame* frame) {
RTC_DCHECK_LE(frame->top_left().x(), rect.left());
RTC_DCHECK_LE(frame->top_left().y(), rect.top());
int src_stride = x_image->bytes_per_line;
int dst_x = rect.left(), dst_y = rect.top();
int dst_x = rect.left() - frame->top_left().x();
int dst_y = rect.top() - frame->top_left().y();
uint8_t* dst_pos = frame->data() + frame->stride() * dst_y;
dst_pos += dst_x * DesktopFrame::kBytesPerPixel;
@ -85,8 +89,12 @@ void SlowBlit(XImage* x_image,
uint8_t* src_pos,
const DesktopRect& rect,
DesktopFrame* frame) {
RTC_DCHECK_LE(frame->top_left().x(), rect.left());
RTC_DCHECK_LE(frame->top_left().y(), rect.top());
int src_stride = x_image->bytes_per_line;
int dst_x = rect.left(), dst_y = rect.top();
int dst_x = rect.left() - frame->top_left().x();
int dst_y = rect.top() - frame->top_left().y();
int width = rect.width(), height = rect.height();
uint32_t red_mask = x_image->red_mask;