From 833618d53ce959ecf0d6f48ed09cd93332f1463a Mon Sep 17 00:00:00 2001 From: Milan Sreckovic Date: Thu, 18 Feb 2016 14:00:53 -0500 Subject: [PATCH] Bug 1249312: UseAcceleratedCanvas on Mac should really be UseAcceleratedSkiaCanvas. r=mchang --- .../composite/LayerManagerComposite.cpp | 20 ------------------- gfx/layers/composite/LayerManagerComposite.h | 8 -------- gfx/thebes/gfxPlatformMac.cpp | 4 ++-- gfx/thebes/gfxPlatformMac.h | 2 +- 4 files changed, 3 insertions(+), 31 deletions(-) diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index 10a8b738c0b..2420db26d68 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 3ece5e6255c..dccf8ae2daa 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 bb2e84f1f93..98004b6667c 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 198c9b0fb7b..0e45eefdb7a 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;