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

Unified Diff: remoting/client/desktop_viewport.cc

Issue 2862893003: [CRD iOS] Inject mouse events to the host (Closed)
Patch Set: Resolve Feedback Created 3 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 | « remoting/client/desktop_viewport.h ('k') | remoting/client/direct_input_strategy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/desktop_viewport.cc
diff --git a/remoting/client/desktop_viewport.cc b/remoting/client/desktop_viewport.cc
index f1b3dda978bd0dc1910ea90a3914b3fca7392fad..55cbe5acd3acd0cd594fe5612426e042f72d9bfc 100644
--- a/remoting/client/desktop_viewport.cc
+++ b/remoting/client/desktop_viewport.cc
@@ -54,10 +54,14 @@ void DesktopViewport::ScaleDesktop(float px, float py, float scale) {
UpdateViewport();
}
+void DesktopViewport::MoveViewport(float dx, float dy) {
+ MoveViewportWithoutUpdate(dx, dy);
+ UpdateViewport();
+}
+
void DesktopViewport::SetViewportCenter(float x, float y) {
ViewMatrix::Point old_center = GetViewportCenter();
- MoveViewportCenterWithoutUpdate(x - old_center.x, y - old_center.y);
- UpdateViewport();
+ MoveViewport(x - old_center.x, y - old_center.y);
}
void DesktopViewport::RegisterOnTransformationChangedCallback(
@@ -69,6 +73,10 @@ void DesktopViewport::RegisterOnTransformationChangedCallback(
}
}
+const ViewMatrix& DesktopViewport::GetTransformation() const {
+ return desktop_to_surface_transform_;
+}
+
void DesktopViewport::ResizeToFit() {
DCHECK(IsViewportReady());
@@ -164,8 +172,8 @@ void DesktopViewport::UpdateViewport() {
ViewMatrix::Point old_center = GetViewportCenter();
ViewMatrix::Point new_center =
ConstrainPointToBounds(GetViewportCenterBounds(), old_center);
- MoveViewportCenterWithoutUpdate(new_center.x - old_center.x,
- new_center.y - old_center.y);
+ MoveViewportWithoutUpdate(new_center.x - old_center.x,
+ new_center.y - old_center.y);
if (on_transformation_changed_) {
on_transformation_changed_.Run(desktop_to_surface_transform_);
@@ -209,7 +217,7 @@ ViewMatrix::Point DesktopViewport::GetViewportCenter() const {
{surface_size_.x / 2.f, surface_size_.y / 2.f});
}
-void DesktopViewport::MoveViewportCenterWithoutUpdate(float dx, float dy) {
+void DesktopViewport::MoveViewportWithoutUpdate(float dx, float dy) {
// <dx, dy> is defined on desktop's reference frame. Translation must be
// flipped and scaled.
desktop_to_surface_transform_.PostTranslate(
« no previous file with comments | « remoting/client/desktop_viewport.h ('k') | remoting/client/direct_input_strategy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698