зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 45a57448087d (bug 1364295) for failing mochitest gfx/layers/apz/test/mochitest/test_bug982141.html on Android 4.3 API 16. r=backout
This commit is contained in:
Родитель
d8bd4d4aaa
Коммит
e0a0f6988b
|
@ -39,7 +39,6 @@
|
|||
#include "nsViewManager.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsSubDocumentFrame.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsRegion.h"
|
||||
|
@ -3426,15 +3425,13 @@ nsLayoutUtils::CalculateAndSetDisplayPortMargins(nsIScrollableFrame* aScrollFram
|
|||
content, presShell, displayportMargins, 0, aRepaintMode);
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
nsLayoutUtils::MaybeCreateDisplayPort(nsDisplayListBuilder& aBuilder,
|
||||
nsIFrame* aScrollFrame,
|
||||
RepaintMode aRepaintMode)
|
||||
{
|
||||
nsIFrame* aScrollFrame) {
|
||||
nsIContent* content = aScrollFrame->GetContent();
|
||||
nsIScrollableFrame* scrollableFrame = do_QueryFrame(aScrollFrame);
|
||||
if (!content || !scrollableFrame) {
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
bool haveDisplayPort = HasDisplayPort(content);
|
||||
|
@ -3450,7 +3447,7 @@ nsLayoutUtils::MaybeCreateDisplayPort(nsDisplayListBuilder& aBuilder,
|
|||
|
||||
// If we don't already have a displayport, calculate and set one.
|
||||
if (!haveDisplayPort) {
|
||||
CalculateAndSetDisplayPortMargins(scrollableFrame, aRepaintMode);
|
||||
CalculateAndSetDisplayPortMargins(scrollableFrame, nsLayoutUtils::RepaintMode::DoNotRepaint);
|
||||
#ifdef DEBUG
|
||||
haveDisplayPort = HasDisplayPort(content);
|
||||
MOZ_ASSERT(haveDisplayPort, "should have a displayport after having just set it");
|
||||
|
@ -3459,9 +3456,7 @@ nsLayoutUtils::MaybeCreateDisplayPort(nsDisplayListBuilder& aBuilder,
|
|||
|
||||
// Record that the we now have a scrollable display port.
|
||||
aBuilder.SetHaveScrollableDisplayPort();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIScrollableFrame*
|
||||
|
@ -3500,43 +3495,6 @@ nsLayoutUtils::SetZeroMarginDisplayPortOnAsyncScrollableAncestors(nsIFrame* aFra
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
nsLayoutUtils::MaybeCreateDisplayPortInFirstScrollFrameEncountered(
|
||||
nsIFrame* aFrame, nsDisplayListBuilder& aBuilder)
|
||||
{
|
||||
nsIScrollableFrame* sf = do_QueryFrame(aFrame);
|
||||
if (sf) {
|
||||
if (MaybeCreateDisplayPort(aBuilder, aFrame, RepaintMode::Repaint)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (aFrame->IsPlaceholderFrame()) {
|
||||
nsPlaceholderFrame* placeholder = static_cast<nsPlaceholderFrame*>(aFrame);
|
||||
if (MaybeCreateDisplayPortInFirstScrollFrameEncountered(
|
||||
placeholder->GetOutOfFlowFrame(), aBuilder)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (aFrame->IsSubDocumentFrame()) {
|
||||
nsIPresShell* presShell =
|
||||
static_cast<nsSubDocumentFrame*>(aFrame)->GetSubdocumentPresShellForPainting(0);
|
||||
nsIFrame* root = presShell ? presShell->GetRootFrame() : nullptr;
|
||||
if (root) {
|
||||
if (MaybeCreateDisplayPortInFirstScrollFrameEncountered(root, aBuilder)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (nsIFrame* child : aFrame->PrincipalChildList()) {
|
||||
if (MaybeCreateDisplayPortInFirstScrollFrameEncountered(child, aBuilder)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
nsLayoutUtils::ExpireDisplayPortOnAsyncScrollableAncestor(nsIFrame* aFrame)
|
||||
{
|
||||
|
@ -3727,11 +3685,6 @@ nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame,
|
|||
}
|
||||
}
|
||||
|
||||
builder.ClearHaveScrollableDisplayPort();
|
||||
if (builder.IsPaintingToWindow()) {
|
||||
MaybeCreateDisplayPortInFirstScrollFrameEncountered(aFrame, builder);
|
||||
}
|
||||
|
||||
nsRect dirtyRect = visibleRegion.GetBounds();
|
||||
|
||||
{
|
||||
|
|
|
@ -1066,10 +1066,6 @@ public:
|
|||
const nscoord aRadii[8],
|
||||
const nsRect& aTestRect);
|
||||
|
||||
static bool MaybeCreateDisplayPortInFirstScrollFrameEncountered(
|
||||
nsIFrame* aFrame, nsDisplayListBuilder& aBuilder);
|
||||
|
||||
|
||||
enum class PaintFrameFlags : uint32_t {
|
||||
PAINT_IN_TRANSFORM = 0x01,
|
||||
PAINT_SYNC_DECODE_IMAGES = 0x02,
|
||||
|
@ -2818,15 +2814,10 @@ public:
|
|||
* displayport yet (as tracked by |aBuilder|), calculate and set a
|
||||
* displayport.
|
||||
*
|
||||
* If this is called during display list building pass DoNotRepaint in
|
||||
* aRepaintMode.
|
||||
*
|
||||
* Returns true if there is a displayport on an async scrollable scrollframe
|
||||
* after this call, either because one was just added or it already existed.
|
||||
* This is intended to be called during display list building.
|
||||
*/
|
||||
static bool MaybeCreateDisplayPort(nsDisplayListBuilder& aBuilder,
|
||||
nsIFrame* aScrollFrame,
|
||||
RepaintMode aRepaintMode);
|
||||
static void MaybeCreateDisplayPort(nsDisplayListBuilder& aBuilder,
|
||||
nsIFrame* aScrollFrame);
|
||||
|
||||
static nsIScrollableFrame* GetAsyncScrollableAncestorFrame(nsIFrame* aTarget);
|
||||
|
||||
|
|
|
@ -3621,6 +3621,8 @@ ScrollFrameHelper::DecideScrollableLayer(nsDisplayListBuilder* aBuilder,
|
|||
wasUsingDisplayPort = nsLayoutUtils::HasDisplayPort(content);
|
||||
|
||||
if (aAllowCreateDisplayPort) {
|
||||
nsLayoutUtils::MaybeCreateDisplayPort(*aBuilder, mOuter);
|
||||
|
||||
nsRect displayportBase = *aDirtyRect;
|
||||
nsPresContext* pc = mOuter->PresContext();
|
||||
if (mIsRoot && (pc->IsRootContentDocument() || !pc->GetParentPresContext())) {
|
||||
|
|
|
@ -586,7 +586,6 @@ public:
|
|||
|
||||
bool HaveScrollableDisplayPort() const { return mHaveScrollableDisplayPort; }
|
||||
void SetHaveScrollableDisplayPort() { mHaveScrollableDisplayPort = true; }
|
||||
void ClearHaveScrollableDisplayPort() { mHaveScrollableDisplayPort = false; }
|
||||
|
||||
bool SetIsCompositingCheap(bool aCompositingCheap) {
|
||||
bool temp = mIsCompositingCheap;
|
||||
|
|
Загрузка…
Ссылка в новой задаче