Bug 1118328 - Part 1: Expose DoesBackendSupportDataDrawTarget function to test backend capabilities. r=jrmuizel

This commit is contained in:
Bas Schouten 2015-01-07 22:58:20 +01:00
parent 0cf53b165b
commit e0d4cad40e
2 changed files with 19 additions and 0 deletions

View File

@ -1181,6 +1181,8 @@ public:
*/ */
static TemporaryRef<DrawTarget> CreateTiledDrawTarget(const TileSet& aTileSet); static TemporaryRef<DrawTarget> CreateTiledDrawTarget(const TileSet& aTileSet);
static bool DoesBackendSupportDataDrawtarget(BackendType aType);
#ifdef XP_MACOSX #ifdef XP_MACOSX
static TemporaryRef<DrawTarget> CreateDrawTargetForCairoCGContext(CGContextRef cg, const IntSize& aSize); static TemporaryRef<DrawTarget> CreateDrawTargetForCairoCGContext(CGContextRef cg, const IntSize& aSize);
static TemporaryRef<GlyphRenderingOptions> static TemporaryRef<GlyphRenderingOptions>

View File

@ -430,6 +430,23 @@ Factory::CreateTiledDrawTarget(const TileSet& aTileSet)
return dt.forget(); return dt.forget();
} }
bool
Factory::DoesBackendSupportDataDrawtarget(BackendType aType)
{
switch (aType) {
case BackendType::DIRECT2D:
case BackendType::DIRECT2D1_1:
case BackendType::RECORDING:
case BackendType::NONE:
case BackendType::COREGRAPHICS_ACCELERATED:
return false;
case BackendType::CAIRO:
case BackendType::COREGRAPHICS:
case BackendType::SKIA:
return true;
}
}
TemporaryRef<ScaledFont> TemporaryRef<ScaledFont>
Factory::CreateScaledFontForNativeFont(const NativeFont &aNativeFont, Float aSize) Factory::CreateScaledFontForNativeFont(const NativeFont &aNativeFont, Float aSize)
{ {