OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/capturer_linux.h" | 5 #include "remoting/host/capturer_linux.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 #include <X11/Xutil.h> | 8 #include <X11/Xutil.h> |
9 #include <X11/extensions/Xdamage.h> | 9 #include <X11/extensions/Xdamage.h> |
10 | 10 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 Damage damage_handle_; | 77 Damage damage_handle_; |
78 int damage_event_base_; | 78 int damage_event_base_; |
79 int damage_error_base_; | 79 int damage_error_base_; |
80 | 80 |
81 // Capture state. | 81 // Capture state. |
82 uint8* buffers_[CapturerLinux::kNumBuffers]; | 82 uint8* buffers_[CapturerLinux::kNumBuffers]; |
83 int stride_; | 83 int stride_; |
84 bool capture_fullscreen_; | 84 bool capture_fullscreen_; |
85 }; | 85 }; |
86 | 86 |
87 CapturerLinux::CapturerLinux() | 87 CapturerLinux::CapturerLinux(MessageLoop* message_loop) |
88 : pimpl_(new CapturerLinuxPimpl(this)) { | 88 : Capturer(message_loop), |
| 89 pimpl_(new CapturerLinuxPimpl(this)) { |
89 // TODO(ajwong): This should be moved into an Init() method on Capturer | 90 // TODO(ajwong): This should be moved into an Init() method on Capturer |
90 // itself. Then we can remove the CHECK. | 91 // itself. Then we can remove the CHECK. |
91 CHECK(pimpl_->Init()); | 92 CHECK(pimpl_->Init()); |
92 } | 93 } |
93 | 94 |
94 CapturerLinux::~CapturerLinux() { | 95 CapturerLinux::~CapturerLinux() { |
95 } | 96 } |
96 | 97 |
97 void CapturerLinux::ScreenConfigurationChanged() { | 98 void CapturerLinux::ScreenConfigurationChanged() { |
98 // TODO(ajwong): Support resolution changes. | 99 // TODO(ajwong): Support resolution changes. |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 (((pixel & image->blue_mask) >> blue_shift) * max_green) / 255; | 333 (((pixel & image->blue_mask) >> blue_shift) * max_green) / 255; |
333 | 334 |
334 // Write as 32-bit RGB. | 335 // Write as 32-bit RGB. |
335 *dst_pos = r << 16 | g << 8 | b; | 336 *dst_pos = r << 16 | g << 8 | b; |
336 dst_pos++; | 337 dst_pos++; |
337 } | 338 } |
338 } | 339 } |
339 } | 340 } |
340 | 341 |
341 } // namespace remoting | 342 } // namespace remoting |
OLD | NEW |