Bug 1368551 - Remove unneccessary overload of PushStackingContext. r?pchang
This overload is only called in one place, so we can just inline it. It
makes the API a little simpler.
MozReview-Commit-ID: KNsJHYSHZcT
--- a/gfx/layers/wr/StackingContextHelper.cpp
+++ b/gfx/layers/wr/StackingContextHelper.cpp
@@ -21,19 +21,18 @@ StackingContextHelper::StackingContextHe
wr::DisplayListBuilder& aBuilder,
WebRenderLayer* aLayer,
const Maybe<gfx::Matrix4x4>& aTransform)
: mBuilder(&aBuilder)
{
WrRect scBounds = aParentSC.ToRelativeWrRect(aLayer->BoundsForStackingContext());
Layer* layer = aLayer->GetLayer();
mTransform = aTransform.valueOr(layer->GetTransform());
- mBuilder->PushStackingContext(scBounds,
- 1.0f,
- mTransform,
+ float opacity = 1.0f;
+ mBuilder->PushStackingContext(scBounds, 0, &opacity, &mTransform,
wr::ToWrMixBlendMode(layer->GetMixBlendMode()));
mOrigin = aLayer->Bounds().TopLeft();
}
StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParentSC,
wr::DisplayListBuilder& aBuilder,
WebRenderLayer* aLayer,
uint64_t aAnimationsId,
--- a/gfx/webrender_bindings/WebRenderAPI.cpp
+++ b/gfx/webrender_bindings/WebRenderAPI.cpp
@@ -564,26 +564,16 @@ DisplayListBuilder::PushStackingContext(
const WrMatrix* maybeTransform = aTransform ? &matrix : nullptr;
WRDL_LOG("PushStackingContext b=%s t=%s\n", Stringify(aBounds).c_str(),
aTransform ? Stringify(*aTransform).c_str() : "none");
wr_dp_push_stacking_context(mWrState, aBounds, aAnimationId, aOpacity,
maybeTransform, aMixBlendMode);
}
void
-DisplayListBuilder::PushStackingContext(const WrRect& aBounds,
- const float aOpacity,
- const gfx::Matrix4x4& aTransform,
- const WrMixBlendMode& aMixBlendMode)
-{
- PushStackingContext(aBounds, 0, &aOpacity,
- &aTransform, aMixBlendMode);
-}
-
-void
DisplayListBuilder::PopStackingContext()
{
WRDL_LOG("PopStackingContext\n");
wr_dp_pop_stacking_context(mWrState);
}
void
DisplayListBuilder::PushClip(const WrRect& aClipRect,
--- a/gfx/webrender_bindings/WebRenderAPI.h
+++ b/gfx/webrender_bindings/WebRenderAPI.h
@@ -140,21 +140,16 @@ public:
void Begin(const LayerIntSize& aSize);
void End();
void Finalize(WrSize& aOutContentSize,
wr::BuiltDisplayList& aOutDisplayList);
void PushStackingContext(const WrRect& aBounds, // TODO: We should work with strongly typed rects
- const float aOpacity,
- const gfx::Matrix4x4& aTransform,
- const WrMixBlendMode& aMixBlendMode);
-
- void PushStackingContext(const WrRect& aBounds, // TODO: We should work with strongly typed rects
const uint64_t& aAnimationId,
const float* aOpacity,
const gfx::Matrix4x4* aTransform,
const WrMixBlendMode& aMixBlendMode);
void PopStackingContext();
void PushClip(const WrRect& aClipRect,
const WrImageMask* aMask);