b=682625 share code for layers::SurfaceDescriptorX11 with plugins r=cjones

--HG--
extra : transplant_source : %82%82%9C-s%8A%E2J%DC%7E%0A%DF%FDyO%FB0q%3C%23
This commit is contained in:
Karl Tomlinson 2012-01-10 23:54:35 +13:00
parent 132cd0add8
commit 024acaf887
4 changed files with 6 additions and 22 deletions

View File

@ -59,6 +59,7 @@ using mozilla::gfxSurfaceType;
using gfxIntSize;
using mozilla::null_t;
using mozilla::plugins::WindowsSharedMemoryHandle;
using SurfaceDescriptorX11;
using nsIntRect;
using nsTextEvent;
using nsKeyEvent;
@ -66,12 +67,6 @@ using nsKeyEvent;
namespace mozilla {
namespace plugins {
struct SurfaceDescriptorX11 {
int XID;
int xrenderPictID;
gfxIntSize size;
};
struct IOSurfaceDescriptor {
uint32_t surfaceId;
};

View File

@ -3446,14 +3446,7 @@ PluginInstanceChild::RecvUpdateBackground(const SurfaceDescriptor& aBackground,
switch (aBackground.type()) {
#ifdef MOZ_X11
case SurfaceDescriptor::TSurfaceDescriptorX11: {
SurfaceDescriptorX11 xdesc = aBackground.get_SurfaceDescriptorX11();
XRenderPictFormat pf;
pf.id = xdesc.xrenderPictID();
XRenderPictFormat *incFormat =
XRenderFindFormat(DefaultXDisplay(), PictFormatID, &pf, 0);
mBackground =
new gfxXlibSurface(DefaultScreenOfDisplay(DefaultXDisplay()),
xdesc.XID(), incFormat, xdesc.size());
mBackground = aBackground.get_SurfaceDescriptorX11().OpenForeign();
break;
}
#endif

View File

@ -535,14 +535,7 @@ PluginInstanceParent::RecvShow(const NPRect& updatedRect,
#endif
#ifdef MOZ_X11
else if (newSurface.type() == SurfaceDescriptor::TSurfaceDescriptorX11) {
SurfaceDescriptorX11 xdesc = newSurface.get_SurfaceDescriptorX11();
XRenderPictFormat pf;
pf.id = xdesc.xrenderPictID();
XRenderPictFormat *incFormat =
XRenderFindFormat(DefaultXDisplay(), PictFormatID, &pf, 0);
surface =
new gfxXlibSurface(DefaultScreenOfDisplay(DefaultXDisplay()),
xdesc.XID(), incFormat, xdesc.size());
surface = newSurface.get_SurfaceDescriptorX11().OpenForeign();
}
#endif
#ifdef XP_WIN

View File

@ -43,6 +43,7 @@
#include "base/message_loop.h"
#include "mozilla/ipc/RPCChannel.h"
#include "gfxipc/ShadowLayerUtils.h"
#include "npapi.h"
#include "npruntime.h"
@ -66,6 +67,8 @@ using mac_plugin_interposing::NSCursorInfo;
namespace mozilla {
namespace plugins {
using layers::SurfaceDescriptorX11;
enum ScriptableObjectType
{
LocalObject,