1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 #ifndef IPC_ShadowLayerUtils_h
8 #define IPC_ShadowLayerUtils_h
9 
10 #include "ipc/EnumSerializer.h"
11 #include "ipc/IPCMessageUtils.h"
12 #include "GLContextTypes.h"
13 #include "SurfaceDescriptor.h"
14 #include "SurfaceTypes.h"
15 #include "mozilla/WidgetUtils.h"
16 
17 #if defined(MOZ_X11)
18 #  include "mozilla/layers/ShadowLayerUtilsX11.h"
19 #endif
20 
21 namespace IPC {
22 
23 #if !defined(MOZ_HAVE_SURFACEDESCRIPTORX11)
24 template <>
25 struct ParamTraits<mozilla::layers::SurfaceDescriptorX11> {
26   typedef mozilla::layers::SurfaceDescriptorX11 paramType;
27   static void Write(Message*, const paramType&) {}
28   static bool Read(const Message*, PickleIterator*, paramType*) {
29     return false;
30   }
31 };
32 #endif  // !defined(MOZ_HAVE_XSURFACEDESCRIPTORX11)
33 
34 template <>
35 struct ParamTraits<mozilla::ScreenRotation>
36     : public ContiguousEnumSerializer<mozilla::ScreenRotation,
37                                       mozilla::ROTATION_0,
38                                       mozilla::ROTATION_COUNT> {};
39 
40 }  // namespace IPC
41 
42 #endif  // IPC_ShadowLayerUtils_h
43