diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index 10a8b738c0b4..2420db26d68d 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -1499,26 +1499,6 @@ LayerManagerComposite::AutoAddMaskEffect::~AutoAddMaskEffect() mCompositable->RemoveMaskEffect(); } -already_AddRefed -LayerManagerComposite::CreateDrawTarget(const IntSize &aSize, - SurfaceFormat aFormat) -{ -#ifdef XP_MACOSX - // We don't want to accelerate if the surface is too small which indicates - // that it's likely used for an icon/static image. We also don't want to - // accelerate anything that is above the maximum texture size of weakest gpu. - // Safari uses 5000 area as the minimum for acceleration, we decided 64^2 is more logical. - bool useAcceleration = aSize.width <= 4096 && aSize.height <= 4096 && - aSize.width > 64 && aSize.height > 64 && - gfxPlatformMac::GetPlatform()->UseAcceleratedCanvas(); - if (useAcceleration) { - return Factory::CreateDrawTarget(BackendType::COREGRAPHICS_ACCELERATED, - aSize, aFormat); - } -#endif - return LayerManager::CreateDrawTarget(aSize, aFormat); -} - LayerComposite::LayerComposite(LayerManagerComposite *aManager) : mCompositeManager(aManager) , mCompositor(aManager->GetCompositor()) diff --git a/gfx/layers/composite/LayerManagerComposite.h b/gfx/layers/composite/LayerManagerComposite.h index 3ece5e6255c4..dccf8ae2daa5 100644 --- a/gfx/layers/composite/LayerManagerComposite.h +++ b/gfx/layers/composite/LayerManagerComposite.h @@ -203,14 +203,6 @@ public: bool mFailed; }; - /** - * Creates a DrawTarget which is optimized for inter-operating with this - * layermanager. - */ - virtual already_AddRefed - CreateDrawTarget(const mozilla::gfx::IntSize& aSize, - mozilla::gfx::SurfaceFormat aFormat) override; - /** * Calculates the 'completeness' of the rendering that intersected with the * screen on the last render. This is only useful when progressive tile diff --git a/gfx/thebes/gfxPlatformMac.cpp b/gfx/thebes/gfxPlatformMac.cpp index bb2e84f1f938..98004b6667c9 100644 --- a/gfx/thebes/gfxPlatformMac.cpp +++ b/gfx/thebes/gfxPlatformMac.cpp @@ -427,10 +427,10 @@ gfxPlatformMac::ReadAntiAliasingThreshold() } bool -gfxPlatformMac::UseAcceleratedCanvas() +gfxPlatformMac::UseAcceleratedSkiaCanvas() { // Lion or later is required - return nsCocoaFeatures::OnLionOrLater() && Preferences::GetBool("gfx.canvas.azure.accelerated", false); + return nsCocoaFeatures::OnLionOrLater() && gfxPlatform::UseAcceleratedSkiaCanvas(); } bool diff --git a/gfx/thebes/gfxPlatformMac.h b/gfx/thebes/gfxPlatformMac.h index 198c9b0fb7b5..0e45eefdb7af 100644 --- a/gfx/thebes/gfxPlatformMac.h +++ b/gfx/thebes/gfxPlatformMac.h @@ -90,7 +90,7 @@ public: return true; } - bool UseAcceleratedCanvas(); + virtual bool UseAcceleratedSkiaCanvas() override; virtual bool UseProgressivePaint() override; virtual already_AddRefed CreateHardwareVsyncSource() override;