Bug 1066811: Add a SupportsD2D1() method to the Moz2D factory. r=jrmuizel
authorBas Schouten <bschouten@mozilla.com>
Sun, 14 Sep 2014 23:51:26 +0200
changeset 205247 110664783d981577b0507c4f356717bae16a8668
parent 205246 2badc0f1f829a904d740434e03adebf21fc1df12
child 205248 418e2846120f79ba40cf5871d107682b8e20b176
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjrmuizel
bugs1066811
milestone35.0a1
Bug 1066811: Add a SupportsD2D1() method to the Moz2D factory. r=jrmuizel
gfx/2d/2D.h
gfx/2d/Factory.cpp
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -1188,16 +1188,17 @@ public:
                                          SurfaceFormat aFormat);
 
   static void SetDirect3D10Device(ID3D10Device1 *aDevice);
   static ID3D10Device1 *GetDirect3D10Device();
 #ifdef USE_D2D1_1
   static void SetDirect3D11Device(ID3D11Device *aDevice);
   static ID3D11Device *GetDirect3D11Device();
   static ID2D1Device *GetD2D1Device();
+  static bool SupportsD2D1();
 #endif
 
   static TemporaryRef<GlyphRenderingOptions>
     CreateDWriteGlyphRenderingOptions(IDWriteRenderingParams *aParams);
 
   static uint64_t GetD2DVRAMUsageDrawTarget();
   static uint64_t GetD2DVRAMUsageSourceSurface();
   static void D2DCleanup();
--- a/gfx/2d/Factory.cpp
+++ b/gfx/2d/Factory.cpp
@@ -575,16 +575,22 @@ Factory::GetDirect3D11Device()
   return mD3D11Device;
 }
 
 ID2D1Device*
 Factory::GetD2D1Device()
 {
   return mD2D1Device;
 }
+
+bool
+Factory::SupportsD2D1()
+{
+  return !!D2DFactory1();
+}
 #endif
 
 TemporaryRef<GlyphRenderingOptions>
 Factory::CreateDWriteGlyphRenderingOptions(IDWriteRenderingParams *aParams)
 {
   return new GlyphRenderingOptionsDWrite(aParams);
 }