Bug 556487 - XRenderFormat API for remote X-Surface handling. r=karlt,jmuizelaar a=blocking2.0
authorOleg Romashin <romaxa@gmail.com>
Wed, 08 Sep 2010 08:55:14 -0700
changeset 52190 d510e199203cf329e506df795d111dd0ea534439
parent 52189 c45881749e3f804baa76c0b6bcaba418f6f41d99
child 52191 3056a0e0d97078a10385a0f907dea0ae22f49e9e
push idunknown
push userunknown
push dateunknown
reviewerskarlt, jmuizelaar, blocking2
bugs556487
milestone2.0b6pre
Bug 556487 - XRenderFormat API for remote X-Surface handling. r=karlt,jmuizelaar a=blocking2.0
gfx/thebes/gfxXlibSurface.cpp
gfx/thebes/gfxXlibSurface.h
--- a/gfx/thebes/gfxXlibSurface.cpp
+++ b/gfx/thebes/gfxXlibSurface.cpp
@@ -42,16 +42,17 @@
 #include "cairo-xlib.h"
 #include "cairo-xlib-xrender.h"
 #include <X11/Xlibint.h>	/* For XESetCloseDisplay */
 
 #include "nsTArray.h"
 #include "nsAlgorithm.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIPrefService.h"
+#include "cairo-xlib-xrender.h"
 
 // Although the dimension parameters in the xCreatePixmapReq wire protocol are
 // 16-bit unsigned integers, the server's CreatePixmap returns BadAlloc if
 // either dimension cannot be represented by a 16-bit *signed* integer.
 #define XLIB_IMAGE_SIDE_SIZE_LIMIT 0x7fff
 
 gfxXlibSurface::gfxXlibSurface(Display *dpy, Drawable drawable, Visual *visual)
     : mPixmapTaken(PR_FALSE), mDisplay(dpy), mDrawable(drawable)
@@ -489,8 +490,15 @@ gfxXlibSurface::FindRenderFormat(Display
         case ImageFormatA1:
             return XRenderFindStandardFormat (dpy, PictStandardA1);
         default:
             break;
     }
 
     return (XRenderPictFormat*)NULL;
 }
+
+XRenderPictFormat*
+gfxXlibSurface::XRenderFormat()
+{
+    return cairo_xlib_surface_get_xrender_format(CairoSurface());
+}
+
--- a/gfx/thebes/gfxXlibSurface.h
+++ b/gfx/thebes/gfxXlibSurface.h
@@ -81,16 +81,17 @@ public:
     {
       return TEXT_QUALITY_OK_OVER_OPAQUE_PIXELS;
     }
 
     virtual const gfxIntSize GetSize() const { return mSize; }
 
     Display* XDisplay() { return mDisplay; }
     Drawable XDrawable() { return mDrawable; }
+    XRenderPictFormat* XRenderFormat();
 
     static int DepthOfVisual(const Screen* screen, const Visual* visual);
     static Visual* FindVisual(Screen* screen, gfxImageFormat format);
     static XRenderPictFormat *FindRenderFormat(Display *dpy, gfxImageFormat format);
 
     // take ownership of a passed-in Pixmap, calling XFreePixmap on it
     // when the gfxXlibSurface is destroyed.
     void TakePixmap() {