mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Bug 1039145 - Part 2: Fully remove component alpha/background copying support from BasicCompositor. r=roc
This commit is contained in:
parent
865651f293
commit
e8878fb125
@ -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;
|
||||
|
@ -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>
|
||||
|
@ -537,6 +537,13 @@ ClientLayerManager::IsCompositingCheap()
|
||||
LayerManager::IsCompositingCheap(mForwarder->GetCompositorBackendType());
|
||||
}
|
||||
|
||||
bool
|
||||
ClientLayerManager::AreComponentAlphaLayersEnabled()
|
||||
{
|
||||
return GetCompositorBackendType() != LayersBackend::LAYERS_BASIC &&
|
||||
LayerManager::AreComponentAlphaLayersEnabled();
|
||||
}
|
||||
|
||||
void
|
||||
ClientLayerManager::SetIsFirstPaint()
|
||||
{
|
||||
|
@ -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.
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user