Bug 687373 - Provide mozilla::layers::SurfaceDescriptorX11 non xlib surface ctor. r=cjones
authorOleg Romashin <romaxa@gmail.com>
Tue, 20 Sep 2011 17:20:51 +0100
changeset 77203 969aaa109a23e2f9a0fe3a4efa0642f67d938d88
parent 77202 ebbc50bbebeb2b3142efd9fbde0d0be0666008f9
child 77204 89d8b2add33ff2e51a17cea95cecce66e18bf6a1
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewerscjones
bugs687373
milestone9.0a1
Bug 687373 - Provide mozilla::layers::SurfaceDescriptorX11 non xlib surface ctor. r=cjones
gfx/layers/ipc/ShadowLayerUtilsX11.cpp
gfx/layers/ipc/ShadowLayerUtilsX11.h
--- a/gfx/layers/ipc/ShadowLayerUtilsX11.cpp
+++ b/gfx/layers/ipc/ShadowLayerUtilsX11.cpp
@@ -80,16 +80,22 @@ TakeAndDestroyXlibSurface(SurfaceDescrip
 }
 
 SurfaceDescriptorX11::SurfaceDescriptorX11(gfxXlibSurface* aSurf)
   : mId(aSurf->XDrawable())
   , mSize(aSurf->GetSize())
   , mFormat(aSurf->XRenderFormat()->id)
 { }
 
+SurfaceDescriptorX11::SurfaceDescriptorX11(const int aXid, const int aXrenderPictID, const gfxIntSize& aSize)
+  : mId(aXid)
+  , mSize(aSize)
+  , mFormat(aXrenderPictID)
+{ }
+
 already_AddRefed<gfxXlibSurface>
 SurfaceDescriptorX11::OpenForeign() const
 {
   Display* display = DefaultXDisplay();
   Screen* screen = DefaultScreenOfDisplay(display);
 
   XRenderPictFormat* format = GetXRenderPictFormatFromId(display, mFormat);
   nsRefPtr<gfxXlibSurface> surf =
--- a/gfx/layers/ipc/ShadowLayerUtilsX11.h
+++ b/gfx/layers/ipc/ShadowLayerUtilsX11.h
@@ -55,16 +55,18 @@ namespace mozilla {
 namespace layers {
 
 struct SurfaceDescriptorX11 {
   SurfaceDescriptorX11()
   { }
 
   SurfaceDescriptorX11(gfxXlibSurface* aSurf);
 
+  SurfaceDescriptorX11(const int aXid, const int aXrenderPictID, const gfxIntSize& aSize);
+
   // Default copy ctor and operator= are OK
 
   bool operator==(const SurfaceDescriptorX11& aOther) const {
     // Define == as two descriptors having the same XID for now,
     // ignoring size and render format.  If the two indeed refer to
     // the same valid XID, then size/format are "actually" the same
     // anyway, regardless of the values of the fields in
     // SurfaceDescriptorX11.