Bug 1468020 - Conform to static analysis bot suggestion. r?mstange
MozReview-Commit-ID: KeWy2KHPSjk
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -901,17 +901,17 @@ HasActiveChildren(const nsDisplayList& a
//
// We can't easily use GetLayerState because it wants a bunch of layers related information.
static bool
IsItemProbablyActive(nsDisplayItem* aItem, nsDisplayListBuilder* aDisplayListBuilder)
{
switch (aItem->GetType()) {
case DisplayItemType::TYPE_TRANSFORM: {
nsDisplayTransform* transformItem = static_cast<nsDisplayTransform*>(aItem);
- Matrix4x4Flagged t = transformItem->GetTransform();
+ const Matrix4x4Flagged& t = transformItem->GetTransform();
Matrix t2d;
bool is2D = t.Is2D(&t2d);
GP("active: %d\n", transformItem->MayBeAnimated(aDisplayListBuilder));
return transformItem->MayBeAnimated(aDisplayListBuilder) || !is2D || HasActiveChildren(*transformItem->GetChildren(), aDisplayListBuilder);
}
case DisplayItemType::TYPE_OPACITY: {
nsDisplayOpacity* opacityItem = static_cast<nsDisplayOpacity*>(aItem);
bool active = opacityItem->NeedsActiveLayer(aDisplayListBuilder, opacityItem->Frame());
@@ -1018,17 +1018,17 @@ Grouper::ConstructGroups(nsDisplayListBu
currentGroup = &groupData->mFollowingGroup;
startOfCurrentGroup = item->GetAbove();
} else { // inactive item
if (item->GetType() == DisplayItemType::TYPE_TRANSFORM) {
nsDisplayTransform* transformItem = static_cast<nsDisplayTransform*>(item);
- Matrix4x4Flagged t = transformItem->GetTransform();
+ const Matrix4x4Flagged& t = transformItem->GetTransform();
Matrix t2d;
bool is2D = t.Is2D(&t2d);
MOZ_RELEASE_ASSERT(is2D, "Non-2D transforms should be treated as active");
// Save the current transform.
Matrix m = mTransform;
GP("t2d: %f %f\n", t2d._31, t2d._32);
@@ -1065,17 +1065,17 @@ Grouper::ConstructGroupInsideInactive(We
DIGroup* currentGroup = aGroup;
nsDisplayItem* item = aList->GetBottom();
while (item) {
nsDisplayList* children = item->GetChildren();
if (item->GetType() == DisplayItemType::TYPE_TRANSFORM) {
nsDisplayTransform* transformItem = static_cast<nsDisplayTransform*>(item);
- Matrix4x4Flagged t = transformItem->GetTransform();
+ const Matrix4x4Flagged& t = transformItem->GetTransform();
Matrix t2d;
bool is2D = t.Is2D(&t2d);
MOZ_RELEASE_ASSERT(is2D, "Non-2D transforms should be treated as active");
Matrix m = mTransform;
GP("t2d: %f %f\n", t2d._31, t2d._32);
mTransform.PreMultiply(t2d);