Bug 740580 - Make GetShmInfoPtr() a static method on the gfxSharedImageSurface class. r=Bas

This commit is contained in:
George Wright 2012-10-02 22:09:12 -04:00
Родитель 49b77e79e5
Коммит 7ac726b395
2 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -14,14 +14,8 @@ using namespace mozilla::ipc;
static const cairo_user_data_key_t SHM_KEY = {0};
struct SharedImageInfo {
int32_t width;
int32_t height;
int32_t format;
};
static SharedImageInfo*
GetShmInfoPtr(const Shmem& aShmem)
/*static*/ SharedImageInfo*
gfxSharedImageSurface::GetShmInfoPtr(const Shmem& aShmem)
{
return reinterpret_cast<SharedImageInfo*>
(aShmem.get<char>() + aShmem.Size<char>() - sizeof(SharedImageInfo));

Просмотреть файл

@ -13,6 +13,12 @@
#include "gfxASurface.h"
#include "gfxImageSurface.h"
struct SharedImageInfo {
PRInt32 width;
PRInt32 height;
PRInt32 format;
};
class THEBES_API gfxSharedImageSurface : public gfxImageSurface {
typedef mozilla::ipc::SharedMemory SharedMemory;
typedef mozilla::ipc::Shmem Shmem;
@ -62,6 +68,8 @@ public:
static bool IsSharedImage(gfxASurface *aSurface);
static SharedImageInfo* GetShmInfoPtr(const Shmem& aShmem);
private:
gfxSharedImageSurface(const gfxIntSize&, gfxImageFormat, const Shmem&);