зеркало из https://github.com/mozilla/gecko-dev.git
Bug 582467. With accelerated layer backends, we should always treat video layers as active to avoid having to read back; no point in saving composition costs on those backends anyway. r=vlad
This commit is contained in:
Родитель
5286b29597
Коммит
24fd5553c9
|
@ -64,6 +64,7 @@
|
|||
#include "nsIAccessibilityService.h"
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::layers;
|
||||
|
||||
nsIFrame*
|
||||
|
@ -379,10 +380,19 @@ public:
|
|||
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
|
||||
LayerManager* aManager)
|
||||
{
|
||||
if (aManager->GetBackendType() != LayerManager::LAYERS_BASIC) {
|
||||
// For non-basic layer managers we can assume that compositing
|
||||
// layers is very cheap, and since ImageLayers don't require
|
||||
// additional memory of the video frames we have to have anyway,
|
||||
// we can't save much by making layers inactive. Also, for many
|
||||
// accelerated layer managers calling
|
||||
// imageContainer->GetCurrentAsSurface can be very expensive. So
|
||||
// just always be active for these managers.
|
||||
return LAYER_ACTIVE;
|
||||
}
|
||||
nsHTMLMediaElement* elem =
|
||||
static_cast<nsHTMLMediaElement*>(mFrame->GetContent());
|
||||
return elem->IsPotentiallyPlaying() ? mozilla::LAYER_ACTIVE :
|
||||
mozilla::LAYER_INACTIVE;
|
||||
return elem->IsPotentiallyPlaying() ? LAYER_ACTIVE : LAYER_INACTIVE;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче