OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_SURFACES_SURFACES_TYPE_CONVERTERS_H_ | 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_SURFACES_SURFACES_TYPE_CONVERTERS_H_ |
6 #define COMPONENTS_MUS_PUBLIC_CPP_SURFACES_SURFACES_TYPE_CONVERTERS_H_ | 6 #define COMPONENTS_MUS_PUBLIC_CPP_SURFACES_SURFACES_TYPE_CONVERTERS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
| 10 #include "cc/ipc/surface_id.mojom.h" |
10 #include "cc/resources/returned_resource.h" | 11 #include "cc/resources/returned_resource.h" |
11 #include "cc/resources/transferable_resource.h" | 12 #include "cc/resources/transferable_resource.h" |
12 #include "cc/surfaces/surface_id.h" | 13 #include "cc/surfaces/surface_id.h" |
13 #include "components/mus/public/cpp/surfaces/mojo_surfaces_export.h" | 14 #include "components/mus/public/cpp/surfaces/mojo_surfaces_export.h" |
14 #include "components/mus/public/interfaces/compositor_frame.mojom.h" | 15 #include "components/mus/public/interfaces/compositor_frame.mojom.h" |
15 #include "components/mus/public/interfaces/quads.mojom.h" | 16 #include "components/mus/public/interfaces/quads.mojom.h" |
16 #include "components/mus/public/interfaces/surface_id.mojom.h" | |
17 #include "gpu/command_buffer/common/mailbox.h" | 17 #include "gpu/command_buffer/common/mailbox.h" |
18 #include "gpu/command_buffer/common/mailbox_holder.h" | 18 #include "gpu/command_buffer/common/mailbox_holder.h" |
19 #include "gpu/command_buffer/common/sync_token.h" | 19 #include "gpu/command_buffer/common/sync_token.h" |
20 #include "third_party/skia/include/core/SkColor.h" | 20 #include "third_party/skia/include/core/SkColor.h" |
21 | 21 |
22 namespace cc { | 22 namespace cc { |
23 class CompositorFrame; | 23 class CompositorFrame; |
24 class CompositorFrameMetadata; | 24 class CompositorFrameMetadata; |
25 class DrawQuad; | 25 class DrawQuad; |
26 class RenderPass; | 26 class RenderPass; |
27 class RenderPassId; | 27 class RenderPassId; |
28 class SharedQuadState; | 28 class SharedQuadState; |
29 } // namespace cc | 29 } // namespace cc |
30 | 30 |
31 namespace mojo { | 31 namespace mojo { |
32 | 32 |
33 class CustomSurfaceConverter; | 33 class CustomSurfaceConverter; |
34 | 34 |
35 // Types from surface_id.mojom | |
36 template <> | |
37 struct MOJO_SURFACES_EXPORT | |
38 TypeConverter<mus::mojom::SurfaceIdPtr, cc::SurfaceId> { | |
39 static mus::mojom::SurfaceIdPtr Convert(const cc::SurfaceId& input); | |
40 }; | |
41 template <> | |
42 struct MOJO_SURFACES_EXPORT | |
43 TypeConverter<cc::SurfaceId, mus::mojom::SurfaceIdPtr> { | |
44 static cc::SurfaceId Convert(const mus::mojom::SurfaceIdPtr& input); | |
45 }; | |
46 | |
47 // Types from quads.mojom | 35 // Types from quads.mojom |
48 template <> | 36 template <> |
49 struct MOJO_SURFACES_EXPORT TypeConverter<mus::mojom::ColorPtr, SkColor> { | 37 struct MOJO_SURFACES_EXPORT TypeConverter<mus::mojom::ColorPtr, SkColor> { |
50 static mus::mojom::ColorPtr Convert(const SkColor& input); | 38 static mus::mojom::ColorPtr Convert(const SkColor& input); |
51 }; | 39 }; |
52 template <> | 40 template <> |
53 struct MOJO_SURFACES_EXPORT TypeConverter<SkColor, mus::mojom::ColorPtr> { | 41 struct MOJO_SURFACES_EXPORT TypeConverter<SkColor, mus::mojom::ColorPtr> { |
54 static SkColor Convert(const mus::mojom::ColorPtr& input); | 42 static SkColor Convert(const mus::mojom::ColorPtr& input); |
55 }; | 43 }; |
56 | 44 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 template <> | 139 template <> |
152 struct MOJO_SURFACES_EXPORT TypeConverter<std::unique_ptr<cc::CompositorFrame>, | 140 struct MOJO_SURFACES_EXPORT TypeConverter<std::unique_ptr<cc::CompositorFrame>, |
153 mus::mojom::CompositorFramePtr> { | 141 mus::mojom::CompositorFramePtr> { |
154 static std::unique_ptr<cc::CompositorFrame> Convert( | 142 static std::unique_ptr<cc::CompositorFrame> Convert( |
155 const mus::mojom::CompositorFramePtr& input); | 143 const mus::mojom::CompositorFramePtr& input); |
156 }; | 144 }; |
157 | 145 |
158 } // namespace mojo | 146 } // namespace mojo |
159 | 147 |
160 #endif // COMPONENTS_MUS_PUBLIC_CPP_SURFACES_SURFACES_TYPE_CONVERTERS_H_ | 148 #endif // COMPONENTS_MUS_PUBLIC_CPP_SURFACES_SURFACES_TYPE_CONVERTERS_H_ |
OLD | NEW |