diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-16 18:02:58 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-16 18:02:58 +0000 |
commit | 8c83a71cfc4664a2e5643e9ee4bb1bd3ed53eb0e (patch) | |
tree | 2791a8f91d314baa69420965b6824e5ed72fe3a2 /remoting | |
parent | 85f2958961e6989d2f9cbf76d481c71a9073307b (diff) | |
download | chromium_src-8c83a71cfc4664a2e5643e9ee4bb1bd3ed53eb0e.zip chromium_src-8c83a71cfc4664a2e5643e9ee4bb1bd3ed53eb0e.tar.gz chromium_src-8c83a71cfc4664a2e5643e9ee4bb1bd3ed53eb0e.tar.bz2 |
Remove dependency on skia from remoting
Remoting uses types in webrtc/modules/desktop_capture to represent
rectangles, vectors and regions. This CL removes a few places left where
we were still using Skia types and removes Skia from DEPS.
Also removed leftover InvalidateRegion() declaration from
desktop_session_proxy.h .
R=jamiewalch@chromium.org
Review URL: https://codereview.chromium.org/112453002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
33 files changed, 102 insertions, 99 deletions
diff --git a/remoting/host/DEPS b/remoting/host/DEPS index 70b8379..9b19fb8 100644 --- a/remoting/host/DEPS +++ b/remoting/host/DEPS @@ -3,11 +3,9 @@ include_rules = [ "+remoting/codec", "+remoting/jingle_glue", "+remoting/protocol", - "+skia/ext", "+third_party/jsoncpp", "+third_party/modp_b64", "+third_party/npapi", - "+third_party/skia/include/core", "+third_party/webrtc", "+ui", ] diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h index ee4c587..3e1fa74 100644 --- a/remoting/host/chromoting_host.h +++ b/remoting/host/chromoting_host.h @@ -22,7 +22,6 @@ #include "remoting/protocol/connection_to_client.h" #include "remoting/protocol/pairing_registry.h" #include "remoting/protocol/session_manager.h" -#include "third_party/skia/include/core/SkSize.h" namespace base { class SingleThreadTaskRunner; diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc index c15b6fb..52feba7 100644 --- a/remoting/host/client_session.cc +++ b/remoting/host/client_session.cc @@ -397,7 +397,7 @@ void ClientSession::DisconnectSession() { connection_->Disconnect(); } -void ClientSession::OnLocalMouseMoved(const SkIPoint& position) { +void ClientSession::OnLocalMouseMoved(const webrtc::DesktopVector& position) { DCHECK(CalledOnValidThread()); remote_input_filter_.LocalMouseMoved(position); } diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h index 474e13b..76e0cbe 100644 --- a/remoting/host/client_session.h +++ b/remoting/host/client_session.h @@ -25,8 +25,7 @@ #include "remoting/protocol/input_filter.h" #include "remoting/protocol/input_stub.h" #include "remoting/protocol/pairing_registry.h" -#include "third_party/skia/include/core/SkPoint.h" -#include "third_party/skia/include/core/SkSize.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" namespace base { class SingleThreadTaskRunner; @@ -131,7 +130,8 @@ class ClientSession // ClientSessionControl interface. virtual const std::string& client_jid() const OVERRIDE; virtual void DisconnectSession() OVERRIDE; - virtual void OnLocalMouseMoved(const SkIPoint& position) OVERRIDE; + virtual void OnLocalMouseMoved( + const webrtc::DesktopVector& position) OVERRIDE; virtual void SetDisableInputs(bool disable_inputs) OVERRIDE; protocol::ConnectionToClient* connection() const { diff --git a/remoting/host/client_session_control.h b/remoting/host/client_session_control.h index 5daf04c..de446a6 100644 --- a/remoting/host/client_session_control.h +++ b/remoting/host/client_session_control.h @@ -6,7 +6,10 @@ #define REMOTING_HOST_CLIENT_SESSION_CONTROL_H_ #include "base/basictypes.h" -#include "third_party/skia/include/core/SkPoint.h" + +namespace webrtc { +class DesktopVector; +} // namespace webrtc namespace remoting { @@ -25,7 +28,7 @@ class ClientSessionControl { virtual void DisconnectSession() = 0; // Called when local mouse movement is detected. - virtual void OnLocalMouseMoved(const SkIPoint& position) = 0; + virtual void OnLocalMouseMoved(const webrtc::DesktopVector& position) = 0; // Disables or enables the remote input in the client session. virtual void SetDisableInputs(bool disable_inputs) = 0; diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc index 13207da..7cd21ee 100644 --- a/remoting/host/client_session_unittest.cc +++ b/remoting/host/client_session_unittest.cc @@ -12,6 +12,7 @@ #include "remoting/host/screen_capturer_fake.h" #include "remoting/protocol/protocol_mock_objects.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" #include "third_party/webrtc/modules/desktop_capture/screen_capturer_mock_objects.h" @@ -50,7 +51,8 @@ ACTION_P2(InjectMouseEvent, connection, event) { } ACTION_P2(LocalMouseMoved, client_session, event) { - client_session->OnLocalMouseMoved(SkIPoint::Make(event.x(), event.y())); + client_session->OnLocalMouseMoved( + webrtc::DesktopVector(event.x(), event.y())); } } // namespace diff --git a/remoting/host/desktop_resizer.h b/remoting/host/desktop_resizer.h index 945605a..0b103fc 100644 --- a/remoting/host/desktop_resizer.h +++ b/remoting/host/desktop_resizer.h @@ -9,7 +9,6 @@ #include "base/memory/scoped_ptr.h" #include "remoting/host/screen_resolution.h" -#include "third_party/skia/include/core/SkRect.h" namespace remoting { diff --git a/remoting/host/desktop_resizer_win.cc b/remoting/host/desktop_resizer_win.cc index 9f2de40..6ac1f59 100644 --- a/remoting/host/desktop_resizer_win.cc +++ b/remoting/host/desktop_resizer_win.cc @@ -5,6 +5,7 @@ #include "remoting/host/desktop_resizer.h" #include <map> +#include <windows.h> #include "base/logging.h" diff --git a/remoting/host/desktop_session_agent.cc b/remoting/host/desktop_session_agent.cc index 581f2c1..1597765 100644 --- a/remoting/host/desktop_session_agent.cc +++ b/remoting/host/desktop_session_agent.cc @@ -25,6 +25,7 @@ #include "remoting/proto/event.pb.h" #include "remoting/protocol/clipboard_stub.h" #include "remoting/protocol/input_event_tracker.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" #include "third_party/webrtc/modules/desktop_capture/shared_memory.h" @@ -225,7 +226,8 @@ void DesktopSessionAgent::DisconnectSession() { SendToNetwork(new ChromotingDesktopNetworkMsg_DisconnectSession()); } -void DesktopSessionAgent::OnLocalMouseMoved(const SkIPoint& new_pos) { +void DesktopSessionAgent::OnLocalMouseMoved( + const webrtc::DesktopVector& new_pos) { DCHECK(caller_task_runner_->BelongsToCurrentThread()); remote_input_filter_->LocalMouseMoved(new_pos); diff --git a/remoting/host/desktop_session_agent.h b/remoting/host/desktop_session_agent.h index 55196db..0421eeb 100644 --- a/remoting/host/desktop_session_agent.h +++ b/remoting/host/desktop_session_agent.h @@ -106,7 +106,8 @@ class DesktopSessionAgent // ClientSessionControl interface. virtual const std::string& client_jid() const OVERRIDE; virtual void DisconnectSession() OVERRIDE; - virtual void OnLocalMouseMoved(const SkIPoint& position) OVERRIDE; + virtual void OnLocalMouseMoved( + const webrtc::DesktopVector& position) OVERRIDE; virtual void SetDisableInputs(bool disable_inputs) OVERRIDE; // Handles StartSessionAgent request from the client. diff --git a/remoting/host/desktop_session_proxy.h b/remoting/host/desktop_session_proxy.h index b39ecbb..14f3ff7 100644 --- a/remoting/host/desktop_session_proxy.h +++ b/remoting/host/desktop_session_proxy.h @@ -20,7 +20,6 @@ #include "remoting/host/screen_resolution.h" #include "remoting/proto/event.pb.h" #include "remoting/protocol/clipboard_stub.h" -#include "third_party/skia/include/core/SkRegion.h" #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" namespace base { @@ -103,7 +102,6 @@ class DesktopSessionProxy // APIs used to implement the webrtc::ScreenCapturer interface. These must be // called on the |video_capture_task_runner_| thread. - void InvalidateRegion(const SkRegion& invalid_region); void CaptureFrame(); // Stores |video_capturer| to be used to post captured video frames. Called on diff --git a/remoting/host/host_mock_objects.h b/remoting/host/host_mock_objects.h index 32df6d2..b5f1db9 100644 --- a/remoting/host/host_mock_objects.h +++ b/remoting/host/host_mock_objects.h @@ -49,7 +49,7 @@ class MockClientSessionControl : public ClientSessionControl { MOCK_CONST_METHOD0(client_jid, const std::string&()); MOCK_METHOD0(DisconnectSession, void()); - MOCK_METHOD1(OnLocalMouseMoved, void(const SkIPoint&)); + MOCK_METHOD1(OnLocalMouseMoved, void(const webrtc::DesktopVector&)); MOCK_METHOD1(SetDisableInputs, void(bool)); private: diff --git a/remoting/host/host_status_observer.h b/remoting/host/host_status_observer.h index c43097f..200b7d8 100644 --- a/remoting/host/host_status_observer.h +++ b/remoting/host/host_status_observer.h @@ -7,8 +7,6 @@ #include <string> -#include "third_party/skia/include/core/SkRect.h" - namespace net { class IPEndPoint; } // namespace net diff --git a/remoting/host/host_window_proxy.cc b/remoting/host/host_window_proxy.cc index c810719..085fadf 100644 --- a/remoting/host/host_window_proxy.cc +++ b/remoting/host/host_window_proxy.cc @@ -9,6 +9,7 @@ #include "base/logging.h" #include "base/single_thread_task_runner.h" #include "remoting/host/client_session_control.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" namespace remoting { @@ -38,7 +39,8 @@ class HostWindowProxy::Core // ClientSessionControl interface. virtual const std::string& client_jid() const OVERRIDE; virtual void DisconnectSession() OVERRIDE; - virtual void OnLocalMouseMoved(const SkIPoint& position) OVERRIDE; + virtual void OnLocalMouseMoved( + const webrtc::DesktopVector& position) OVERRIDE; virtual void SetDisableInputs(bool disable_inputs) OVERRIDE; // Task runner on which public methods of this class must be called. @@ -152,7 +154,8 @@ void HostWindowProxy::Core::DisconnectSession() { client_session_control_->DisconnectSession(); } -void HostWindowProxy::Core::OnLocalMouseMoved(const SkIPoint& position) { +void HostWindowProxy::Core::OnLocalMouseMoved( + const webrtc::DesktopVector& position) { if (!caller_task_runner_->BelongsToCurrentThread()) { caller_task_runner_->PostTask( FROM_HERE, base::Bind(&Core::OnLocalMouseMoved, this, position)); diff --git a/remoting/host/input_injector_linux.cc b/remoting/host/input_injector_linux.cc index 94dcbd3..f6f80a2 100644 --- a/remoting/host/input_injector_linux.cc +++ b/remoting/host/input_injector_linux.cc @@ -18,7 +18,7 @@ #include "remoting/base/logging.h" #include "remoting/host/clipboard.h" #include "remoting/proto/internal.pb.h" -#include "third_party/skia/include/core/SkPoint.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" #include "ui/events/keycodes/dom4/keycode_converter.h" namespace remoting { @@ -99,7 +99,7 @@ class InputInjectorLinux : public InputInjector { scoped_refptr<base::SingleThreadTaskRunner> task_runner_; std::set<int> pressed_keys_; - SkIPoint latest_mouse_position_; + webrtc::DesktopVector latest_mouse_position_; float wheel_ticks_x_; float wheel_ticks_y_; @@ -160,7 +160,7 @@ void InputInjectorLinux::Start( InputInjectorLinux::Core::Core( scoped_refptr<base::SingleThreadTaskRunner> task_runner) : task_runner_(task_runner), - latest_mouse_position_(SkIPoint::Make(-1, -1)), + latest_mouse_position_(-1, -1), wheel_ticks_x_(0.0f), wheel_ticks_y_(0.0f), display_(XOpenDisplay(NULL)), @@ -299,7 +299,7 @@ void InputInjectorLinux::Core::InjectMouseEvent(const MouseEvent& event) { if (event.has_delta_x() && event.has_delta_y() && (event.delta_x() != 0 || event.delta_y() != 0)) { - latest_mouse_position_ = SkIPoint::Make(-1, -1); + latest_mouse_position_.set(-1, -1); VLOG(3) << "Moving mouse by " << event.delta_x() << "," << event.delta_y(); XTestFakeRelativeMotionEvent(display_, event.delta_x(), event.delta_y(), @@ -310,16 +310,16 @@ void InputInjectorLinux::Core::InjectMouseEvent(const MouseEvent& event) { // a MotionNotify even if the mouse position hasn't changed, which confuses // apps which assume MotionNotify implies movement. See crbug.com/138075. bool inject_motion = true; - SkIPoint new_mouse_position(SkIPoint::Make(event.x(), event.y())); + webrtc::DesktopVector new_mouse_position( + webrtc::DesktopVector(event.x(), event.y())); if (event.has_button() && event.has_button_down() && !event.button_down()) { - if (new_mouse_position == latest_mouse_position_) + if (new_mouse_position.equals(latest_mouse_position_)) inject_motion = false; } if (inject_motion) { - latest_mouse_position_ = - SkIPoint::Make(std::max(0, new_mouse_position.x()), - std::max(0, new_mouse_position.y())); + latest_mouse_position_.set(std::max(0, new_mouse_position.x()), + std::max(0, new_mouse_position.y())); VLOG(3) << "Moving mouse to " << latest_mouse_position_.x() << "," << latest_mouse_position_.y(); diff --git a/remoting/host/input_injector_mac.cc b/remoting/host/input_injector_mac.cc index 009a41f..f3d158e 100644 --- a/remoting/host/input_injector_mac.cc +++ b/remoting/host/input_injector_mac.cc @@ -18,9 +18,7 @@ #include "remoting/host/clipboard.h" #include "remoting/proto/internal.pb.h" #include "remoting/protocol/message_decoder.h" -#include "skia/ext/skia_utils_mac.h" -#include "third_party/skia/include/core/SkPoint.h" -#include "third_party/skia/include/core/SkRect.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" #include "third_party/webrtc/modules/desktop_capture/mac/desktop_configuration.h" #include "ui/events/keycodes/dom4/keycode_converter.h" @@ -73,7 +71,7 @@ class InputInjectorMac : public InputInjector { virtual ~Core(); scoped_refptr<base::SingleThreadTaskRunner> task_runner_; - SkIPoint mouse_pos_; + webrtc::DesktopVector mouse_pos_; uint32 mouse_button_state_; scoped_ptr<Clipboard> clipboard_; @@ -178,7 +176,7 @@ void InputInjectorMac::Core::InjectMouseEvent(const MouseEvent& event) { // accordingly. // Set the mouse position assuming single-monitor. - mouse_pos_ = SkIPoint::Make(event.x(), event.y()); + mouse_pos_.set(event.x(), event.y()); // Fetch the desktop configuration. // TODO(wez): Optimize this out, or at least only enumerate displays in @@ -190,20 +188,19 @@ void InputInjectorMac::Core::InjectMouseEvent(const MouseEvent& event) { webrtc::MacDesktopConfiguration::TopLeftOrigin); // Translate the mouse position into desktop coordinates. - mouse_pos_ += SkIPoint::Make(desktop_config.pixel_bounds.left(), - desktop_config.pixel_bounds.top()); + mouse_pos_.add(webrtc::DesktopVector(desktop_config.pixel_bounds.left(), + desktop_config.pixel_bounds.top())); // Constrain the mouse position to the desktop coordinates. - mouse_pos_ = SkIPoint::Make( + mouse_pos_.set( std::max(desktop_config.pixel_bounds.left(), std::min(desktop_config.pixel_bounds.right(), mouse_pos_.x())), std::max(desktop_config.pixel_bounds.top(), std::min(desktop_config.pixel_bounds.bottom(), mouse_pos_.y()))); // Convert from pixel to Density Independent Pixel coordinates. - mouse_pos_ = SkIPoint::Make( - SkScalarRound(mouse_pos_.x() / desktop_config.dip_to_pixel_scale), - SkScalarRound(mouse_pos_.y() / desktop_config.dip_to_pixel_scale)); + mouse_pos_.set(mouse_pos_.x() / desktop_config.dip_to_pixel_scale, + mouse_pos_.y() / desktop_config.dip_to_pixel_scale); VLOG(3) << "Moving mouse to " << mouse_pos_.x() << "," << mouse_pos_.y(); } diff --git a/remoting/host/input_injector_win.cc b/remoting/host/input_injector_win.cc index 2d1524f9b..ebdf8ef 100644 --- a/remoting/host/input_injector_win.cc +++ b/remoting/host/input_injector_win.cc @@ -14,9 +14,6 @@ #include "remoting/base/util.h" #include "remoting/host/clipboard.h" #include "remoting/proto/event.pb.h" -// SkSize.h assumes that stdint.h-style types are already defined. -#include "third_party/skia/include/core/SkSize.h" -#include "third_party/skia/include/core/SkTypes.h" #include "ui/events/keycodes/dom4/keycode_converter.h" namespace remoting { @@ -224,13 +221,13 @@ void InputInjectorWin::Core::HandleMouse(const MouseEvent& event) { input.mi.dy = event.delta_y(); input.mi.dwFlags |= MOUSEEVENTF_MOVE | MOUSEEVENTF_VIRTUALDESK; } else if (event.has_x() && event.has_y()) { - SkISize screen_size(SkISize::Make(GetSystemMetrics(SM_CXVIRTUALSCREEN), - GetSystemMetrics(SM_CYVIRTUALSCREEN))); - if ((screen_size.width() > 1) && (screen_size.height() > 1)) { - int x = std::max(0, std::min(screen_size.width(), event.x())); - int y = std::max(0, std::min(screen_size.height(), event.y())); - input.mi.dx = static_cast<int>((x * 65535) / (screen_size.width() - 1)); - input.mi.dy = static_cast<int>((y * 65535) / (screen_size.height() - 1)); + int width = GetSystemMetrics(SM_CXVIRTUALSCREEN); + int height = GetSystemMetrics(SM_CYVIRTUALSCREEN); + if (width > 1 && height > 1) { + int x = std::max(0, std::min(width, event.x())); + int y = std::max(0, std::min(height, event.y())); + input.mi.dx = static_cast<int>((x * 65535) / (width - 1)); + input.mi.dy = static_cast<int>((y * 65535) / (height - 1)); input.mi.dwFlags |= MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_VIRTUALDESK; } diff --git a/remoting/host/ipc_desktop_environment_unittest.cc b/remoting/host/ipc_desktop_environment_unittest.cc index d14a047..52c5e7f 100644 --- a/remoting/host/ipc_desktop_environment_unittest.cc +++ b/remoting/host/ipc_desktop_environment_unittest.cc @@ -30,7 +30,6 @@ #include "remoting/protocol/protocol_mock_objects.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/skia/include/core/SkRegion.h" #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" #include "third_party/webrtc/modules/desktop_capture/screen_capturer_mock_objects.h" diff --git a/remoting/host/local_input_monitor_linux.cc b/remoting/host/local_input_monitor_linux.cc index 0f69597..742472b 100644 --- a/remoting/host/local_input_monitor_linux.cc +++ b/remoting/host/local_input_monitor_linux.cc @@ -20,7 +20,7 @@ #include "base/single_thread_task_runner.h" #include "base/threading/non_thread_safe.h" #include "remoting/host/client_session_control.h" -#include "third_party/skia/include/core/SkPoint.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" // These includes need to be later than dictated by the style guide due to // Xlib header pollution, specifically the min, max, and Status macros. @@ -283,8 +283,8 @@ void LocalInputMonitorLinux::Core::ProcessXEvent(xEvent* event) { DCHECK(input_task_runner_->BelongsToCurrentThread()); if (event->u.u.type == MotionNotify) { - SkIPoint position(SkIPoint::Make(event->u.keyButtonPointer.rootX, - event->u.keyButtonPointer.rootY)); + webrtc::DesktopVector position(event->u.keyButtonPointer.rootX, + event->u.keyButtonPointer.rootY); caller_task_runner_->PostTask( FROM_HERE, base::Bind(&ClientSessionControl::OnLocalMouseMoved, client_session_control_, diff --git a/remoting/host/local_input_monitor_mac.mm b/remoting/host/local_input_monitor_mac.mm index 3144ca8..0a639e6 100644 --- a/remoting/host/local_input_monitor_mac.mm +++ b/remoting/host/local_input_monitor_mac.mm @@ -17,8 +17,8 @@ #include "base/synchronization/lock.h" #include "base/threading/non_thread_safe.h" #include "remoting/host/client_session_control.h" -#include "third_party/skia/include/core/SkPoint.h" #import "third_party/GTM/AppKit/GTMCarbonEvent.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" // Esc Key Code is 53. // http://boredzo.org/blog/wp-content/uploads/2007/05/IMTx-virtual-keycodes.pdf @@ -35,7 +35,7 @@ class LocalInputMonitorMac : public base::NonThreadSafe, public: virtual ~EventHandler() {} - virtual void OnLocalMouseMoved(const SkIPoint& position) = 0; + virtual void OnLocalMouseMoved(const webrtc::DesktopVector& position) = 0; virtual void OnDisconnectShortcut() = 0; }; @@ -70,7 +70,7 @@ class LocalInputMonitorMac : public base::NonThreadSafe, - (void)hotKeyHit:(GTMCarbonHotKey*)hotKey; // Called when the local mouse moves -- (void)localMouseMoved:(const SkIPoint&)mousePos; +- (void)localMouseMoved:(const webrtc::DesktopVector&)mousePos; // Must be called when the LocalInputMonitorManager is no longer to be used. // Similar to NSTimer in that more than a simple release is required. @@ -83,7 +83,7 @@ static CGEventRef LocalMouseMoved(CGEventTapProxy proxy, CGEventType type, int64_t pid = CGEventGetIntegerValueField(event, kCGEventSourceUnixProcessID); if (pid == 0) { CGPoint cgMousePos = CGEventGetLocation(event); - SkIPoint mousePos = SkIPoint::Make(cgMousePos.x, cgMousePos.y); + webrtc::DesktopVector mousePos(cgMousePos.x, cgMousePos.y); [static_cast<LocalInputMonitorManager*>(context) localMouseMoved:mousePos]; } return NULL; @@ -129,7 +129,7 @@ static CGEventRef LocalMouseMoved(CGEventTapProxy proxy, CGEventType type, monitor_->OnDisconnectShortcut(); } -- (void)localMouseMoved:(const SkIPoint&)mousePos { +- (void)localMouseMoved:(const webrtc::DesktopVector&)mousePos { monitor_->OnLocalMouseMoved(mousePos); } @@ -174,7 +174,8 @@ class LocalInputMonitorMac::Core void StopOnUiThread(); // EventHandler interface. - virtual void OnLocalMouseMoved(const SkIPoint& position) OVERRIDE; + virtual void OnLocalMouseMoved( + const webrtc::DesktopVector& position) OVERRIDE; virtual void OnDisconnectShortcut() OVERRIDE; // Task runner on which public methods of this class must be called. @@ -248,7 +249,8 @@ void LocalInputMonitorMac::Core::StopOnUiThread() { manager_ = nil; } -void LocalInputMonitorMac::Core::OnLocalMouseMoved(const SkIPoint& position) { +void LocalInputMonitorMac::Core::OnLocalMouseMoved( + const webrtc::DesktopVector& position) { caller_task_runner_->PostTask( FROM_HERE, base::Bind(&ClientSessionControl::OnLocalMouseMoved, client_session_control_, diff --git a/remoting/host/local_input_monitor_unittest.cc b/remoting/host/local_input_monitor_unittest.cc index 6a64c2a..b1d9c72 100644 --- a/remoting/host/local_input_monitor_unittest.cc +++ b/remoting/host/local_input_monitor_unittest.cc @@ -13,7 +13,6 @@ #include "remoting/protocol/protocol_mock_objects.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/skia/include/core/SkPoint.h" namespace remoting { diff --git a/remoting/host/local_input_monitor_win.cc b/remoting/host/local_input_monitor_win.cc index 2459c0f..c96663b 100644 --- a/remoting/host/local_input_monitor_win.cc +++ b/remoting/host/local_input_monitor_win.cc @@ -13,7 +13,7 @@ #include "base/threading/non_thread_safe.h" #include "base/win/message_window.h" #include "remoting/host/client_session_control.h" -#include "third_party/skia/include/core/SkPoint.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" namespace remoting { @@ -198,7 +198,7 @@ LRESULT LocalInputMonitorWin::Core::OnInput(HRAWINPUT input_handle) { caller_task_runner_->PostTask( FROM_HERE, base::Bind(&ClientSessionControl::OnLocalMouseMoved, client_session_control_, - SkIPoint::Make(position.x, position.y))); + webrtc::DesktopVector(position.x, position.y))); } return DefRawInputProc(&input, 1, sizeof(RAWINPUTHEADER)); diff --git a/remoting/host/remote_input_filter.cc b/remoting/host/remote_input_filter.cc index 002188e..73e9898 100644 --- a/remoting/host/remote_input_filter.cc +++ b/remoting/host/remote_input_filter.cc @@ -4,8 +4,6 @@ #include "remoting/host/remote_input_filter.h" -#include <algorithm> - #include "base/logging.h" #include "remoting/proto/event.pb.h" @@ -33,14 +31,18 @@ RemoteInputFilter::RemoteInputFilter(protocol::InputEventTracker* event_tracker) RemoteInputFilter::~RemoteInputFilter() { } -void RemoteInputFilter::LocalMouseMoved(const SkIPoint& mouse_pos) { +void RemoteInputFilter::LocalMouseMoved( + const webrtc::DesktopVector& mouse_pos) { // If this is a genuine local input event (rather than an echo of a remote // input event that we've just injected), then ignore remote inputs for a // short time. if (expect_local_echo_) { - std::list<SkIPoint>::iterator found_position = - std::find(injected_mouse_positions_.begin(), - injected_mouse_positions_.end(), mouse_pos); + std::list<webrtc::DesktopVector>::iterator found_position = + injected_mouse_positions_.begin(); + while (found_position != injected_mouse_positions_.end() && + !mouse_pos.equals(*found_position)) { + ++found_position; + } if (found_position != injected_mouse_positions_.end()) { // Remove it from the list, and any positions that were added before it, // if any. This is because the local input monitor is assumed to receive @@ -77,7 +79,8 @@ void RemoteInputFilter::InjectMouseEvent(const protocol::MouseEvent& event) { if (ShouldIgnoreInput()) return; if (expect_local_echo_ && event.has_x() && event.has_y()) { - injected_mouse_positions_.push_back(SkIPoint::Make(event.x(), event.y())); + injected_mouse_positions_.push_back( + webrtc::DesktopVector(event.x(), event.y())); if (injected_mouse_positions_.size() > kNumRemoteMousePositions) { VLOG(1) << "Injected mouse positions queue full."; injected_mouse_positions_.pop_front(); diff --git a/remoting/host/remote_input_filter.h b/remoting/host/remote_input_filter.h index 4944ea3..20b5db6 100644 --- a/remoting/host/remote_input_filter.h +++ b/remoting/host/remote_input_filter.h @@ -12,7 +12,6 @@ #include "base/time/time.h" #include "remoting/protocol/input_event_tracker.h" #include "remoting/protocol/input_stub.h" -#include "third_party/skia/include/core/SkPoint.h" namespace remoting { @@ -28,7 +27,7 @@ class RemoteInputFilter : public protocol::InputStub { // Informs the filter that local mouse activity has been detected. If the // activity does not match events we injected then we assume that it is local, // and block remote input for a short while. - void LocalMouseMoved(const SkIPoint& mouse_pos); + void LocalMouseMoved(const webrtc::DesktopVector& mouse_pos); // Informs the filter that injecting input causes an echo. void SetExpectLocalEcho(bool expect_local_echo); @@ -44,7 +43,7 @@ class RemoteInputFilter : public protocol::InputStub { // Queue of recently-injected mouse positions used to distinguish echoes of // injected events from movements from a local input device. - std::list<SkIPoint> injected_mouse_positions_; + std::list<webrtc::DesktopVector> injected_mouse_positions_; // Time at which local input events were most recently observed. base::TimeTicks latest_local_input_time_; diff --git a/remoting/host/remote_input_filter_unittest.cc b/remoting/host/remote_input_filter_unittest.cc index 48b7183..e7ba17b 100644 --- a/remoting/host/remote_input_filter_unittest.cc +++ b/remoting/host/remote_input_filter_unittest.cc @@ -67,7 +67,7 @@ TEST(RemoteInputFilterTest, MismatchedLocalActivity) { for (int i = 0; i < 10; ++i) { input_filter.InjectMouseEvent(MouseMoveEvent(0, 0)); if (i == 4) - input_filter.LocalMouseMoved(SkIPoint::Make(1, 1)); + input_filter.LocalMouseMoved(webrtc::DesktopVector(1, 1)); } } @@ -82,7 +82,7 @@ TEST(RemoteInputFilterTest, LocalEchoesOfRemoteActivity) { for (int i = 0; i < 10; ++i) { input_filter.InjectMouseEvent(MouseMoveEvent(0, 0)); - input_filter.LocalMouseMoved(SkIPoint::Make(0, 0)); + input_filter.LocalMouseMoved(webrtc::DesktopVector(0, 0)); } } @@ -97,9 +97,9 @@ TEST(RemoteInputFilterTest, LocalEchosAndLocalActivity) { for (int i = 0; i < 10; ++i) { input_filter.InjectMouseEvent(MouseMoveEvent(0, 0)); - input_filter.LocalMouseMoved(SkIPoint::Make(0, 0)); + input_filter.LocalMouseMoved(webrtc::DesktopVector(0, 0)); if (i == 4) - input_filter.LocalMouseMoved(SkIPoint::Make(1, 1)); + input_filter.LocalMouseMoved(webrtc::DesktopVector(1, 1)); } } @@ -120,9 +120,9 @@ TEST(RemoteInputFilterTest, LocalActivityReleasesAll) { for (int i = 0; i < 10; ++i) { input_filter.InjectMouseEvent(MouseMoveEvent(0, 0)); - input_filter.LocalMouseMoved(SkIPoint::Make(0, 0)); + input_filter.LocalMouseMoved(webrtc::DesktopVector(0, 0)); if (i == 4) - input_filter.LocalMouseMoved(SkIPoint::Make(1, 1)); + input_filter.LocalMouseMoved(webrtc::DesktopVector(1, 1)); } } diff --git a/remoting/host/video_scheduler.h b/remoting/host/video_scheduler.h index 804cdfd..f2eabd9 100644 --- a/remoting/host/video_scheduler.h +++ b/remoting/host/video_scheduler.h @@ -15,7 +15,6 @@ #include "remoting/codec/video_encoder.h" #include "remoting/host/capture_scheduler.h" #include "remoting/proto/video.pb.h" -#include "third_party/skia/include/core/SkSize.h" #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" namespace base { diff --git a/remoting/host/win/rdp_client.cc b/remoting/host/win/rdp_client.cc index 7b3d2c5..30a1abc 100644 --- a/remoting/host/win/rdp_client.cc +++ b/remoting/host/win/rdp_client.cc @@ -14,6 +14,7 @@ #include "net/base/ip_endpoint.h" #include "remoting/base/typed_buffer.h" #include "remoting/host/win/rdp_client_window.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" namespace remoting { @@ -45,7 +46,8 @@ class RdpClient::Core RdpClient::EventHandler* event_handler); // Initiates a loopback RDP connection. - void Connect(const SkISize& screen_size, const std::string& terminal_id); + void Connect(const webrtc::DesktopSize& screen_size, + const std::string& terminal_id); // Initiates a graceful shutdown of the RDP connection. void Disconnect(); @@ -88,7 +90,7 @@ class RdpClient::Core RdpClient::RdpClient( scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, - const SkISize& screen_size, + const webrtc::DesktopSize& screen_size, const std::string& terminal_id, EventHandler* event_handler) { DCHECK(caller_task_runner->BelongsToCurrentThread()); @@ -118,7 +120,7 @@ RdpClient::Core::Core( event_handler_(event_handler) { } -void RdpClient::Core::Connect(const SkISize& screen_size, +void RdpClient::Core::Connect(const webrtc::DesktopSize& screen_size, const std::string& terminal_id) { if (!ui_task_runner_->BelongsToCurrentThread()) { ui_task_runner_->PostTask( diff --git a/remoting/host/win/rdp_client.h b/remoting/host/win/rdp_client.h index 22a3805..6761e97 100644 --- a/remoting/host/win/rdp_client.h +++ b/remoting/host/win/rdp_client.h @@ -11,11 +11,14 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/threading/non_thread_safe.h" -#include "third_party/skia/include/core/SkSize.h" namespace base { class SingleThreadTaskRunner; -} // namespace +} // namespace base + +namespace webrtc { +class DesktopSize; +} // namespace webrtc namespace remoting { @@ -37,7 +40,7 @@ class RdpClient : public base::NonThreadSafe { RdpClient( scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, - const SkISize& screen_size, + const webrtc::DesktopSize& screen_size, const std::string& terminal_id, EventHandler* event_handler); virtual ~RdpClient(); diff --git a/remoting/host/win/rdp_client_unittest.cc b/remoting/host/win/rdp_client_unittest.cc index 0c58a3f..de755e4 100644 --- a/remoting/host/win/rdp_client_unittest.cc +++ b/remoting/host/win/rdp_client_unittest.cc @@ -20,6 +20,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock_mutant.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" using testing::_; using testing::AtMost; @@ -161,9 +162,10 @@ TEST_F(RdpClientTest, Basic) { .Times(AtMost(1)) .WillOnce(InvokeWithoutArgs(this, &RdpClientTest::CloseRdpClient)); - rdp_client_.reset(new RdpClient(task_runner_, task_runner_, - SkISize::Make(kDefaultWidth, kDefaultHeight), - terminal_id_, &event_handler_)); + rdp_client_.reset(new RdpClient( + task_runner_, task_runner_, + webrtc::DesktopSize(kDefaultWidth, kDefaultHeight), + terminal_id_, &event_handler_)); task_runner_ = NULL; run_loop_.Run(); diff --git a/remoting/host/win/rdp_client_window.cc b/remoting/host/win/rdp_client_window.cc index 2a30cd1..9a2d366 100644 --- a/remoting/host/win/rdp_client_window.cc +++ b/remoting/host/win/rdp_client_window.cc @@ -114,7 +114,6 @@ RdpClientWindow::RdpClientWindow(const net::IPEndPoint& server_endpoint, const std::string& terminal_id, EventHandler* event_handler) : event_handler_(event_handler), - screen_size_(SkISize::Make(0, 0)), server_endpoint_(server_endpoint), terminal_id_(terminal_id) { } @@ -127,7 +126,7 @@ RdpClientWindow::~RdpClientWindow() { DCHECK(!client_settings_); } -bool RdpClientWindow::Connect(const SkISize& screen_size) { +bool RdpClientWindow::Connect(const webrtc::DesktopSize& screen_size) { DCHECK(!m_hWnd); screen_size_ = screen_size; diff --git a/remoting/host/win/rdp_client_window.h b/remoting/host/win/rdp_client_window.h index 64538d9..dc1db77 100644 --- a/remoting/host/win/rdp_client_window.h +++ b/remoting/host/win/rdp_client_window.h @@ -15,7 +15,7 @@ #include "base/message_loop/message_loop.h" #include "base/win/scoped_comptr.h" #include "net/base/ip_endpoint.h" -#include "third_party/skia/include/core/SkSize.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" #import "PROGID:MsTscAx.MsTscAx" \ exclude("wireHWND", "_RemotableHandle", "__MIDL_IWinTypes_0009"), \ @@ -72,7 +72,7 @@ class RdpClientWindow // Creates the window along with the ActiveX control and initiates the // connection. |screen_size| specifies resolution of the screen. Returns false // if an error occurs. - bool Connect(const SkISize& screen_size); + bool Connect(const webrtc::DesktopSize& screen_size); // Initiates shutdown of the connection. The caller must not delete |this| // until it receives OnDisconnected() notification. @@ -133,7 +133,7 @@ class RdpClientWindow EventHandler* event_handler_; // Contains the requested dimensions of the screen. - SkISize screen_size_; + webrtc::DesktopSize screen_size_; // The endpoint to connect to. net::IPEndPoint server_endpoint_; diff --git a/remoting/host/win/rdp_desktop_session.cc b/remoting/host/win/rdp_desktop_session.cc index cef74db..73c3338 100644 --- a/remoting/host/win/rdp_desktop_session.cc +++ b/remoting/host/win/rdp_desktop_session.cc @@ -7,6 +7,7 @@ #include "base/strings/utf_string_conversions.h" #include "remoting/base/auto_thread_task_runner.h" #include "remoting/host/win/chromoting_module.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" namespace remoting { @@ -25,7 +26,7 @@ STDMETHODIMP RdpDesktopSession::Connect( DCHECK(task_runner->BelongsToCurrentThread()); client_.reset(new RdpClient(task_runner, task_runner, - SkISize::Make(width, height), + webrtc::DesktopSize(width, height), UTF16ToUTF8(terminal_id), this)); return S_OK; } diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp index f0f46c8..c4f6fde 100644 --- a/remoting/remoting.gyp +++ b/remoting/remoting.gyp @@ -2109,7 +2109,6 @@ 'remoting_jingle_glue', '../net/net.gyp:net', '../ppapi/ppapi.gyp:ppapi_cpp_objects', - '../skia/skia.gyp:skia', '../third_party/webrtc/modules/modules.gyp:desktop_capture', '../ui/events/events.gyp:dom4_keycode_converter', ], @@ -2499,7 +2498,6 @@ '../ui/gfx/gfx.gyp:gfx', '../ui/ui.gyp:ui', '../net/net.gyp:net', - '../skia/skia.gyp:skia', '../third_party/libvpx/libvpx.gyp:libvpx', '../third_party/libyuv/libyuv.gyp:libyuv', '../third_party/opus/opus.gyp:opus', @@ -2514,7 +2512,6 @@ 'export_dependent_settings': [ '../base/base.gyp:base', '../net/net.gyp:net', - '../skia/skia.gyp:skia', '../third_party/protobuf/protobuf.gyp:protobuf_lite', 'proto/chromotocol.gyp:chromotocol_proto_lib', ], |