Bug 1416540 - Avoid unnecessary conversion to doubles in ActiveLayerTracker code. r?mstange
This code was written before the ScaleFactors() function was available on
the float-based gfx::Matrix, which I presume is why it was written to
convert the matrix to the double-based variant and store the scale as
doubles. We don't need to do that any more.
MozReview-Commit-ID: EoWLpny8g61
--- a/layout/painting/ActiveLayerTracker.cpp
+++ b/layout/painting/ActiveLayerTracker.cpp
@@ -90,17 +90,17 @@ public:
// When this property is expired by the layer activity tracker, both mFrame
// and mContent are nulled-out and the property is deleted.
nsIFrame* mFrame;
nsIContent* mContent;
nsExpirationState mState;
// Previous scale due to the CSS transform property.
- Maybe<gfxSize> mPreviousTransformScale;
+ Maybe<Size> mPreviousTransformScale;
// The scroll frame during for which we most recently received a call to
// NotifyAnimatedFromScrollHandler.
WeakFrame mAnimatingScrollHandlerFrame;
// The set of activities that were triggered during
// mAnimatingScrollHandlerFrame's scroll event handler.
EnumSet<ActivityIndex> mScrollHandlerInducedActivity;
@@ -270,17 +270,17 @@ IncrementScaleRestyleCountIfNeeded(nsIFr
Matrix transform2D;
if (!transform.Is2D(&transform2D)) {
// We don't attempt to handle 3D transforms; just assume the scale changed.
aActivity->mPreviousTransformScale = Nothing();
IncrementMutationCount(&aActivity->mRestyleCounts[LayerActivity::ACTIVITY_SCALE]);
return;
}
- gfxSize scale = ThebesMatrix(transform2D).ScaleFactors(true);
+ Size scale = transform2D.ScaleFactors(true);
if (aActivity->mPreviousTransformScale == Some(scale)) {
return; // Nothing changed.
}
aActivity->mPreviousTransformScale = Some(scale);
IncrementMutationCount(&aActivity->mRestyleCounts[LayerActivity::ACTIVITY_SCALE]);
}