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

Side by Side Diff: components/mus/public/cpp/surfaces/surfaces_type_converters.h

Issue 2014233002: Implement cc::SurfaceId StructTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 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 unified diff | Download patch
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « components/mus/public/cpp/surfaces/DEPS ('k') | components/mus/public/cpp/surfaces/surfaces_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698