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

Side by Side Diff: mojo/skia/type_converters.h

Issue 1534033002: Improve Ganesh helpers. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-8
Patch Set: rebase Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « mojo/skia/gl_bindings_skia.cc ('k') | mojo/skia/type_converters.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MOJO_SKIA_TYPE_CONVERTERS_H_
6 #define MOJO_SKIA_TYPE_CONVERTERS_H_
7
8 #include "mojo/services/geometry/interfaces/geometry.mojom.h"
9 #include "third_party/skia/include/core/SkMatrix.h"
10 #include "third_party/skia/include/core/SkPoint.h"
11 #include "third_party/skia/include/core/SkRRect.h"
12 #include "third_party/skia/include/core/SkRect.h"
13
14 namespace mojo {
15
16 template <>
17 struct TypeConverter<SkPoint, mojo::Point> {
18 static SkPoint Convert(const mojo::Point& input);
19 };
20 template <>
21 struct TypeConverter<mojo::Point, SkPoint> {
22 static mojo::Point Convert(const SkPoint& input);
23 };
24
25 template <>
26 struct TypeConverter<SkRect, mojo::Rect> {
27 static SkRect Convert(const mojo::Rect& input);
28 };
29 template <>
30 struct TypeConverter<mojo::Rect, SkRect> {
31 static mojo::Rect Convert(const SkRect& input);
32 };
33
34 template <>
35 struct TypeConverter<SkRRect, mojo::RRect> {
36 static SkRRect Convert(const mojo::RRect& input);
37 };
38 template <>
39 struct TypeConverter<mojo::RRect, SkRRect> {
40 static mojo::RRect Convert(const SkRRect& input);
41 };
42
43 // Note: This transformation is lossy since Transform is 4x4 whereas
44 // SkMatrix is only 3x3.
45 template <>
46 struct TypeConverter<SkMatrix, mojo::TransformPtr> {
47 static SkMatrix Convert(const mojo::TransformPtr& input);
48 };
49 template <>
50 struct TypeConverter<mojo::TransformPtr, SkMatrix> {
51 static mojo::TransformPtr Convert(const SkMatrix& input);
52 };
53
54 } // namespace mojo
55
56 #endif // MOJO_SKIA_TYPE_CONVERTERS_H_
OLDNEW
« no previous file with comments | « mojo/skia/gl_bindings_skia.cc ('k') | mojo/skia/type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698