зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1043426: Avoid doing work for empty visible regions. r=mattwoodrow
This commit is contained in:
Родитель
6d6d53e7b8
Коммит
4b72634bdc
|
@ -1013,7 +1013,7 @@ ContainerLayer::DefaultComputeEffectiveTransforms(const Matrix4x4& aTransformToS
|
|||
}
|
||||
}
|
||||
|
||||
mUseIntermediateSurface = useIntermediateSurface;
|
||||
mUseIntermediateSurface = useIntermediateSurface && !GetEffectiveVisibleRegion().IsEmpty();
|
||||
if (useIntermediateSurface) {
|
||||
ComputeEffectiveTransformsForChildren(Matrix4x4::From2D(residual));
|
||||
} else {
|
||||
|
|
|
@ -401,6 +401,7 @@ RenderLayers(ContainerT* aContainer,
|
|||
for (size_t i = 0u; i < aContainer->mPrepared->mLayers.Length(); i++) {
|
||||
PreparedLayer& preparedData = aContainer->mPrepared->mLayers[i];
|
||||
LayerComposite* layerToRender = preparedData.mLayer;
|
||||
|
||||
nsIntRect clipRect = preparedData.mClipRect;
|
||||
if (layerToRender->HasLayerBeenComposited()) {
|
||||
// Composer2D will compose this layer so skip GPU composition
|
||||
|
@ -502,6 +503,11 @@ ContainerRender(ContainerT* aContainer,
|
|||
LayerManagerComposite* aManager,
|
||||
const nsIntRect& aClipRect)
|
||||
{
|
||||
nsIntRect visibleRect = aContainer->GetEffectiveVisibleRegion().GetBounds();
|
||||
if (visibleRect.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(aContainer->mPrepared);
|
||||
if (aContainer->UseIntermediateSurface()) {
|
||||
RefPtr<CompositingRenderTarget> surface;
|
||||
|
@ -516,7 +522,6 @@ ContainerRender(ContainerT* aContainer,
|
|||
|
||||
float opacity = aContainer->GetEffectiveOpacity();
|
||||
|
||||
nsIntRect visibleRect = aContainer->GetEffectiveVisibleRegion().GetBounds();
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
if (gfxUtils::sDumpPainting) {
|
||||
RefPtr<gfx::DataSourceSurface> surf = surface->Dump(aManager->GetCompositor());
|
||||
|
|
|
@ -108,6 +108,12 @@ ThebesLayerComposite::GetRenderState()
|
|||
void
|
||||
ThebesLayerComposite::RenderLayer(const nsIntRect& aClipRect)
|
||||
{
|
||||
const nsIntRegion& visibleRegion = GetEffectiveVisibleRegion();
|
||||
|
||||
if (visibleRegion.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mBuffer || !mBuffer->IsAttached()) {
|
||||
return;
|
||||
}
|
||||
|
@ -133,8 +139,6 @@ ThebesLayerComposite::RenderLayer(const nsIntRect& aClipRect)
|
|||
LayerManagerComposite::AutoAddMaskEffect autoMaskEffect(mMaskLayer, effectChain);
|
||||
AddBlendModeEffect(effectChain);
|
||||
|
||||
const nsIntRegion& visibleRegion = GetEffectiveVisibleRegion();
|
||||
|
||||
TiledLayerProperties tiledLayerProps;
|
||||
if (mRequiresTiledProperties) {
|
||||
tiledLayerProps.mVisibleRegion = visibleRegion;
|
||||
|
|
Загрузка…
Ссылка в новой задаче