diff --git a/gfx/layers/LayerSorter.cpp b/gfx/layers/LayerSorter.cpp index e9f945d59c7..213413df366 100644 --- a/gfx/layers/LayerSorter.cpp +++ b/gfx/layers/LayerSorter.cpp @@ -80,10 +80,8 @@ static LayerSortOrder CompareDepth(Layer* aOne, Layer* aTwo) { gfxRect ourRect = aOne->GetEffectiveVisibleRegion().GetBounds(); gfxRect otherRect = aTwo->GetEffectiveVisibleRegion().GetBounds(); - gfx3DMatrix ourTransform; - To3DMatrix(aOne->GetTransform(), ourTransform); - gfx3DMatrix otherTransform; - To3DMatrix(aTwo->GetTransform(), otherTransform); + gfx3DMatrix ourTransform = To3DMatrix(aOne->GetTransform()); + gfx3DMatrix otherTransform = To3DMatrix(aTwo->GetTransform()); // Transform both rectangles and project into 2d space. gfxQuad ourTransformedRect = ourTransform.TransformRect(ourRect); diff --git a/gfx/layers/LayerTreeInvalidation.cpp b/gfx/layers/LayerTreeInvalidation.cpp index 50832d35907..dc58cbcb237 100644 --- a/gfx/layers/LayerTreeInvalidation.cpp +++ b/gfx/layers/LayerTreeInvalidation.cpp @@ -114,7 +114,7 @@ struct LayerPropertiesBase : public LayerProperties if (mUseClipRect) { mClipRect = *aLayer->GetClipRect(); } - gfx::To3DMatrix(aLayer->GetTransform(), mTransform); + mTransform = gfx::To3DMatrix(aLayer->GetTransform()); } LayerPropertiesBase() : mLayer(nullptr) @@ -136,8 +136,7 @@ struct LayerPropertiesBase : public LayerProperties nsIntRegion ComputeChange(NotifySubDocInvalidationFunc aCallback, bool& aGeometryChanged) { - gfx3DMatrix transform; - gfx::To3DMatrix(mLayer->GetTransform(), transform); + gfx3DMatrix transform = gfx::To3DMatrix(mLayer->GetTransform()); bool transformChanged = !mTransform.FuzzyEqual(transform) || mLayer->GetPostXScale() != mPostXScale || mLayer->GetPostYScale() != mPostYScale; @@ -185,9 +184,8 @@ struct LayerPropertiesBase : public LayerProperties nsIntRect NewTransformedBounds() { - gfx3DMatrix transform; - gfx::To3DMatrix(mLayer->GetTransform(), transform); - return TransformRect(mLayer->GetVisibleRegion().GetBounds(), transform); + return TransformRect(mLayer->GetVisibleRegion().GetBounds(), + gfx::To3DMatrix(mLayer->GetTransform())); } nsIntRect OldTransformedBounds() @@ -294,9 +292,8 @@ struct ContainerLayerProperties : public LayerPropertiesBase } if (invalidateChildsCurrentArea) { aGeometryChanged = true; - gfx3DMatrix transform; - gfx::To3DMatrix(child->GetTransform(), transform); - AddTransformedRegion(result, child->GetVisibleRegion(), transform); + AddTransformedRegion(result, child->GetVisibleRegion(), + gfx::To3DMatrix(child->GetTransform())); if (aCallback) { NotifySubdocumentInvalidationRecursive(child, aCallback); } else { @@ -315,9 +312,7 @@ struct ContainerLayerProperties : public LayerPropertiesBase aCallback(container, result); } - gfx3DMatrix transform; - gfx::To3DMatrix(mLayer->GetTransform(), transform); - result.Transform(transform); + result.Transform(gfx::To3DMatrix(mLayer->GetTransform())); return result; } @@ -447,8 +442,7 @@ LayerPropertiesBase::ComputeDifferences(Layer* aRoot, NotifySubDocInvalidationFu } else { ClearInvalidations(aRoot); } - gfx3DMatrix transform; - gfx::To3DMatrix(aRoot->GetTransform(), transform); + gfx3DMatrix transform = gfx::To3DMatrix(aRoot->GetTransform()); nsIntRect result = TransformRect(aRoot->GetVisibleRegion().GetBounds(), transform); result = result.Union(OldTransformedBounds()); if (aGeometryChanged != nullptr) { diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index 3fc43664f83..c0607a1ed9b 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -244,8 +244,7 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor, * metrics.mDevPixelsPerCSSPixel * metrics.GetParentResolution()); } - gfx3DMatrix transform; - gfx::To3DMatrix(aLayer->GetTransform(), transform); + gfx3DMatrix transform = gfx::To3DMatrix(aLayer->GetTransform()); apzc->SetLayerHitTestData(visible, aTransform, transform); APZCTM_LOG("Setting rect(%f %f %f %f) as visible region for APZC %p\n", visible.x, visible.y, @@ -312,9 +311,7 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor, aTransform = gfx3DMatrix(); } else { // Multiply child layer transforms on the left so they get applied first - gfx3DMatrix matrix; - gfx::To3DMatrix(aLayer->GetTransform(), matrix); - aTransform = matrix * aTransform; + aTransform = gfx::To3DMatrix(aLayer->GetTransform()) * aTransform; } uint64_t childLayersId = (aLayer->AsRefLayer() ? aLayer->AsRefLayer()->GetReferentId() : aLayersId); diff --git a/gfx/layers/basic/BasicCompositor.cpp b/gfx/layers/basic/BasicCompositor.cpp index 2836ee05244..0ac0ddfdbb7 100644 --- a/gfx/layers/basic/BasicCompositor.cpp +++ b/gfx/layers/basic/BasicCompositor.cpp @@ -262,7 +262,7 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect, dest->SetTransform(destTransform); // Get the bounds post-transform. - To3DMatrix(aTransform, new3DTransform); + new3DTransform = To3DMatrix(aTransform); gfxRect bounds = new3DTransform.TransformBounds(ThebesRect(aRect)); bounds.IntersectRect(bounds, gfxRect(offset.x, offset.y, buffer->GetSize().width, buffer->GetSize().height)); diff --git a/gfx/layers/basic/BasicLayerManager.cpp b/gfx/layers/basic/BasicLayerManager.cpp index 69aa8891df5..abd258c8e12 100644 --- a/gfx/layers/basic/BasicLayerManager.cpp +++ b/gfx/layers/basic/BasicLayerManager.cpp @@ -897,8 +897,7 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget, temp->Paint(); } #endif - gfx3DMatrix effectiveTransform; - gfx::To3DMatrix(aLayer->GetEffectiveTransform(), effectiveTransform); + gfx3DMatrix effectiveTransform = gfx::To3DMatrix(aLayer->GetEffectiveTransform()); nsRefPtr result = Transform3D(untransformedDT->Snapshot(), aTarget, bounds, effectiveTransform, destRect); diff --git a/gfx/layers/client/ClientTiledThebesLayer.cpp b/gfx/layers/client/ClientTiledThebesLayer.cpp index a800526e755..190b9518d5a 100644 --- a/gfx/layers/client/ClientTiledThebesLayer.cpp +++ b/gfx/layers/client/ClientTiledThebesLayer.cpp @@ -77,9 +77,7 @@ GetTransformToAncestorsParentLayer(Layer* aStart, Layer* aAncestor) } transform = transform * iter->GetTransform(); } - gfx3DMatrix ret; - gfx::To3DMatrix(transform, ret); - return ret; + return gfx::To3DMatrix(transform); } void diff --git a/gfx/layers/client/TiledContentClient.cpp b/gfx/layers/client/TiledContentClient.cpp index 9d0130fca0a..9f3067eb391 100644 --- a/gfx/layers/client/TiledContentClient.cpp +++ b/gfx/layers/client/TiledContentClient.cpp @@ -1081,8 +1081,7 @@ GetCompositorSideCompositionBounds(ContainerLayer* aScrollAncestor, aScrollAncestor->GetFrameMetrics().mResolution.scale, 1.f); - gfx3DMatrix layerTransform; - gfx::To3DMatrix(aScrollAncestor->GetTransform(), layerTransform); + gfx3DMatrix layerTransform = gfx::To3DMatrix(aScrollAncestor->GetTransform()); // First take off the last two "terms" of aTransformToCompBounds, which // are the scroll ancestor's local transform and the APZ's nontransient async diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index 6a74dcb8c1d..3b663286c24 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -405,9 +405,7 @@ SampleValue(float aPortion, Animation& aAnimation, StyleAnimationValue& aStart, transform.Translate(scaledOrigin); InfallibleTArray functions; - Matrix4x4 realTransform; - ToMatrix4x4(transform, realTransform); - functions.AppendElement(TransformMatrix(realTransform)); + functions.AppendElement(TransformMatrix(ToMatrix4x4(transform))); *aValue = functions; } @@ -513,10 +511,7 @@ SampleAnimations(Layer* aLayer, TimeStamp aPoint) Matrix4x4 CombineWithCSSTransform(const gfx3DMatrix& treeTransform, Layer* aLayer) { - Matrix4x4 result; - ToMatrix4x4(treeTransform, result); - result = result * aLayer->GetTransform(); - return result; + return ToMatrix4x4(treeTransform) * aLayer->GetTransform(); } bool @@ -701,9 +696,7 @@ ApplyAsyncTransformToScrollbarForContent(TimeStamp aCurrentFrame, ContainerLayer // the content. This is needed because otherwise that transient async transform is // part of the effective transform of this scrollbar, and the scrollbar will jitter // as the content scrolls. - Matrix4x4 targetUntransform; - ToMatrix4x4(transientTransform.Inverse(), targetUntransform); - transform = transform * targetUntransform; + transform = transform * ToMatrix4x4(transientTransform.Inverse()); } // GetTransform already takes the pre- and post-scale into account. Since we @@ -771,8 +764,7 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer) const FrameMetrics& metrics = container->GetFrameMetrics(); // We must apply the resolution scale before a pan/zoom transform, so we call // GetTransform here. - gfx3DMatrix currentTransform; - To3DMatrix(aLayer->GetTransform(), currentTransform); + gfx3DMatrix currentTransform = To3DMatrix(aLayer->GetTransform()); Matrix4x4 oldTransform = aLayer->GetTransform(); gfx3DMatrix treeTransform; @@ -849,9 +841,7 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer) computedTransform.ScalePost(1.0f/container->GetPostXScale(), 1.0f/container->GetPostYScale(), 1); - Matrix4x4 matrix; - ToMatrix4x4(computedTransform, matrix); - layerComposite->SetShadowTransform(matrix); + layerComposite->SetShadowTransform(ToMatrix4x4(computedTransform)); NS_ASSERTION(!layerComposite->GetShadowTransformSetByAnimation(), "overwriting animated transform!"); diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index cb1fa164123..b1f3afffe8f 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -587,7 +587,7 @@ LayerManagerComposite::ComputeRenderIntegrityInternal(Layer* aLayer, // Accumulate the transform of intermediate surfaces gfx3DMatrix transform = aTransform; if (container->UseIntermediateSurface()) { - gfx::To3DMatrix(aLayer->GetEffectiveTransform(), transform); + transform = gfx::To3DMatrix(aLayer->GetEffectiveTransform()); transform.PreMultiply(aTransform); } for (Layer* child = aLayer->GetFirstChild(); child; @@ -609,8 +609,7 @@ LayerManagerComposite::ComputeRenderIntegrityInternal(Layer* aLayer, if (!incompleteRegion.IsEmpty()) { // Calculate the transform to get between screen and layer space - gfx3DMatrix transformToScreen; - To3DMatrix(aLayer->GetEffectiveTransform(), transformToScreen); + gfx3DMatrix transformToScreen = To3DMatrix(aLayer->GetEffectiveTransform()); transformToScreen.PreMultiply(aTransform); SubtractTransformedRegion(aScreenRegion, incompleteRegion, transformToScreen); @@ -689,8 +688,7 @@ LayerManagerComposite::ComputeRenderIntegrity() // This is derived from the code in // AsyncCompositionManager::TransformScrollableLayer const FrameMetrics& metrics = primaryScrollable->AsContainerLayer()->GetFrameMetrics(); - gfx3DMatrix transform; - gfx::To3DMatrix(primaryScrollable->GetEffectiveTransform(), transform); + gfx3DMatrix transform = gfx::To3DMatrix(primaryScrollable->GetEffectiveTransform()); transform.ScalePost(metrics.mResolution.scale, metrics.mResolution.scale, 1); // Clip the screen rect to the document bounds diff --git a/gfx/layers/ipc/LayerTransactionParent.cpp b/gfx/layers/ipc/LayerTransactionParent.cpp index 53228295bc5..e00373b7df9 100644 --- a/gfx/layers/ipc/LayerTransactionParent.cpp +++ b/gfx/layers/ipc/LayerTransactionParent.cpp @@ -629,8 +629,7 @@ LayerTransactionParent::RecvGetAnimationTransform(PLayerParent* aParent, // from the shadow transform by undoing the translations in // AsyncCompositionManager::SampleValue. - gfx3DMatrix transform; - gfx::To3DMatrix(layer->AsLayerComposite()->GetShadowTransform(), transform); + gfx3DMatrix transform = gfx::To3DMatrix(layer->AsLayerComposite()->GetShadowTransform()); if (ContainerLayer* c = layer->AsContainerLayer()) { // Undo the scale transform applied by AsyncCompositionManager::SampleValue transform.ScalePost(1.0f/c->GetInheritedXScale(), diff --git a/gfx/tests/gtest/TestLayers.cpp b/gfx/tests/gtest/TestLayers.cpp index 0857d8ccea5..6f3ffaf6743 100644 --- a/gfx/tests/gtest/TestLayers.cpp +++ b/gfx/tests/gtest/TestLayers.cpp @@ -194,9 +194,7 @@ already_AddRefed CreateLayerTree( layer->SetVisibleRegion(aVisibleRegions[layerNumber]); } if (aTransforms) { - Matrix4x4 transform; - ToMatrix4x4(aTransforms[layerNumber], transform); - layer->SetBaseTransform(transform); + layer->SetBaseTransform(ToMatrix4x4(aTransforms[layerNumber])); } aLayersOut.AppendElement(layer); layerNumber++; diff --git a/gfx/thebes/gfx2DGlue.h b/gfx/thebes/gfx2DGlue.h index 42a3ddf2f34..7750e0d3d0f 100644 --- a/gfx/thebes/gfx2DGlue.h +++ b/gfx/thebes/gfx2DGlue.h @@ -376,46 +376,50 @@ inline gfxContext::GraphicsOperator ThebesOp(CompositionOp aOp) } } -inline void -ToMatrix4x4(const gfx3DMatrix& aIn, Matrix4x4& aOut) +inline Matrix4x4 +ToMatrix4x4(const gfx3DMatrix& aIn) { - aOut._11 = aIn._11; - aOut._12 = aIn._12; - aOut._13 = aIn._13; - aOut._14 = aIn._14; - aOut._21 = aIn._21; - aOut._22 = aIn._22; - aOut._23 = aIn._23; - aOut._24 = aIn._24; - aOut._31 = aIn._31; - aOut._32 = aIn._32; - aOut._33 = aIn._33; - aOut._34 = aIn._34; - aOut._41 = aIn._41; - aOut._42 = aIn._42; - aOut._43 = aIn._43; - aOut._44 = aIn._44; + Matrix4x4 m; + m._11 = aIn._11; + m._12 = aIn._12; + m._13 = aIn._13; + m._14 = aIn._14; + m._21 = aIn._21; + m._22 = aIn._22; + m._23 = aIn._23; + m._24 = aIn._24; + m._31 = aIn._31; + m._32 = aIn._32; + m._33 = aIn._33; + m._34 = aIn._34; + m._41 = aIn._41; + m._42 = aIn._42; + m._43 = aIn._43; + m._44 = aIn._44; + return m; } -inline void -To3DMatrix(const Matrix4x4& aIn, gfx3DMatrix& aOut) +inline gfx3DMatrix +To3DMatrix(const Matrix4x4& aIn) { - aOut._11 = aIn._11; - aOut._12 = aIn._12; - aOut._13 = aIn._13; - aOut._14 = aIn._14; - aOut._21 = aIn._21; - aOut._22 = aIn._22; - aOut._23 = aIn._23; - aOut._24 = aIn._24; - aOut._31 = aIn._31; - aOut._32 = aIn._32; - aOut._33 = aIn._33; - aOut._34 = aIn._34; - aOut._41 = aIn._41; - aOut._42 = aIn._42; - aOut._43 = aIn._43; - aOut._44 = aIn._44; + gfx3DMatrix m; + m._11 = aIn._11; + m._12 = aIn._12; + m._13 = aIn._13; + m._14 = aIn._14; + m._21 = aIn._21; + m._22 = aIn._22; + m._23 = aIn._23; + m._24 = aIn._24; + m._31 = aIn._31; + m._32 = aIn._32; + m._33 = aIn._33; + m._34 = aIn._34; + m._41 = aIn._41; + m._42 = aIn._42; + m._43 = aIn._43; + m._44 = aIn._44; + return m; } } diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 0b8e50b5013..26b9ef9ba0a 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -1711,8 +1711,7 @@ static void SetOuterVisibleRegion(Layer* aLayer, nsIntRegion* aOuterVisibleRegion, const nsIntRect* aLayerContentsVisibleRect = nullptr) { - gfx3DMatrix transform; - To3DMatrix(aLayer->GetTransform(), transform); + gfx3DMatrix transform = To3DMatrix(aLayer->GetTransform()); gfxMatrix transform2D; if (transform.Is2D(&transform2D) && !transform2D.HasNonIntegerTranslation()) { aOuterVisibleRegion->MoveBy(-int(transform2D._31), -int(transform2D._32)); @@ -3647,9 +3646,7 @@ ChooseScaleAndSetTransform(FrameLayerBuilder* aLayerBuilder, } // Store the inverse of our resolution-scale on the layer - Matrix4x4 baseTransform; - ToMatrix4x4(transform, baseTransform); - aLayer->SetBaseTransform(baseTransform); + aLayer->SetBaseTransform(ToMatrix4x4(transform)); aLayer->SetPreScale(1.0f/float(scale.width), 1.0f/float(scale.height)); aLayer->SetInheritedScale(aIncomingScale.mXScale, diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 58b5912f8ce..ca6867da8e5 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -284,9 +284,7 @@ static void AddTransformFunctions(nsCSSValueList* aList, aPresContext, canStoreInRuleTree, aBounds); - gfx::Matrix4x4 transform; - gfx::ToMatrix4x4(matrix, transform); - aFunctions.AppendElement(TransformMatrix(transform)); + aFunctions.AppendElement(TransformMatrix(gfx::ToMatrix4x4(matrix))); break; } case eCSSKeyword_perspective: @@ -5151,10 +5149,8 @@ bool nsDisplayTransform::UntransformVisibleRect(nsDisplayListBuilder* aBuilder, void nsDisplayTransform::WriteDebugInfo(nsACString& aTo) { - gfx::Matrix4x4 transform; - gfx::ToMatrix4x4(GetTransform(), transform); std::stringstream ss; - AppendToString(ss, transform); + AppendToString(ss, gfx::ToMatrix4x4(GetTransform())); aTo += ss.str().c_str(); } #endif diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 003448fff35..f1bc17d8fa8 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -4975,9 +4975,7 @@ nsIFrame::TryUpdateTransformOnly(Layer** aLayerResult) !gfx::FuzzyEqual(transform._12, previousTransform._12, kError)) { return false; } - gfx::Matrix4x4 matrix; - gfx::ToMatrix4x4(transform3d, matrix); - layer->SetBaseTransformForNextTransaction(matrix); + layer->SetBaseTransformForNextTransaction(gfx::ToMatrix4x4(transform3d)); *aLayerResult = layer; return true; } diff --git a/layout/ipc/RenderFrameParent.cpp b/layout/ipc/RenderFrameParent.cpp index aad641feac4..850684272b5 100644 --- a/layout/ipc/RenderFrameParent.cpp +++ b/layout/ipc/RenderFrameParent.cpp @@ -228,9 +228,7 @@ BuildListForLayer(Layer* aLayer, gfx3DMatrix applyTransform = ComputeShadowTreeTransform( aSubdocFrame, aRootFrameLoader, metrics, view->GetViewConfig(), 1 / GetXScale(aTransform), 1 / GetYScale(aTransform)); - gfx3DMatrix layerTransform; - To3DMatrix(aLayer->GetTransform(), layerTransform); - transform = applyTransform * layerTransform * aTransform; + transform = applyTransform * To3DMatrix(aLayer->GetTransform()) * aTransform; // As mentioned above, bounds calculation also depends on the scale // of this layer. @@ -249,9 +247,7 @@ BuildListForLayer(Layer* aLayer, new (aBuilder) nsDisplayRemoteShadow(aBuilder, aSubdocFrame, bounds, scrollId)); } else { - gfx3DMatrix layerTransform; - To3DMatrix(aLayer->GetTransform(), layerTransform); - transform = layerTransform * aTransform; + transform = To3DMatrix(aLayer->GetTransform()) * aTransform; } for (Layer* child = aLayer->GetFirstChild(); child; @@ -276,8 +272,7 @@ TransformShadowTree(nsDisplayListBuilder* aBuilder, nsFrameLoader* aFrameLoader, const FrameMetrics* metrics = GetFrameMetrics(aLayer); - gfx3DMatrix shadowTransform; - To3DMatrix(aLayer->GetTransform(), shadowTransform); + gfx3DMatrix shadowTransform = To3DMatrix(aLayer->GetTransform()); ViewTransform layerTransform = aTransform; if (metrics && metrics->IsScrollable()) { @@ -285,8 +280,7 @@ TransformShadowTree(nsDisplayListBuilder* aBuilder, nsFrameLoader* aFrameLoader, const nsContentView* view = aFrameLoader->GetCurrentRemoteFrame()->GetContentView(scrollId); NS_ABORT_IF_FALSE(view, "Array of views should be consistent with layer tree"); - gfx3DMatrix currentTransform; - To3DMatrix(aLayer->GetTransform(), currentTransform); + gfx3DMatrix currentTransform = To3DMatrix(aLayer->GetTransform()); const ViewConfig& config = view->GetViewConfig(); // With temporary scale we should compensate translation @@ -338,9 +332,7 @@ TransformShadowTree(nsDisplayListBuilder* aBuilder, nsFrameLoader* aFrameLoader, 1.0f/aLayer->GetPostYScale(), 1); - gfx::Matrix4x4 realShadowTransform; - ToMatrix4x4(shadowTransform, realShadowTransform); - shadow->SetShadowTransform(realShadowTransform); + shadow->SetShadowTransform(gfx::ToMatrix4x4(shadowTransform)); for (Layer* child = aLayer->GetFirstChild(); child; child = child->GetNextSibling()) { TransformShadowTree(aBuilder, aFrameLoader, aFrame, child, layerTransform, @@ -384,8 +376,7 @@ BuildViewMap(ViewMap& oldContentViews, ViewMap& newContentViews, return; const FrameMetrics metrics = container->GetFrameMetrics(); const ViewID scrollId = metrics.GetScrollId(); - gfx3DMatrix transform; - To3DMatrix(aLayer->GetTransform(), transform); + gfx3DMatrix transform = To3DMatrix(aLayer->GetTransform()); aXScale *= GetXScale(transform); aYScale *= GetYScale(transform); diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 83409849a44..47e1d8e57ae 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -2858,8 +2858,7 @@ RectTextureImage::Draw(GLManager* aManager, program->Activate(); program->SetProjectionMatrix(aManager->GetProjMatrix()); - gfx::Matrix4x4 transform; - gfx::ToMatrix4x4(aTransform, transform); + gfx::Matrix4x4 transform = gfx::ToMatrix4x4(aTransform); program->SetLayerTransform(transform * gfx::Matrix4x4().Translate(aLocation.x, aLocation.y, 0)); program->SetTextureTransform(gfx::Matrix4x4()); program->SetRenderOffset(nsIntPoint(0, 0));