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

Unified Diff: mojo/skia/type_converters.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 | « no previous file | mojo/skia/type_converters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/skia/type_converters.h
diff --git a/mojo/skia/type_converters.h b/mojo/skia/type_converters.h
index 1532f13334ac26ffc9ad5c1215f75eed04b14682..e2972fe07ec6227e587cff578b341dccf8f35dea 100644
--- a/mojo/skia/type_converters.h
+++ b/mojo/skia/type_converters.h
@@ -10,6 +10,7 @@
#include "third_party/skia/include/core/SkPoint.h"
#include "third_party/skia/include/core/SkRRect.h"
#include "third_party/skia/include/core/SkRect.h"
+#include "third_party/skia/include/utils/SkMatrix44.h"
namespace mojo {
@@ -59,7 +60,7 @@ struct TypeConverter<mojo::RRectF, SkRRect> {
};
// Note: This transformation is lossy since Transform is 4x4 whereas
-// SkMatrix is only 3x3.
+// SkMatrix is only 3x3 so we drop the 3rd row and column.
template <>
struct TypeConverter<SkMatrix, mojo::TransformPtr> {
static SkMatrix Convert(const mojo::TransformPtr& input);
@@ -69,6 +70,16 @@ struct TypeConverter<mojo::TransformPtr, SkMatrix> {
static mojo::TransformPtr Convert(const SkMatrix& input);
};
+// Note: This transformation is lossless.
+template <>
+struct TypeConverter<SkMatrix44, mojo::TransformPtr> {
+ static SkMatrix44 Convert(const mojo::TransformPtr& input);
+};
+template <>
+struct TypeConverter<mojo::TransformPtr, SkMatrix44> {
+ static mojo::TransformPtr Convert(const SkMatrix44& input);
+};
+
} // namespace mojo
#endif // MOJO_SKIA_TYPE_CONVERTERS_H_
« no previous file with comments | « no previous file | mojo/skia/type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698