зеркало из https://github.com/mozilla/gecko-dev.git
Bug 785657 - Enable async animations in content processes r=cjones
This commit is contained in:
Родитель
18258768e4
Коммит
b20ba33014
|
@ -33,6 +33,7 @@ EXPORTS = \
|
|||
BasicImplData.h \
|
||||
GonkIOSurfaceImage.h \
|
||||
FrameMetrics.h \
|
||||
CompositorChild.h \
|
||||
CompositorParent.h \
|
||||
ImageContainer.h \
|
||||
ImageLayers.h \
|
||||
|
|
|
@ -35,6 +35,7 @@ public:
|
|||
|
||||
static PCompositorChild* Get();
|
||||
|
||||
static bool ChildProcessHasCompositor() { return sCompositor != nullptr; }
|
||||
protected:
|
||||
virtual PLayersChild* AllocPLayers(const LayersBackend& aBackendHint,
|
||||
const uint64_t& aId,
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define FORCE_PR_LOG /* Allow logging in the release build */
|
||||
#endif
|
||||
|
||||
#include "mozilla/layers/CompositorChild.h"
|
||||
#include "mozilla/layers/CompositorParent.h"
|
||||
#include "mozilla/layers/ImageBridgeChild.h"
|
||||
|
||||
|
@ -1232,6 +1233,14 @@ gfxPlatform::UseAzureContentDrawing()
|
|||
return sAzureContentDrawingEnabled;
|
||||
}
|
||||
|
||||
bool
|
||||
gfxPlatform::OffMainThreadCompositingEnabled()
|
||||
{
|
||||
return XRE_GetProcessType() == GeckoProcessType_Default ?
|
||||
CompositorParent::CompositorLoop() != nullptr :
|
||||
CompositorChild::ChildProcessHasCompositor();
|
||||
}
|
||||
|
||||
eCMSMode
|
||||
gfxPlatform::GetCMSMode()
|
||||
{
|
||||
|
|
|
@ -378,7 +378,9 @@ public:
|
|||
|
||||
// helper method to indicate if we want to use Azure content drawing
|
||||
static bool UseAzureContentDrawing();
|
||||
|
||||
|
||||
static bool OffMainThreadCompositingEnabled();
|
||||
|
||||
/**
|
||||
* Are we going to try color management?
|
||||
*/
|
||||
|
|
|
@ -3393,7 +3393,8 @@ nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBui
|
|||
message.AppendLiteral(", ");
|
||||
message.AppendInt(nsPresContext::AppUnitsToIntCSSPixels(refSize.height));
|
||||
message.AppendLiteral(")");
|
||||
CommonElementAnimationData::LogAsyncAnimationFailure(message);
|
||||
CommonElementAnimationData::LogAsyncAnimationFailure(message,
|
||||
aFrame->GetContent());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -71,7 +71,6 @@
|
|||
#include "nsTextFrame.h"
|
||||
#include "nsFontFaceList.h"
|
||||
#include "nsFontInflationData.h"
|
||||
#include "CompositorParent.h"
|
||||
#include "nsSVGUtils.h"
|
||||
#include "nsSVGIntegrationUtils.h"
|
||||
#include "nsSVGForeignObjectFrame.h"
|
||||
|
@ -172,7 +171,8 @@ nsLayoutUtils::AreOpacityAnimationsEnabled()
|
|||
"layers.offmainthreadcomposition.animate-opacity");
|
||||
}
|
||||
|
||||
return sAreOpacityAnimationsEnabled && CompositorParent::CompositorLoop();
|
||||
return sAreOpacityAnimationsEnabled &&
|
||||
gfxPlatform::OffMainThreadCompositingEnabled();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -187,7 +187,8 @@ nsLayoutUtils::AreTransformAnimationsEnabled()
|
|||
"layers.offmainthreadcomposition.animate-transform");
|
||||
}
|
||||
|
||||
return sAreTransformAnimationsEnabled && CompositorParent::CompositorLoop();
|
||||
return sAreTransformAnimationsEnabled &&
|
||||
gfxPlatform::OffMainThreadCompositingEnabled();
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "CompositorParent.h"
|
||||
#include "gfxPlatform.h"
|
||||
#include "AnimationCommon.h"
|
||||
#include "nsRuleData.h"
|
||||
#include "nsCSSValue.h"
|
||||
|
@ -239,7 +239,7 @@ CommonElementAnimationData::CanAnimatePropertyOnCompositor(const dom::Element *a
|
|||
bool aHasGeometricProperties)
|
||||
{
|
||||
bool shouldLog = nsLayoutUtils::IsAnimationLoggingEnabled();
|
||||
if (shouldLog && !layers::CompositorParent::CompositorLoop()) {
|
||||
if (shouldLog && !gfxPlatform::OffMainThreadCompositingEnabled()) {
|
||||
nsCString message;
|
||||
message.AppendLiteral("Performance warning: Compositor disabled");
|
||||
LogAsyncAnimationFailure(message);
|
||||
|
|
Загрузка…
Ссылка в новой задаче