Bug 1249312: UseAcceleratedCanvas on Mac should really be UseAcceleratedSkiaCanvas. r=mchang

This commit is contained in:
Milan Sreckovic 2016-02-18 14:00:53 -05:00
parent 2368dd9c31
commit 833618d53c
4 changed files with 3 additions and 31 deletions

View File

@ -1499,26 +1499,6 @@ LayerManagerComposite::AutoAddMaskEffect::~AutoAddMaskEffect()
mCompositable->RemoveMaskEffect();
}
already_AddRefed<DrawTarget>
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())

View File

@ -203,14 +203,6 @@ public:
bool mFailed;
};
/**
* Creates a DrawTarget which is optimized for inter-operating with this
* layermanager.
*/
virtual already_AddRefed<mozilla::gfx::DrawTarget>
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

View File

@ -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

View File

@ -90,7 +90,7 @@ public:
return true;
}
bool UseAcceleratedCanvas();
virtual bool UseAcceleratedSkiaCanvas() override;
virtual bool UseProgressivePaint() override;
virtual already_AddRefed<mozilla::gfx::VsyncSource> CreateHardwareVsyncSource() override;