michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * vim: sw=2 ts=8 et : michael@0: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_layers_FenceUtilsGonk_h michael@0: #define mozilla_layers_FenceUtilsGonk_h michael@0: michael@0: #include michael@0: #include michael@0: michael@0: #include "ipc/IPCMessageUtils.h" michael@0: michael@0: namespace mozilla { michael@0: namespace layers { michael@0: michael@0: struct FenceHandle { michael@0: typedef android::Fence Fence; michael@0: michael@0: FenceHandle() michael@0: { } michael@0: FenceHandle(const android::sp& aFence); michael@0: michael@0: bool operator==(const FenceHandle& aOther) const { michael@0: return mFence.get() == aOther.mFence.get(); michael@0: } michael@0: michael@0: bool IsValid() const michael@0: { michael@0: return mFence.get() && mFence->isValid(); michael@0: } michael@0: michael@0: android::sp mFence; michael@0: }; michael@0: michael@0: } // namespace layers michael@0: } // namespace mozilla michael@0: michael@0: namespace IPC { michael@0: michael@0: template <> michael@0: struct ParamTraits { michael@0: typedef mozilla::layers::FenceHandle paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam); michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult); michael@0: }; michael@0: michael@0: } // namespace IPC michael@0: michael@0: #endif // mozilla_layers_FenceUtilsGonk_h