Bug 651192 - Part 3: Add IPC structures for AsyncBitmapModel. r=cjones

This commit is contained in:
Bas Schouten 2012-02-16 04:09:06 +01:00
parent f9c0967db9
commit 4088e13844
2 changed files with 44 additions and 0 deletions

View File

@ -52,6 +52,7 @@ using NPError;
using NPRemoteWindow;
using NPRemoteEvent;
using NPRect;
using NPImageFormat;
using NPNURLVariable;
using NPCoordinateSpace;
using mozilla::plugins::NativeWindowHandle;
@ -59,6 +60,7 @@ using mozilla::gfxSurfaceType;
using gfxIntSize;
using mozilla::null_t;
using mozilla::plugins::WindowsSharedMemoryHandle;
using mozilla::plugins::DXGISharedSurfaceHandle;
using SurfaceDescriptorX11;
using nsIntRect;
using nsTextEvent;
@ -84,6 +86,20 @@ union SurfaceDescriptor {
null_t;
};
union AsyncSurfaceDescriptor {
Shmem;
DXGISharedSurfaceHandle;
};
struct NPRemoteAsyncSurface
{
uint32_t version;
gfxIntSize size;
NPImageFormat format;
uint32_t stride;
AsyncSurfaceDescriptor data;
};
rpc protocol PPluginInstance
{
manager PPluginModule;

View File

@ -142,8 +142,10 @@ typedef intptr_t NativeWindowHandle; // never actually used, will always be 0
#ifdef XP_WIN
typedef base::SharedMemoryHandle WindowsSharedMemoryHandle;
typedef HANDLE DXGISharedSurfaceHandle;
#else
typedef mozilla::null_t WindowsSharedMemoryHandle;
typedef mozilla::null_t DXGISharedSurfaceHandle;
#endif
// XXX maybe not the best place for these. better one?
@ -354,6 +356,32 @@ struct ParamTraits<NPWindowType>
}
};
template <>
struct ParamTraits<NPImageFormat>
{
typedef NPImageFormat paramType;
static void Write(Message* aMsg, const paramType& aParam)
{
aMsg->WriteInt16(int16(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
{
int16 result;
if (aMsg->ReadInt16(aIter, &result)) {
*aResult = paramType(result);
return true;
}
return false;
}
static void Log(const paramType& aParam, std::wstring* aLog)
{
aLog->append(StringPrintf(L"%d", int16(aParam)));
}
};
template <>
struct ParamTraits<mozilla::plugins::NPRemoteWindow>
{