Bug 1039145 - Part 2: Fully remove component alpha/background copying support from BasicCompositor. r=roc

This commit is contained in:
Matt Woodrow 2014-07-18 18:48:23 +12:00
parent 865651f293
commit e8878fb125
6 changed files with 21 additions and 20 deletions

View File

@ -465,10 +465,8 @@ RotatedContentBuffer::BeginPaint(ThebesLayer* aLayer,
#else
if (!aLayer->GetParent() ||
!aLayer->GetParent()->SupportsComponentAlphaChildren() ||
!aLayer->Manager()->IsCompositingCheap() ||
!aLayer->AsShadowableLayer() ||
!aLayer->AsShadowableLayer()->HasShadow() ||
!gfxPrefs::ComponentAlphaEnabled()) {
!aLayer->AsShadowableLayer()->HasShadow()) {
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
} else {
result.mContentType = gfxContentType::COLOR;

View File

@ -97,23 +97,8 @@ BasicCompositor::CreateRenderTargetFromSource(const IntRect &aRect,
const CompositingRenderTarget *aSource,
const IntPoint &aSourcePoint)
{
RefPtr<DrawTarget> target = mDrawTarget->CreateSimilarDrawTarget(aRect.Size(), SurfaceFormat::B8G8R8A8);
RefPtr<BasicCompositingRenderTarget> rt = new BasicCompositingRenderTarget(target, aRect);
DrawTarget *source;
if (aSource) {
const BasicCompositingRenderTarget* sourceSurface =
static_cast<const BasicCompositingRenderTarget*>(aSource);
source = sourceSurface->mDrawTarget;
} else {
source = mDrawTarget;
}
RefPtr<SourceSurface> snapshot = source->Snapshot();
IntRect sourceRect(aSourcePoint, aRect.Size());
rt->mDrawTarget->CopySurface(snapshot, sourceRect, IntPoint(0, 0));
return rt.forget();
MOZ_CRASH("Shouldn't be called!");
return nullptr;
}
TemporaryRef<DataTextureSource>

View File

@ -537,6 +537,13 @@ ClientLayerManager::IsCompositingCheap()
LayerManager::IsCompositingCheap(mForwarder->GetCompositorBackendType());
}
bool
ClientLayerManager::AreComponentAlphaLayersEnabled()
{
return GetCompositorBackendType() != LayersBackend::LAYERS_BASIC &&
LayerManager::AreComponentAlphaLayersEnabled();
}
void
ClientLayerManager::SetIsFirstPaint()
{

View File

@ -188,6 +188,8 @@ public:
return (GetTextureFactoryIdentifier().mSupportedBlendModes & aMixBlendModes) == aMixBlendModes;
}
virtual bool AreComponentAlphaLayersEnabled() MOZ_OVERRIDE;
// Log APZ test data for the current paint. We supply the paint sequence
// number ourselves, and take care of calling APZTestData::StartNewPaint()
// when a new paint is started.

View File

@ -144,6 +144,13 @@ LayerManagerComposite::UpdateRenderBounds(const nsIntRect& aRect)
mRenderBounds = aRect;
}
bool
LayerManagerComposite::AreComponentAlphaLayersEnabled()
{
return Compositor::GetBackend() != LayersBackend::LAYERS_BASIC &&
LayerManager::AreComponentAlphaLayersEnabled();
}
void
LayerManagerComposite::BeginTransaction()
{

View File

@ -152,6 +152,8 @@ public:
MOZ_CRASH("Shouldn't be called for composited layer manager");
}
virtual bool AreComponentAlphaLayersEnabled() MOZ_OVERRIDE;
virtual TemporaryRef<DrawTarget>
CreateOptimalMaskDrawTarget(const IntSize &aSize) MOZ_OVERRIDE;