| Index: remoting/host/input_injector_mac.cc
|
| diff --git a/remoting/host/input_injector_mac.cc b/remoting/host/input_injector_mac.cc
|
| index 009a41f7eeb34730fff73dd528ddaea7c032aa2c..f3d158ee486a4384f36da9e1ac159c6894bfab42 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();
|
| }
|
|
|