зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1394308 - Pass perspective transform attribute to compositor for OMTA, r=kats
MozReview-Commit-ID: EjyuCfnswqu --HG-- extra : rebase_source : 556db00f7c58b8b49bdafe9ca77785bce819a000
This commit is contained in:
Родитель
7780b1e846
Коммит
75200fdf13
|
@ -14,6 +14,7 @@ namespace layers {
|
|||
|
||||
StackingContextHelper::StackingContextHelper()
|
||||
: mBuilder(nullptr)
|
||||
, mHasPerspectiveTransform(false)
|
||||
, mXScale(1.0f)
|
||||
, mYScale(1.0f)
|
||||
{
|
||||
|
@ -26,6 +27,7 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
|
|||
const Maybe<gfx::Matrix4x4>& aTransform,
|
||||
const nsTArray<wr::WrFilterOp>& aFilters)
|
||||
: mBuilder(&aBuilder)
|
||||
, mHasPerspectiveTransform(false)
|
||||
, mXScale(1.0f)
|
||||
, mYScale(1.0f)
|
||||
{
|
||||
|
@ -51,6 +53,7 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
|
|||
gfx::Matrix4x4* aTransformPtr,
|
||||
const nsTArray<wr::WrFilterOp>& aFilters)
|
||||
: mBuilder(&aBuilder)
|
||||
, mHasPerspectiveTransform(false)
|
||||
, mXScale(1.0f)
|
||||
, mYScale(1.0f)
|
||||
{
|
||||
|
@ -83,6 +86,7 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
|
|||
const nsTArray<wr::WrFilterOp>& aFilters,
|
||||
const gfx::CompositionOp& aMixBlendMode)
|
||||
: mBuilder(&aBuilder)
|
||||
, mHasPerspectiveTransform(false)
|
||||
, mXScale(1.0f)
|
||||
, mYScale(1.0f)
|
||||
{
|
||||
|
@ -92,6 +96,10 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
|
|||
mTransform = *aTransformPtr;
|
||||
}
|
||||
|
||||
if (aPerspectivePtr) {
|
||||
mHasPerspectiveTransform = true;
|
||||
}
|
||||
|
||||
bool is2d = !aTransformPtr || (aTransformPtr->Is2D() && !aPerspectivePtr);
|
||||
if (is2d) {
|
||||
nsRect itemBounds = aDisplayList->GetClippedBoundsWithRespectToASR(aDisplayListBuilder, aItem->GetActiveScrolledRoot());
|
||||
|
|
|
@ -96,12 +96,13 @@ public:
|
|||
}
|
||||
|
||||
bool IsBackfaceVisible() const { return mTransform.IsBackfaceVisible(); }
|
||||
bool HasPerspectiveTransform() const { return mHasPerspectiveTransform; }
|
||||
|
||||
private:
|
||||
wr::DisplayListBuilder* mBuilder;
|
||||
LayerPoint mOrigin;
|
||||
gfx::Matrix4x4 mTransform;
|
||||
|
||||
bool mHasPerspectiveTransform;
|
||||
float mXScale;
|
||||
float mYScale;
|
||||
};
|
||||
|
|
|
@ -7841,6 +7841,7 @@ nsDisplayTransform::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBu
|
|||
TransformData& transformData = animation.data().get_TransformData();
|
||||
transformData.inheritedXScale() = scale.width;
|
||||
transformData.inheritedYScale() = scale.height;
|
||||
transformData.hasPerspectiveParent() = aSc.HasPerspectiveTransform();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче