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

Unified Diff: media/video/capture/screen/x11/x_server_pixel_buffer.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/x11/x_server_pixel_buffer.h ('k') | remoting/codec/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/screen/x11/x_server_pixel_buffer.cc
diff --git a/media/video/capture/screen/x11/x_server_pixel_buffer.cc b/media/video/capture/screen/x11/x_server_pixel_buffer.cc
index 980f1ca060c5ad5e591c6ce2a8fdea5d8c767ce0..4941666a4daf31268a0f7be674327096468f04c9 100644
--- a/media/video/capture/screen/x11/x_server_pixel_buffer.cc
+++ b/media/video/capture/screen/x11/x_server_pixel_buffer.cc
@@ -60,7 +60,7 @@ namespace media {
XServerPixelBuffer::XServerPixelBuffer()
: display_(NULL), root_window_(0),
- root_window_size_(SkISize::Make(0, 0)), x_image_(NULL),
+ x_image_(NULL),
shm_segment_info_(NULL), shm_pixmap_(0), shm_gc_(NULL) {
}
@@ -92,7 +92,7 @@ void XServerPixelBuffer::Release() {
}
void XServerPixelBuffer::Init(Display* display,
- const SkISize& screen_size) {
+ const webrtc::DesktopSize& screen_size) {
Release();
display_ = display;
root_window_size_ = screen_size;
@@ -102,10 +102,10 @@ void XServerPixelBuffer::Init(Display* display,
}
// static
-SkISize XServerPixelBuffer::GetRootWindowSize(Display* display) {
+webrtc::DesktopSize XServerPixelBuffer::GetRootWindowSize(Display* display) {
XWindowAttributes root_attr;
XGetWindowAttributes(display, DefaultRootWindow(display), &root_attr);
- return SkISize::Make(root_attr.width, root_attr.height);
+ return webrtc::DesktopSize(root_attr.width, root_attr.height);
}
void XServerPixelBuffer::InitShm(int screen) {
@@ -211,22 +211,24 @@ void XServerPixelBuffer::Synchronize() {
}
}
-uint8* XServerPixelBuffer::CaptureRect(const SkIRect& rect) {
- DCHECK(SkIRect::MakeSize(root_window_size_).contains(rect));
+uint8* XServerPixelBuffer::CaptureRect(const webrtc::DesktopRect& rect) {
+ DCHECK_LE(rect.right(), root_window_size_.width());
+ DCHECK_LE(rect.bottom(), root_window_size_.height());
+
if (shm_segment_info_) {
if (shm_pixmap_) {
XCopyArea(display_, root_window_, shm_pixmap_, shm_gc_,
- rect.fLeft, rect.fTop, rect.width(), rect.height(),
- rect.fLeft, rect.fTop);
+ rect.left(), rect.top(), rect.width(), rect.height(),
+ rect.left(), rect.top());
XSync(display_, False);
}
return reinterpret_cast<uint8*>(x_image_->data) +
- rect.fTop * x_image_->bytes_per_line +
- rect.fLeft * x_image_->bits_per_pixel / 8;
+ rect.top() * x_image_->bytes_per_line +
+ rect.left() * x_image_->bits_per_pixel / 8;
} else {
if (x_image_)
XDestroyImage(x_image_);
- x_image_ = XGetImage(display_, root_window_, rect.fLeft, rect.fTop,
+ x_image_ = XGetImage(display_, root_window_, rect.left(), rect.top(),
rect.width(), rect.height(), AllPlanes, ZPixmap);
return reinterpret_cast<uint8*>(x_image_->data);
}
« no previous file with comments | « media/video/capture/screen/x11/x_server_pixel_buffer.h ('k') | remoting/codec/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698