| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // |
| 5 // IPC Messages sent between compositor instances. |
| 4 | 6 |
| 5 #ifndef UI_GFX_IPC_GEOMETRY_GFX_PARAM_TRAITS_H_ | 7 #ifndef CC_IPC_CC_PARAM_TRAITS_H_ |
| 6 #define UI_GFX_IPC_GEOMETRY_GFX_PARAM_TRAITS_H_ | 8 #define CC_IPC_CC_PARAM_TRAITS_H_ |
| 7 | 9 |
| 8 #include <string> | 10 #include "cc/ipc/cc_ipc_export.h" |
| 9 | 11 #include "cc/ipc/cc_param_traits_macros.h" |
| 10 #include "ipc/ipc_message_utils.h" | 12 #include "cc/output/compositor_frame.h" |
| 11 #include "ipc/param_traits_macros.h" | 13 #include "cc/output/compositor_frame_ack.h" |
| 12 #include "ui/gfx/ipc/geometry/gfx_ipc_geometry_export.h" | 14 #include "cc/output/filter_operation.h" |
| 15 #include "cc/output/viewport_selection_bound.h" |
| 16 #include "cc/quads/draw_quad.h" |
| 17 #include "cc/quads/stream_video_draw_quad.h" |
| 18 #include "cc/quads/texture_draw_quad.h" |
| 19 #include "gpu/ipc/common/gpu_command_buffer_traits.h" |
| 20 #include "ipc/ipc_message_macros.h" |
| 13 | 21 |
| 14 namespace gfx { | 22 namespace gfx { |
| 15 class Point; | 23 class Transform; |
| 16 class PointF; | 24 } |
| 17 class Point3F; | 25 |
| 18 class Rect; | 26 namespace cc { |
| 19 class RectF; | 27 class FilterOperations; |
| 20 class ScrollOffset; | 28 } |
| 21 class Size; | |
| 22 class SizeF; | |
| 23 class Vector2d; | |
| 24 class Vector2dF; | |
| 25 } // namespace gfx | |
| 26 | 29 |
| 27 namespace IPC { | 30 namespace IPC { |
| 28 | 31 |
| 29 template <> | 32 template <> |
| 30 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Point> { | 33 struct ParamTraits<cc::FilterOperation> { |
| 31 typedef gfx::Point param_type; | 34 typedef cc::FilterOperation param_type; |
| 32 static void GetSize(base::PickleSizer* s, const param_type& p); | 35 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 33 static void Write(base::Pickle* m, const param_type& p); | 36 static void Write(base::Pickle* m, const param_type& p); |
| 34 static bool Read(const base::Pickle* m, | 37 static bool Read(const base::Pickle* m, |
| 35 base::PickleIterator* iter, | 38 base::PickleIterator* iter, |
| 36 param_type* r); | 39 param_type* r); |
| 37 static void Log(const param_type& p, std::string* l); | 40 static void Log(const param_type& p, std::string* l); |
| 38 }; | 41 }; |
| 39 | 42 |
| 40 template <> | 43 template <> |
| 41 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::PointF> { | 44 struct ParamTraits<cc::FilterOperations> { |
| 42 typedef gfx::PointF param_type; | 45 typedef cc::FilterOperations param_type; |
| 43 static void GetSize(base::PickleSizer* s, const param_type& p); | 46 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 44 static void Write(base::Pickle* m, const param_type& p); | 47 static void Write(base::Pickle* m, const param_type& p); |
| 45 static bool Read(const base::Pickle* m, | 48 static bool Read(const base::Pickle* m, |
| 46 base::PickleIterator* iter, | 49 base::PickleIterator* iter, |
| 47 param_type* r); | 50 param_type* r); |
| 48 static void Log(const param_type& p, std::string* l); | 51 static void Log(const param_type& p, std::string* l); |
| 49 }; | 52 }; |
| 50 | 53 |
| 51 template <> | 54 template <> |
| 52 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Point3F> { | 55 struct ParamTraits<sk_sp<SkImageFilter>> { |
| 53 typedef gfx::Point3F param_type; | 56 typedef sk_sp<SkImageFilter> param_type; |
| 54 static void GetSize(base::PickleSizer* s, const param_type& p); | 57 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 55 static void Write(base::Pickle* m, const param_type& p); | 58 static void Write(base::Pickle* m, const param_type& p); |
| 56 static bool Read(const base::Pickle* m, | 59 static bool Read(const base::Pickle* m, |
| 57 base::PickleIterator* iter, | 60 base::PickleIterator* iter, |
| 58 param_type* r); | 61 param_type* r); |
| 59 static void Log(const param_type& p, std::string* l); | 62 static void Log(const param_type& p, std::string* l); |
| 60 }; | 63 }; |
| 61 | 64 |
| 62 template <> | 65 template <> |
| 63 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Size> { | 66 struct CC_IPC_EXPORT ParamTraits<cc::RenderPass> { |
| 64 typedef gfx::Size param_type; | 67 typedef cc::RenderPass param_type; |
| 65 static void GetSize(base::PickleSizer* s, const param_type& p); | |
| 66 static void Write(base::Pickle* m, const param_type& p); | 68 static void Write(base::Pickle* m, const param_type& p); |
| 67 static bool Read(const base::Pickle* m, | 69 static bool Read(const base::Pickle* m, |
| 68 base::PickleIterator* iter, | 70 base::PickleIterator* iter, |
| 69 param_type* r); | 71 param_type* r); |
| 70 static void Log(const param_type& p, std::string* l); | 72 static void Log(const param_type& p, std::string* l); |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 template <> | 75 template <> |
| 74 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::SizeF> { | 76 struct CC_IPC_EXPORT ParamTraits<cc::CompositorFrame> { |
| 75 typedef gfx::SizeF param_type; | 77 typedef cc::CompositorFrame param_type; |
| 78 static void Write(base::Pickle* m, const param_type& p); |
| 79 static bool Read(const base::Pickle* m, |
| 80 base::PickleIterator* iter, |
| 81 param_type* p); |
| 82 static void Log(const param_type& p, std::string* l); |
| 83 }; |
| 84 |
| 85 template <> |
| 86 struct CC_IPC_EXPORT ParamTraits<cc::CompositorFrameAck> { |
| 87 typedef cc::CompositorFrameAck param_type; |
| 88 static void Write(base::Pickle* m, const param_type& p); |
| 89 static bool Read(const base::Pickle* m, |
| 90 base::PickleIterator* iter, |
| 91 param_type* p); |
| 92 static void Log(const param_type& p, std::string* l); |
| 93 }; |
| 94 |
| 95 template <> |
| 96 struct CC_IPC_EXPORT ParamTraits<cc::DelegatedFrameData> { |
| 97 typedef cc::DelegatedFrameData param_type; |
| 98 static void Write(base::Pickle* m, const param_type& p); |
| 99 static bool Read(const base::Pickle* m, |
| 100 base::PickleIterator* iter, |
| 101 param_type* p); |
| 102 static void Log(const param_type& p, std::string* l); |
| 103 }; |
| 104 |
| 105 template <> |
| 106 struct CC_IPC_EXPORT ParamTraits<cc::DrawQuad::Resources> { |
| 107 typedef cc::DrawQuad::Resources param_type; |
| 76 static void GetSize(base::PickleSizer* s, const param_type& p); | 108 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 77 static void Write(base::Pickle* m, const param_type& p); | 109 static void Write(base::Pickle* m, const param_type& p); |
| 78 static bool Read(const base::Pickle* m, | 110 static bool Read(const base::Pickle* m, |
| 79 base::PickleIterator* iter, | 111 base::PickleIterator* iter, |
| 80 param_type* r); | 112 param_type* p); |
| 81 static void Log(const param_type& p, std::string* l); | 113 static void Log(const param_type& p, std::string* l); |
| 82 }; | 114 }; |
| 83 | 115 |
| 84 template <> | 116 template <> |
| 85 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Vector2d> { | 117 struct CC_IPC_EXPORT ParamTraits<cc::StreamVideoDrawQuad::OverlayResources> { |
| 86 typedef gfx::Vector2d param_type; | 118 typedef cc::StreamVideoDrawQuad::OverlayResources param_type; |
| 87 static void GetSize(base::PickleSizer* s, const param_type& p); | 119 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 88 static void Write(base::Pickle* m, const param_type& p); | 120 static void Write(base::Pickle* m, const param_type& p); |
| 89 static bool Read(const base::Pickle* m, | 121 static bool Read(const base::Pickle* m, |
| 90 base::PickleIterator* iter, | 122 base::PickleIterator* iter, |
| 91 param_type* r); | 123 param_type* p); |
| 92 static void Log(const param_type& p, std::string* l); | 124 static void Log(const param_type& p, std::string* l); |
| 93 }; | 125 }; |
| 94 | 126 |
| 95 template <> | 127 template <> |
| 96 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Vector2dF> { | 128 struct CC_IPC_EXPORT ParamTraits<cc::TextureDrawQuad::OverlayResources> { |
| 97 typedef gfx::Vector2dF param_type; | 129 typedef cc::TextureDrawQuad::OverlayResources param_type; |
| 98 static void GetSize(base::PickleSizer* s, const param_type& p); | 130 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 99 static void Write(base::Pickle* m, const param_type& p); | 131 static void Write(base::Pickle* m, const param_type& p); |
| 100 static bool Read(const base::Pickle* m, | 132 static bool Read(const base::Pickle* m, |
| 101 base::PickleIterator* iter, | 133 base::PickleIterator* iter, |
| 102 param_type* r); | 134 param_type* p); |
| 103 static void Log(const param_type& p, std::string* l); | |
| 104 }; | |
| 105 | |
| 106 template <> | |
| 107 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Rect> { | |
| 108 typedef gfx::Rect param_type; | |
| 109 static void GetSize(base::PickleSizer* s, const param_type& p); | |
| 110 static void Write(base::Pickle* m, const param_type& p); | |
| 111 static bool Read(const base::Pickle* m, | |
| 112 base::PickleIterator* iter, | |
| 113 param_type* r); | |
| 114 static void Log(const param_type& p, std::string* l); | |
| 115 }; | |
| 116 | |
| 117 template <> | |
| 118 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::RectF> { | |
| 119 typedef gfx::RectF param_type; | |
| 120 static void GetSize(base::PickleSizer* s, const param_type& p); | |
| 121 static void Write(base::Pickle* m, const param_type& p); | |
| 122 static bool Read(const base::Pickle* m, | |
| 123 base::PickleIterator* iter, | |
| 124 param_type* r); | |
| 125 static void Log(const param_type& p, std::string* l); | |
| 126 }; | |
| 127 | |
| 128 template <> | |
| 129 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::ScrollOffset> { | |
| 130 typedef gfx::ScrollOffset param_type; | |
| 131 static void GetSize(base::PickleSizer* s, const param_type& p); | |
| 132 static void Write(base::Pickle* m, const param_type& p); | |
| 133 static bool Read(const base::Pickle* m, | |
| 134 base::PickleIterator* iter, | |
| 135 param_type* r); | |
| 136 static void Log(const param_type& p, std::string* l); | 135 static void Log(const param_type& p, std::string* l); |
| 137 }; | 136 }; |
| 138 | 137 |
| 139 } // namespace IPC | 138 } // namespace IPC |
| 140 | 139 |
| 141 #endif // UI_GFX_IPC_GEOMETRY_GFX_PARAM_TRAITS_H_ | 140 #endif // CC_IPC_CC_PARAM_TRAITS_H_ |
| OLD | NEW |