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

Unified Diff: remoting/client/view_matrix.cc

Issue 2879383002: [CRD iOS] Move UI stuff into a subdirectory (Closed)
Patch Set: Fix include 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/view_matrix.h ('k') | remoting/ios/app/host_view_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/view_matrix.cc
diff --git a/remoting/client/view_matrix.cc b/remoting/client/view_matrix.cc
deleted file mode 100644
index 8530cee41d6c31a16e6dce9695053da9f265c756..0000000000000000000000000000000000000000
--- a/remoting/client/view_matrix.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "remoting/client/view_matrix.h"
-
-namespace remoting {
-
-ViewMatrix::ViewMatrix() : ViewMatrix(0.f, {0.f, 0.f}) {}
-
-ViewMatrix::ViewMatrix(float scale, const Vector2D& offset)
- : scale_(scale), offset_(offset) {}
-
-ViewMatrix::~ViewMatrix() {}
-
-ViewMatrix::Point ViewMatrix::MapPoint(const Point& point) const {
- float x = scale_ * point.x + offset_.x;
- float y = scale_ * point.y + offset_.y;
- return {x, y};
-}
-
-ViewMatrix::Vector2D ViewMatrix::MapVector(const Vector2D& vector) const {
- float x = scale_ * vector.x;
- float y = scale_ * vector.y;
- return {x, y};
-}
-
-void ViewMatrix::SetScale(float scale) {
- scale_ = scale;
-}
-
-float ViewMatrix::GetScale() const {
- return scale_;
-}
-
-void ViewMatrix::SetOffset(const Point& offset) {
- offset_ = offset;
-}
-
-void ViewMatrix::PostScale(const Point& pivot, float scale) {
- scale_ *= scale;
- offset_.x *= scale;
- offset_.x += (1.f - scale) * pivot.x;
- offset_.y *= scale;
- offset_.y += (1.f - scale) * pivot.y;
-}
-
-void ViewMatrix::PostTranslate(const Vector2D& delta) {
- offset_.x += delta.x;
- offset_.y += delta.y;
-}
-
-ViewMatrix ViewMatrix::Invert() const {
- return ViewMatrix(1.f / scale_, {-offset_.x / scale_, -offset_.y / scale_});
-}
-
-std::array<float, 9> ViewMatrix::ToMatrixArray() const {
- return {{scale_, 0, offset_.x, // Row 1
- 0, scale_, offset_.y, // Row 2
- 0, 0, 1}};
-}
-
-bool ViewMatrix::IsEmpty() const {
- return scale_ == 0.f && offset_.x == 0.f && offset_.y == 0.f;
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/client/view_matrix.h ('k') | remoting/ios/app/host_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698