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

Unified Diff: services/gfx/compositor/graph/transform_pair.h

Issue 1781993002: Mozart: Compute hits using 4x4 matrix. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-10
Patch Set: Created 4 years, 9 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 | « services/gfx/compositor/graph/snapshot.cc ('k') | services/gfx/compositor/graph/transform_pair.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/gfx/compositor/graph/transform_pair.h
diff --git a/services/gfx/compositor/graph/transform_pair.h b/services/gfx/compositor/graph/transform_pair.h
new file mode 100644
index 0000000000000000000000000000000000000000..5cdcb49089ce869a993966ce9e4276b53315a434
--- /dev/null
+++ b/services/gfx/compositor/graph/transform_pair.h
@@ -0,0 +1,36 @@
+// Copyright 2016 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.
+
+#ifndef SERVICES_GFX_COMPOSITOR_GRAPH_TRANSFORM_PAIR_H_
+#define SERVICES_GFX_COMPOSITOR_GRAPH_TRANSFORM_PAIR_H_
+
+#include "third_party/skia/include/utils/SkMatrix44.h"
+
+namespace compositor {
+
+// Contains information about a transformation and its inverse.
+// The inverse is computed lazily and cached.
+class TransformPair {
+ public:
+ TransformPair(const SkMatrix44& forward);
+ ~TransformPair();
+
+ // Gets the forward transformation.
+ const SkMatrix44& forward() const { return forward_; }
+
+ // Gets the inverse transformation.
+ const SkMatrix44& GetInverse() const;
+
+ // Maps a point using the inverse transformation.
+ const SkPoint InverseMapPoint(const SkPoint& point) const;
+
+ private:
+ const SkMatrix44 forward_;
+ mutable SkMatrix44 cached_inverse_;
+ mutable bool cached_inverse_valid_ = false;
+};
+
+} // namespace compositor
+
+#endif // SERVICES_GFX_COMPOSITOR_GRAPH_TRANSFORM_PAIR_H_
« no previous file with comments | « services/gfx/compositor/graph/snapshot.cc ('k') | services/gfx/compositor/graph/transform_pair.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698