mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out 3 changesets (bug 967844) for robopan bustage
Backed out changeset 6b53305f1c42 (bug 967844) Backed out changeset dff3eb181f33 (bug 967844) Backed out changeset 4d4b03442eaf (bug 967844)
This commit is contained in:
parent
1ce8beab5b
commit
609fe6b9c4
@ -2670,23 +2670,48 @@ nsDOMWindowUtils::SetAsyncScrollOffset(nsIDOMNode* aNode,
|
||||
if (!element) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
nsIFrame* frame = element->GetPrimaryFrame();
|
||||
if (!frame) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
nsIScrollableFrame* scrollable = do_QueryFrame(frame);
|
||||
nsPresContext* presContext = frame->PresContext();
|
||||
nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame();
|
||||
if (!scrollable) {
|
||||
if (rootScrollFrame && rootScrollFrame->GetContent() == element) {
|
||||
frame = rootScrollFrame;
|
||||
scrollable = do_QueryFrame(frame);
|
||||
}
|
||||
}
|
||||
if (!scrollable) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
Layer* layer = FrameLayerBuilder::GetDedicatedLayer(scrollable->GetScrolledFrame(),
|
||||
nsDisplayItem::TYPE_SCROLL_LAYER);
|
||||
if (!layer) {
|
||||
if (rootScrollFrame == frame && !presContext->GetParentPresContext()) {
|
||||
nsIWidget* widget = GetWidget();
|
||||
if (widget) {
|
||||
LayerManager* manager = widget->GetLayerManager();
|
||||
if (manager) {
|
||||
layer = manager->GetRoot();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!layer) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
}
|
||||
FrameMetrics::ViewID viewId;
|
||||
if (!nsLayoutUtils::FindIDFor(element, &viewId)) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
nsIWidget* widget = GetWidget();
|
||||
if (!widget) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
LayerManager* manager = widget->GetLayerManager();
|
||||
if (!manager) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
ShadowLayerForwarder* forwarder = manager->AsShadowForwarder();
|
||||
ShadowLayerForwarder* forwarder = layer->Manager()->AsShadowForwarder();
|
||||
if (!forwarder || !forwarder->HasShadowManager()) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
forwarder->GetShadowManager()->SendSetAsyncScrollOffset(viewId, aX, aY);
|
||||
forwarder->GetShadowManager()->SendSetAsyncScrollOffset(
|
||||
layer->AsShadowableLayer()->GetShadow(), viewId, aX, aY);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -753,18 +753,6 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
|
||||
WriteParam(aMsg, aParam.mUpdateScrollOffset);
|
||||
WriteParam(aMsg, aParam.mScrollGeneration);
|
||||
WriteParam(aMsg, aParam.mTransformScale);
|
||||
WriteParam(aMsg, aParam.mBackgroundColor);
|
||||
WriteParam(aMsg, aParam.GetContentDescription());
|
||||
}
|
||||
|
||||
static bool ReadContentDescription(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
{
|
||||
nsCString str;
|
||||
if (!ReadParam(aMsg, aIter, &str)) {
|
||||
return false;
|
||||
}
|
||||
aResult->SetContentDescription(str);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
@ -791,9 +779,7 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
|
||||
ReadParam(aMsg, aIter, &aResult->mHasScrollgrab) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mUpdateScrollOffset) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mScrollGeneration) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mTransformScale) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mBackgroundColor) &&
|
||||
ReadContentDescription(aMsg, aIter, aResult));
|
||||
ReadParam(aMsg, aIter, &aResult->mTransformScale));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -12,8 +12,6 @@
|
||||
#include "mozilla/gfx/Rect.h" // for RoundedIn
|
||||
#include "mozilla/gfx/ScaleFactor.h" // for ScaleFactor
|
||||
#include "mozilla/gfx/Logging.h" // for Log
|
||||
#include "gfxColor.h"
|
||||
#include "nsString.h"
|
||||
|
||||
namespace IPC {
|
||||
template <typename T> struct ParamTraits;
|
||||
@ -99,10 +97,7 @@ public:
|
||||
, mUseDisplayPortMargins(false)
|
||||
, mPresShellId(-1)
|
||||
, mViewport(0, 0, 0, 0)
|
||||
, mBackgroundColor(0, 0, 0, 0)
|
||||
{
|
||||
mContentDescription[0] = '\0';
|
||||
}
|
||||
{}
|
||||
|
||||
// Default copy ctor and operator= are fine
|
||||
|
||||
@ -127,9 +122,7 @@ public:
|
||||
mScrollParentId == aOther.mScrollParentId &&
|
||||
mScrollOffset == aOther.mScrollOffset &&
|
||||
mHasScrollgrab == aOther.mHasScrollgrab &&
|
||||
mUpdateScrollOffset == aOther.mUpdateScrollOffset &&
|
||||
mBackgroundColor == aOther.mBackgroundColor &&
|
||||
!strcmp(mContentDescription, aOther.mContentDescription);
|
||||
mUpdateScrollOffset == aOther.mUpdateScrollOffset;
|
||||
}
|
||||
bool operator!=(const FrameMetrics& aOther) const
|
||||
{
|
||||
@ -474,28 +467,6 @@ public:
|
||||
return mViewport;
|
||||
}
|
||||
|
||||
const gfxRGBA& GetBackgroundColor() const
|
||||
{
|
||||
return mBackgroundColor;
|
||||
}
|
||||
|
||||
void SetBackgroundColor(const gfxRGBA& aBackgroundColor)
|
||||
{
|
||||
mBackgroundColor = aBackgroundColor;
|
||||
}
|
||||
|
||||
nsCString GetContentDescription() const
|
||||
{
|
||||
return nsCString(mContentDescription);
|
||||
}
|
||||
|
||||
void SetContentDescription(const nsCString& aContentDescription)
|
||||
{
|
||||
strncpy(mContentDescription, aContentDescription.get(),
|
||||
sizeof(mContentDescription));
|
||||
mContentDescription[sizeof(mContentDescription) - 1] = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
// New fields from now on should be made private and old fields should
|
||||
// be refactored to be private.
|
||||
@ -564,14 +535,6 @@ private:
|
||||
// iframe. For layers that don't correspond to a document, this metric is
|
||||
// meaningless and invalid.
|
||||
CSSRect mViewport;
|
||||
|
||||
// The background color to use when overscrolling.
|
||||
gfxRGBA mBackgroundColor;
|
||||
|
||||
// A description of the content element corresponding to this frame.
|
||||
// This is empty unless this is a scrollable ContainerLayer and the
|
||||
// apz.printtree pref is turned on.
|
||||
char mContentDescription[20];
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -328,6 +328,13 @@ public:
|
||||
return mLayer->GetClipRect();
|
||||
}
|
||||
|
||||
const std::string& GetContentDescription() const
|
||||
{
|
||||
MOZ_ASSERT(IsValid());
|
||||
|
||||
return mLayer->GetContentDescription();
|
||||
}
|
||||
|
||||
// Expose an opaque pointer to the layer. Mostly used for printf
|
||||
// purposes. This is not intended to be a general-purpose accessor
|
||||
// for the underlying layer.
|
||||
|
@ -209,7 +209,8 @@ Layer::Layer(LayerManager* aManager, void* aImplData) :
|
||||
mScrollbarTargetId(FrameMetrics::NULL_SCROLL_ID),
|
||||
mScrollbarDirection(ScrollDirection::NONE),
|
||||
mDebugColorIndex(0),
|
||||
mAnimationGeneration(0)
|
||||
mAnimationGeneration(0),
|
||||
mBackgroundColor(0, 0, 0, 0)
|
||||
{}
|
||||
|
||||
Layer::~Layer()
|
||||
|
@ -1171,6 +1171,28 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void SetBackgroundColor(const gfxRGBA& aColor)
|
||||
{
|
||||
if (mBackgroundColor == aColor) {
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) BackgroundColor", this));
|
||||
mBackgroundColor = aColor;
|
||||
Mutated();
|
||||
}
|
||||
|
||||
void SetContentDescription(const std::string& aContentDescription)
|
||||
{
|
||||
if (mContentDescription == aContentDescription) {
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) ContentDescription", this));
|
||||
mContentDescription = aContentDescription;
|
||||
Mutated();
|
||||
}
|
||||
|
||||
// These getters can be used anytime.
|
||||
float GetOpacity() { return mOpacity; }
|
||||
gfx::CompositionOp GetMixBlendMode() const { return mMixBlendMode; }
|
||||
@ -1204,6 +1226,8 @@ public:
|
||||
FrameMetrics::ViewID GetScrollbarTargetContainerId() { return mScrollbarTargetId; }
|
||||
ScrollDirection GetScrollbarDirection() { return mScrollbarDirection; }
|
||||
Layer* GetMaskLayer() const { return mMaskLayer; }
|
||||
gfxRGBA GetBackgroundColor() const { return mBackgroundColor; }
|
||||
const std::string& GetContentDescription() const { return mContentDescription; }
|
||||
|
||||
|
||||
// Note that all lengths in animation data are either in CSS pixels or app
|
||||
@ -1631,6 +1655,12 @@ protected:
|
||||
// If this layer is used for OMTA, then this counter is used to ensure we
|
||||
// stay in sync with the animation manager
|
||||
uint64_t mAnimationGeneration;
|
||||
// This is currently set and used only for scrollable container layers.
|
||||
gfxRGBA mBackgroundColor;
|
||||
// A description of the content element corresponding to this frame.
|
||||
// This is empty unless this is a scrollable ContainerLayer and the
|
||||
// apz.printtree pref is turned on.
|
||||
std::string mContentDescription;
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
nsTArray<nsCString> mExtraDumpInfo;
|
||||
#endif
|
||||
|
@ -123,7 +123,6 @@ AppendToString(std::stringstream& aStream, const FrameMetrics& m,
|
||||
AppendToString(aStream, m.GetScrollOffset(), " s=");
|
||||
AppendToString(aStream, m.mDisplayPort, " dp=");
|
||||
AppendToString(aStream, m.mCriticalDisplayPort, " cdp=");
|
||||
AppendToString(aStream, m.GetBackgroundColor(), " color=");
|
||||
if (!detailed) {
|
||||
AppendToString(aStream, m.GetScrollId(), " scrollId=");
|
||||
if (m.GetScrollParentId() != FrameMetrics::NULL_SCROLL_ID) {
|
||||
|
@ -308,7 +308,7 @@ APZCTreeManager::PrepareAPZCForLayer(const LayerMetricsWrapper& aLayer,
|
||||
<< "\tsr=" << aMetrics.mScrollableRect
|
||||
<< (aLayer.GetVisibleRegion().IsEmpty() ? "\tscrollinfo" : "")
|
||||
<< (apzc->HasScrollgrab() ? "\tscrollgrab" : "")
|
||||
<< "\t" << aMetrics.GetContentDescription().get();
|
||||
<< "\t" << aLayer.GetContentDescription();
|
||||
|
||||
// Bind the APZC instance into the tree of APZCs
|
||||
if (aNextSibling) {
|
||||
|
@ -268,16 +268,15 @@ RenderLayers(ContainerT* aContainer,
|
||||
// placeholder for APZ purposes.
|
||||
if (aContainer->HasScrollableFrameMetrics() && !aContainer->IsScrollInfoLayer()) {
|
||||
bool overscrolled = false;
|
||||
gfxRGBA color;
|
||||
for (uint32_t i = 0; i < aContainer->GetFrameMetricsCount(); i++) {
|
||||
AsyncPanZoomController* apzc = aContainer->GetAsyncPanZoomController(i);
|
||||
if (apzc && apzc->IsOverscrolled()) {
|
||||
overscrolled = true;
|
||||
color = aContainer->GetFrameMetrics(i).GetBackgroundColor();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (overscrolled) {
|
||||
gfxRGBA color = aContainer->GetBackgroundColor();
|
||||
// If the background is completely transparent, there's no point in
|
||||
// drawing anything for it. Hopefully the layers behind, if any, will
|
||||
// provide suitable content for the overscroll effect.
|
||||
|
@ -367,9 +367,9 @@ TiledContentHost::Composite(EffectChain& aEffectChain,
|
||||
if (aOpacity == 1.0f && gfxPrefs::LowPrecisionOpacity() < 1.0f) {
|
||||
// Background colors are only stored on scrollable layers. Grab
|
||||
// the one from the nearest scrollable ancestor layer.
|
||||
for (LayerMetricsWrapper ancestor(GetLayer(), LayerMetricsWrapper::StartAt::BOTTOM); ancestor; ancestor = ancestor.GetParent()) {
|
||||
if (ancestor.Metrics().IsScrollable()) {
|
||||
backgroundColor = ancestor.Metrics().GetBackgroundColor();
|
||||
for (Layer* ancestor = GetLayer(); ancestor; ancestor = ancestor->GetParent()) {
|
||||
if (ancestor->HasScrollableFrameMetrics()) {
|
||||
backgroundColor = ancestor->GetBackgroundColor();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -321,6 +321,8 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
||||
layer->SetAnimations(common.animations());
|
||||
layer->SetInvalidRegion(common.invalidRegion());
|
||||
layer->SetFrameMetrics(common.metrics());
|
||||
layer->SetBackgroundColor(common.backgroundColor().value());
|
||||
layer->SetContentDescription(common.contentDescription());
|
||||
|
||||
typedef SpecificLayerAttributes Specific;
|
||||
const SpecificLayerAttributes& specific = attrs.specific();
|
||||
@ -687,35 +689,26 @@ LayerTransactionParent::RecvGetAnimationTransform(PLayerParent* aParent,
|
||||
return true;
|
||||
}
|
||||
|
||||
static AsyncPanZoomController*
|
||||
GetAPZCForViewID(Layer* aLayer, FrameMetrics::ViewID aScrollID)
|
||||
{
|
||||
for (uint32_t i = 0; i < aLayer->GetFrameMetricsCount(); i++) {
|
||||
if (aLayer->GetFrameMetrics(i).GetScrollId() == aScrollID) {
|
||||
return aLayer->GetAsyncPanZoomController(i);
|
||||
}
|
||||
}
|
||||
ContainerLayer* container = aLayer->AsContainerLayer();
|
||||
if (container) {
|
||||
for (Layer* l = container->GetFirstChild(); l; l = l->GetNextSibling()) {
|
||||
AsyncPanZoomController* c = GetAPZCForViewID(l, aScrollID);
|
||||
if (c) {
|
||||
return c;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
LayerTransactionParent::RecvSetAsyncScrollOffset(const FrameMetrics::ViewID& aScrollID,
|
||||
LayerTransactionParent::RecvSetAsyncScrollOffset(PLayerParent* aLayer,
|
||||
const FrameMetrics::ViewID& aId,
|
||||
const int32_t& aX, const int32_t& aY)
|
||||
{
|
||||
if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AsyncPanZoomController* controller = GetAPZCForViewID(mRoot, aScrollID);
|
||||
Layer* layer = cast(aLayer)->AsLayer();
|
||||
if (!layer) {
|
||||
return false;
|
||||
}
|
||||
AsyncPanZoomController* controller = nullptr;
|
||||
for (uint32_t i = 0; i < layer->GetFrameMetricsCount(); i++) {
|
||||
if (layer->GetFrameMetrics(i).GetScrollId() == aId) {
|
||||
controller = layer->GetAsyncPanZoomController(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!controller) {
|
||||
return false;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ protected:
|
||||
virtual bool RecvGetAnimationTransform(PLayerParent* aParent,
|
||||
MaybeTransform* aTransform)
|
||||
MOZ_OVERRIDE;
|
||||
virtual bool RecvSetAsyncScrollOffset(const FrameMetrics::ViewID& aId,
|
||||
virtual bool RecvSetAsyncScrollOffset(PLayerParent* aLayer, const FrameMetrics::ViewID& aId,
|
||||
const int32_t& aX, const int32_t& aY) MOZ_OVERRIDE;
|
||||
virtual bool RecvGetAPZTestData(APZTestData* aOutData);
|
||||
|
||||
|
@ -216,6 +216,7 @@ struct CommonLayerAttributes {
|
||||
Animation[] animations;
|
||||
nsIntRegion invalidRegion;
|
||||
FrameMetrics[] metrics;
|
||||
LayerColor backgroundColor;
|
||||
string contentDescription;
|
||||
};
|
||||
|
||||
|
@ -81,10 +81,10 @@ parent:
|
||||
// be void_t.
|
||||
sync GetAnimationTransform(PLayer layer) returns (MaybeTransform transform);
|
||||
|
||||
// The next time the layer tree is composited, add this async scroll offset in
|
||||
// CSS pixels for the given ViewID.
|
||||
// The next time this layer is composited, add this async scroll offset in
|
||||
// CSS pixels.
|
||||
// Useful for testing rendering of async scrolling.
|
||||
async SetAsyncScrollOffset(ViewID id, int32_t x, int32_t y);
|
||||
async SetAsyncScrollOffset(PLayer layer, ViewID id, int32_t x, int32_t y);
|
||||
|
||||
// Drop any front buffers that might be retained on the compositor
|
||||
// side.
|
||||
|
@ -609,6 +609,8 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
|
||||
common.animations() = mutant->GetAnimations();
|
||||
common.invalidRegion() = mutant->GetInvalidRegion();
|
||||
common.metrics() = mutant->GetAllFrameMetrics();
|
||||
common.backgroundColor() = mutant->GetBackgroundColor();
|
||||
common.contentDescription() = mutant->GetContentDescription();
|
||||
attrs.specific() = null_t();
|
||||
mutant->FillSpecificAttributes(attrs.specific());
|
||||
|
||||
|
@ -259,7 +259,6 @@ public:
|
||||
mNeedComponentAlpha(false),
|
||||
mForceTransparentSurface(false),
|
||||
mHideAllLayersBelow(false),
|
||||
mOpaqueForAnimatedGeometryRootParent(false),
|
||||
mImage(nullptr),
|
||||
mCommonClipCount(-1),
|
||||
mNewChildLayersIndex(-1),
|
||||
@ -459,13 +458,6 @@ public:
|
||||
* Set if all layers below this ThebesLayer should be hidden.
|
||||
*/
|
||||
bool mHideAllLayersBelow;
|
||||
/**
|
||||
* Set if the opaque region for this layer can be applied to the parent
|
||||
* animated geometry root of this layer's animated geometry root.
|
||||
* We set this when a ThebesLayer's animated geometry root is a scrollframe
|
||||
* and the ThebesLayer completely fills the displayport of the scrollframe.
|
||||
*/
|
||||
bool mOpaqueForAnimatedGeometryRootParent;
|
||||
|
||||
/**
|
||||
* Stores the pointer to the nsDisplayImage if we want to
|
||||
@ -540,9 +532,6 @@ struct NewLayerEntry {
|
||||
nsRefPtr<Layer> mLayer;
|
||||
const nsIFrame* mAnimatedGeometryRoot;
|
||||
const nsIFrame* mFixedPosFrameForLayerData;
|
||||
// If non-null, this FrameMetrics is set to the be the first FrameMetrics
|
||||
// on the layer.
|
||||
UniquePtr<FrameMetrics> mBaseFrameMetrics;
|
||||
// The following are only used for retained layers (for occlusion
|
||||
// culling of those layers). These regions are all relative to the
|
||||
// container reference frame.
|
||||
@ -767,22 +756,14 @@ protected:
|
||||
bool ItemCoversScrollableArea(nsDisplayItem* aItem, const nsRegion& aOpaque);
|
||||
|
||||
/**
|
||||
* Set FrameMetrics and scroll-induced clipping on aEntry's layer.
|
||||
*/
|
||||
void SetupScrollingMetadata(NewLayerEntry* aEntry);
|
||||
|
||||
/**
|
||||
* Applies occlusion culling.
|
||||
* For each layer in mNewChildLayers, remove from its visible region the
|
||||
* opaque regions of the layers at higher z-index, but only if they have
|
||||
* the same animated geometry root and fixed-pos frame ancestor.
|
||||
* The opaque region for the child layers that share the same animated
|
||||
* geometry root as the container frame is returned in
|
||||
* *aOpaqueRegionForContainer.
|
||||
*
|
||||
* Also sets scroll metadata on the layers.
|
||||
*/
|
||||
void PostprocessRetainedLayers(nsIntRegion* aOpaqueRegionForContainer);
|
||||
void ApplyOcclusionCulling(nsIntRegion* aOpaqueRegionForContainer);
|
||||
|
||||
/**
|
||||
* Computes the snapped opaque area of aItem. Sets aList's opaque flag
|
||||
@ -795,8 +776,7 @@ protected:
|
||||
const nsIFrame* aFixedPosFrame,
|
||||
const DisplayItemClip& aClip,
|
||||
nsDisplayList* aList,
|
||||
bool* aHideAllLayersBelow,
|
||||
bool* aOpaqueForAnimatedGeometryRootParent);
|
||||
bool* aHideAllLayersBelow);
|
||||
|
||||
/**
|
||||
* Indicate that we are done adding items to the ThebesLayer at the top of
|
||||
@ -2160,7 +2140,12 @@ ContainerState::PopThebesLayerData()
|
||||
newLayerEntry->mVisibleRegion = data->mVisibleRegion;
|
||||
newLayerEntry->mOpaqueRegion = data->mOpaqueRegion;
|
||||
newLayerEntry->mHideAllLayersBelow = data->mHideAllLayersBelow;
|
||||
newLayerEntry->mOpaqueForAnimatedGeometryRootParent = data->mOpaqueForAnimatedGeometryRootParent;
|
||||
if (nsLayoutUtils::GetScrollableFrameFor(newLayerEntry->mAnimatedGeometryRoot) &&
|
||||
!nsDisplayScrollLayer::IsConstructingScrollLayerForScrolledFrame(newLayerEntry->mAnimatedGeometryRoot)) {
|
||||
// Async scrolling not currently active so we can propagate our opaque region
|
||||
// up to the parent animated geometry root.
|
||||
newLayerEntry->mOpaqueForAnimatedGeometryRootParent = true;
|
||||
}
|
||||
} else {
|
||||
SetOuterVisibleRegionForLayer(layer, data->mVisibleRegion);
|
||||
}
|
||||
@ -2677,8 +2662,7 @@ ContainerState::ComputeOpaqueRect(nsDisplayItem* aItem,
|
||||
const nsIFrame* aFixedPosFrame,
|
||||
const DisplayItemClip& aClip,
|
||||
nsDisplayList* aList,
|
||||
bool* aHideAllLayersBelow,
|
||||
bool* aOpaqueForAnimatedGeometryRootParent)
|
||||
bool* aHideAllLayersBelow)
|
||||
{
|
||||
bool snapOpaque;
|
||||
nsRegion opaque = aItem->GetOpaqueRegion(mBuilder, &snapOpaque);
|
||||
@ -2706,23 +2690,6 @@ ContainerState::ComputeOpaqueRect(nsDisplayItem* aItem,
|
||||
if (aFixedPosFrame && ItemCoversScrollableArea(aItem, opaque)) {
|
||||
*aHideAllLayersBelow = true;
|
||||
}
|
||||
|
||||
nsIScrollableFrame* sf = nsLayoutUtils::GetScrollableFrameFor(aAnimatedGeometryRoot);
|
||||
if (sf) {
|
||||
nsRect displayport;
|
||||
bool usingDisplayport =
|
||||
nsLayoutUtils::GetDisplayPort(aAnimatedGeometryRoot->GetContent(), &displayport);
|
||||
if (!usingDisplayport) {
|
||||
// No async scrolling, so all that matters is that the layer contents
|
||||
// cover the scrollport.
|
||||
displayport = sf->GetScrollPortRect();
|
||||
}
|
||||
nsIFrame* scrollFrame = do_QueryFrame(sf);
|
||||
displayport += scrollFrame->GetOffsetToCrossDoc(mContainerReferenceFrame);
|
||||
if (opaque.Contains(displayport)) {
|
||||
*aOpaqueForAnimatedGeometryRootParent = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return opaquePixels;
|
||||
}
|
||||
@ -3003,22 +2970,15 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList,
|
||||
newLayerEntry->mVisibleRegion = itemVisibleRect;
|
||||
newLayerEntry->mOpaqueRegion = ComputeOpaqueRect(item,
|
||||
animatedGeometryRoot, fixedPosFrame, itemClip, aList,
|
||||
&newLayerEntry->mHideAllLayersBelow,
|
||||
&newLayerEntry->mOpaqueForAnimatedGeometryRootParent);
|
||||
&newLayerEntry->mHideAllLayersBelow);
|
||||
} else {
|
||||
SetOuterVisibleRegionForLayer(ownLayer, itemVisibleRect,
|
||||
layerContentsVisibleRect.width >= 0 ? &layerContentsVisibleRect : nullptr);
|
||||
}
|
||||
if (itemType == nsDisplayItem::TYPE_SCROLL_LAYER ||
|
||||
itemType == nsDisplayItem::TYPE_SCROLL_INFO_LAYER) {
|
||||
if (itemType == nsDisplayItem::TYPE_SCROLL_LAYER) {
|
||||
nsDisplayScrollLayer* scrollItem = static_cast<nsDisplayScrollLayer*>(item);
|
||||
newLayerEntry->mOpaqueForAnimatedGeometryRootParent =
|
||||
scrollItem->IsDisplayPortOpaque();
|
||||
newLayerEntry->mBaseFrameMetrics =
|
||||
scrollItem->ComputeFrameMetrics(ownLayer, mParameters);
|
||||
} else if (itemType == nsDisplayItem::TYPE_SUBDOCUMENT) {
|
||||
newLayerEntry->mBaseFrameMetrics =
|
||||
static_cast<nsDisplaySubDocument*>(item)->ComputeFrameMetrics(ownLayer, mParameters);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3051,8 +3011,7 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList,
|
||||
nsIntRegion opaquePixels = ComputeOpaqueRect(item,
|
||||
animatedGeometryRoot, thebesLayerData->mFixedPosFrameForLayerData,
|
||||
itemClip, aList,
|
||||
&thebesLayerData->mHideAllLayersBelow,
|
||||
&thebesLayerData->mOpaqueForAnimatedGeometryRootParent);
|
||||
&thebesLayerData->mHideAllLayersBelow);
|
||||
thebesLayerData->Accumulate(this, item, opaquePixels,
|
||||
itemVisibleRect, itemDrawRect, itemClip);
|
||||
}
|
||||
@ -3478,63 +3437,7 @@ FindOpaqueRegionEntry(nsTArray<OpaqueRegionEntry>& aEntries,
|
||||
}
|
||||
|
||||
void
|
||||
ContainerState::SetupScrollingMetadata(NewLayerEntry* aEntry)
|
||||
{
|
||||
nsAutoTArray<FrameMetrics,2> metricsArray;
|
||||
if (aEntry->mBaseFrameMetrics) {
|
||||
metricsArray.AppendElement(*aEntry->mBaseFrameMetrics);
|
||||
}
|
||||
uint32_t baseLength = metricsArray.Length();
|
||||
|
||||
nsIntRect tmpClipRect;
|
||||
const nsIntRect* layerClip = aEntry->mLayer->GetClipRect();
|
||||
nsIFrame* fParent;
|
||||
for (const nsIFrame* f = aEntry->mAnimatedGeometryRoot;
|
||||
f != mContainerAnimatedGeometryRoot;
|
||||
f = nsLayoutUtils::GetAnimatedGeometryRootForFrame(
|
||||
fParent, mContainerAnimatedGeometryRoot)) {
|
||||
fParent = nsLayoutUtils::GetCrossDocParentFrame(f);
|
||||
if (!fParent) {
|
||||
// This means mContainerAnimatedGeometryRoot was not an ancestor
|
||||
// of aEntry->mAnimatedGeometryRoot. This is a weird case but it
|
||||
// can happen, e.g. when a scrolled frame contains a frame with opacity
|
||||
// which contains a frame that is not scrolled by the scrolled frame.
|
||||
// For now, we just don't apply any specific async scrolling to this layer.
|
||||
// It will async-scroll with mContainerAnimatedGeometryRoot, which
|
||||
// is substandard but not fatal.
|
||||
metricsArray.SetLength(baseLength);
|
||||
aEntry->mLayer->SetFrameMetrics(metricsArray);
|
||||
return;
|
||||
}
|
||||
|
||||
nsIScrollableFrame* scrollFrame = nsLayoutUtils::GetScrollableFrameFor(f);
|
||||
if (!scrollFrame) {
|
||||
continue;
|
||||
}
|
||||
|
||||
nsRect clipRect(0, 0, -1, -1);
|
||||
scrollFrame->ComputeFrameMetrics(aEntry->mLayer, mContainerReferenceFrame,
|
||||
mParameters, &clipRect, &metricsArray);
|
||||
if (clipRect.width >= 0) {
|
||||
nsIntRect pixClip = ScaleToNearestPixels(clipRect);
|
||||
if (layerClip) {
|
||||
tmpClipRect.IntersectRect(pixClip, *layerClip);
|
||||
} else {
|
||||
tmpClipRect = pixClip;
|
||||
}
|
||||
layerClip = &tmpClipRect;
|
||||
// XXX this could cause IPC churn due to cliprects being updated
|
||||
// twice during layer building --- for non-ThebesLayers that have
|
||||
// both CSS and scroll clipping.
|
||||
}
|
||||
}
|
||||
aEntry->mLayer->SetClipRect(layerClip);
|
||||
// Watch out for FrameMetrics copies in profiles
|
||||
aEntry->mLayer->SetFrameMetrics(metricsArray);
|
||||
}
|
||||
|
||||
void
|
||||
ContainerState::PostprocessRetainedLayers(nsIntRegion* aOpaqueRegionForContainer)
|
||||
ContainerState::ApplyOcclusionCulling(nsIntRegion* aOpaqueRegionForContainer)
|
||||
{
|
||||
nsAutoTArray<OpaqueRegionEntry,4> opaqueRegions;
|
||||
bool hideAll = false;
|
||||
@ -3555,10 +3458,6 @@ ContainerState::PostprocessRetainedLayers(nsIntRegion* aOpaqueRegionForContainer
|
||||
e->mVisibleRegion.Sub(e->mVisibleRegion, data->mOpaqueRegion);
|
||||
}
|
||||
|
||||
SetOuterVisibleRegionForLayer(e->mLayer, e->mVisibleRegion,
|
||||
e->mLayerContentsVisibleRect.width >= 0 ? &e->mLayerContentsVisibleRect : nullptr);
|
||||
SetupScrollingMetadata(e);
|
||||
|
||||
if (!e->mOpaqueRegion.IsEmpty()) {
|
||||
const nsIFrame* animatedGeometryRootToCover = e->mAnimatedGeometryRoot;
|
||||
if (e->mOpaqueForAnimatedGeometryRootParent &&
|
||||
@ -3586,6 +3485,9 @@ ContainerState::PostprocessRetainedLayers(nsIntRegion* aOpaqueRegionForContainer
|
||||
}
|
||||
}
|
||||
|
||||
SetOuterVisibleRegionForLayer(e->mLayer, e->mVisibleRegion,
|
||||
e->mLayerContentsVisibleRect.width >= 0 ? &e->mLayerContentsVisibleRect : nullptr);
|
||||
|
||||
if (e->mLayer->GetType() == Layer::TYPE_READBACK) {
|
||||
// ReadbackLayers need to accurately read what's behind them. So,
|
||||
// we don't want to do any occlusion culling of layers behind them.
|
||||
@ -3616,7 +3518,7 @@ ContainerState::Finish(uint32_t* aTextContentFlags, LayerManagerData* aData,
|
||||
|
||||
if (mLayerBuilder->IsBuildingRetainedLayers()) {
|
||||
nsIntRegion containerOpaqueRegion;
|
||||
PostprocessRetainedLayers(&containerOpaqueRegion);
|
||||
ApplyOcclusionCulling(&containerOpaqueRegion);
|
||||
if (containerOpaqueRegion.Contains(aContainerPixelBounds)) {
|
||||
aChildItems->SetIsOpaque();
|
||||
}
|
||||
|
@ -647,17 +647,15 @@ static void UnmarkFrameForDisplay(nsIFrame* aFrame) {
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ FrameMetrics
|
||||
nsDisplayScrollLayer::ComputeFrameMetrics(nsIFrame* aForFrame,
|
||||
nsIFrame* aScrollFrame,
|
||||
const nsIFrame* aReferenceFrame,
|
||||
Layer* aLayer,
|
||||
ViewID aScrollParentId,
|
||||
const nsRect& aViewport,
|
||||
bool aForceNullScrollId,
|
||||
bool aIsRoot,
|
||||
const ContainerLayerParameters& aContainerParameters)
|
||||
{
|
||||
static void RecordFrameMetrics(nsIFrame* aForFrame,
|
||||
nsIFrame* aScrollFrame,
|
||||
const nsIFrame* aReferenceFrame,
|
||||
ContainerLayer* aRoot,
|
||||
ViewID aScrollParentId,
|
||||
const nsRect& aViewport,
|
||||
bool aForceNullScrollId,
|
||||
bool aIsRoot,
|
||||
const ContainerLayerParameters& aContainerParameters) {
|
||||
nsPresContext* presContext = aForFrame->PresContext();
|
||||
int32_t auPerDevPixel = presContext->AppUnitsPerDevPixel();
|
||||
LayoutDeviceToLayerScale resolution(aContainerParameters.mXScale, aContainerParameters.mYScale);
|
||||
@ -675,7 +673,7 @@ nsDisplayScrollLayer::ComputeFrameMetrics(nsIFrame* aForFrame,
|
||||
nsRect dp;
|
||||
if (nsLayoutUtils::GetDisplayPort(content, &dp)) {
|
||||
metrics.mDisplayPort = CSSRect::FromAppUnits(dp);
|
||||
nsLayoutUtils::LogTestDataForPaint(aLayer->Manager(), scrollId, "displayport",
|
||||
nsLayoutUtils::LogTestDataForPaint(aRoot->Manager(), scrollId, "displayport",
|
||||
metrics.mDisplayPort);
|
||||
}
|
||||
if (nsLayoutUtils::GetCriticalDisplayPort(content, &dp)) {
|
||||
@ -837,7 +835,7 @@ nsDisplayScrollLayer::ComputeFrameMetrics(nsIFrame* aForFrame,
|
||||
if (nsIContent* content = frameForCompositionBoundsCalculation->GetContent()) {
|
||||
nsAutoString contentDescription;
|
||||
content->Describe(contentDescription);
|
||||
metrics.SetContentDescription(NS_LossyConvertUTF16toASCII(contentDescription));
|
||||
aRoot->SetContentDescription(NS_LossyConvertUTF16toASCII(contentDescription).get());
|
||||
}
|
||||
}
|
||||
|
||||
@ -850,20 +848,20 @@ nsDisplayScrollLayer::ComputeFrameMetrics(nsIFrame* aForFrame,
|
||||
metrics.SetHasScrollgrab(true);
|
||||
}
|
||||
|
||||
// Also compute and set the background color.
|
||||
aRoot->SetFrameMetrics(metrics);
|
||||
|
||||
// Also compute and set the background color on the container.
|
||||
// This is needed for APZ overscrolling support.
|
||||
if (aScrollFrame) {
|
||||
if (isRootScrollFrame) {
|
||||
metrics.SetBackgroundColor(presShell->GetCanvasBackground());
|
||||
aRoot->SetBackgroundColor(presShell->GetCanvasBackground());
|
||||
} else {
|
||||
nsStyleContext* backgroundStyle;
|
||||
if (nsCSSRendering::FindBackground(aScrollFrame, &backgroundStyle)) {
|
||||
metrics.SetBackgroundColor(backgroundStyle->StyleBackground()->mBackgroundColor);
|
||||
aRoot->SetBackgroundColor(backgroundStyle->StyleBackground()->mBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return metrics;
|
||||
}
|
||||
|
||||
nsDisplayListBuilder::~nsDisplayListBuilder() {
|
||||
@ -1294,11 +1292,10 @@ void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
nsRect viewport(aBuilder->ToReferenceFrame(aForFrame), aForFrame->GetSize());
|
||||
|
||||
root->SetFrameMetrics(
|
||||
nsDisplayScrollLayer::ComputeFrameMetrics(aForFrame, rootScrollFrame,
|
||||
aBuilder->FindReferenceFrameFor(aForFrame),
|
||||
root, FrameMetrics::NULL_SCROLL_ID, viewport,
|
||||
!isRoot, isRoot, containerParameters));
|
||||
RecordFrameMetrics(aForFrame, rootScrollFrame,
|
||||
aBuilder->FindReferenceFrameFor(aForFrame),
|
||||
root, FrameMetrics::NULL_SCROLL_ID, viewport,
|
||||
!isRoot, isRoot, containerParameters);
|
||||
|
||||
// NS_WARNING is debug-only, so don't even bother checking the conditions in
|
||||
// a release build.
|
||||
@ -3671,35 +3668,28 @@ nsDisplaySubDocument::BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
params.mInLowPrecisionDisplayPort = true;
|
||||
}
|
||||
|
||||
return nsDisplayOwnLayer::BuildLayer(aBuilder, aManager, params);
|
||||
}
|
||||
nsRefPtr<Layer> layer = nsDisplayOwnLayer::BuildLayer(
|
||||
aBuilder, aManager, params);
|
||||
|
||||
UniquePtr<FrameMetrics>
|
||||
nsDisplaySubDocument::ComputeFrameMetrics(Layer* aLayer,
|
||||
const ContainerLayerParameters& aContainerParameters)
|
||||
{
|
||||
if (!(mFlags & GENERATE_SCROLLABLE_LAYER)) {
|
||||
return UniquePtr<FrameMetrics>(nullptr);
|
||||
return layer.forget();
|
||||
}
|
||||
|
||||
nsPresContext* presContext = mFrame->PresContext();
|
||||
nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame();
|
||||
bool isRootContentDocument = presContext->IsRootContentDocument();
|
||||
ContainerLayerParameters params = aContainerParameters;
|
||||
if ((mFlags & GENERATE_SCROLLABLE_LAYER) &&
|
||||
rootScrollFrame->GetContent() &&
|
||||
nsLayoutUtils::GetCriticalDisplayPort(rootScrollFrame->GetContent(), nullptr)) {
|
||||
params.mInLowPrecisionDisplayPort = true;
|
||||
NS_ASSERTION(layer->AsContainerLayer(), "nsDisplayOwnLayer should have made a ContainerLayer");
|
||||
if (ContainerLayer* container = layer->AsContainerLayer()) {
|
||||
nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame();
|
||||
bool isRootContentDocument = presContext->IsRootContentDocument();
|
||||
|
||||
nsRect viewport = mFrame->GetRect() -
|
||||
mFrame->GetPosition() +
|
||||
mFrame->GetOffsetToCrossDoc(ReferenceFrame());
|
||||
|
||||
RecordFrameMetrics(mFrame, rootScrollFrame, ReferenceFrame(),
|
||||
container, mScrollParentId, viewport,
|
||||
false, isRootContentDocument, params);
|
||||
}
|
||||
|
||||
nsRect viewport = mFrame->GetRect() -
|
||||
mFrame->GetPosition() +
|
||||
mFrame->GetOffsetToCrossDoc(ReferenceFrame());
|
||||
|
||||
return MakeUnique<FrameMetrics>(
|
||||
nsDisplayScrollLayer::ComputeFrameMetrics(mFrame, rootScrollFrame, ReferenceFrame(),
|
||||
aLayer, mScrollParentId, viewport,
|
||||
false, isRootContentDocument, params));
|
||||
return layer.forget();
|
||||
}
|
||||
|
||||
nsRect
|
||||
@ -3988,14 +3978,25 @@ nsDisplayScrollLayer::GetScrolledContentRectToDraw(nsDisplayListBuilder* aBuilde
|
||||
already_AddRefed<Layer>
|
||||
nsDisplayScrollLayer::BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
LayerManager* aManager,
|
||||
const ContainerLayerParameters& aContainerParameters)
|
||||
{
|
||||
const ContainerLayerParameters& aContainerParameters) {
|
||||
|
||||
ContainerLayerParameters params = aContainerParameters;
|
||||
if (mScrolledFrame->GetContent() &&
|
||||
nsLayoutUtils::GetCriticalDisplayPort(mScrolledFrame->GetContent(), nullptr)) {
|
||||
params.mInLowPrecisionDisplayPort = true;
|
||||
params.mInLowPrecisionDisplayPort = true;
|
||||
}
|
||||
|
||||
nsRefPtr<ContainerLayer> layer = aManager->GetLayerBuilder()->
|
||||
BuildContainerLayerFor(aBuilder, aManager, mFrame, this, &mList,
|
||||
params, nullptr);
|
||||
|
||||
nsRect viewport = mScrollFrame->GetRect() -
|
||||
mScrollFrame->GetPosition() +
|
||||
mScrollFrame->GetOffsetToCrossDoc(ReferenceFrame());
|
||||
|
||||
RecordFrameMetrics(mScrolledFrame, mScrollFrame, ReferenceFrame(), layer,
|
||||
mScrollParentId, viewport, false, false, params);
|
||||
|
||||
if (mList.IsOpaque()) {
|
||||
nsRect displayport;
|
||||
bool usingDisplayport =
|
||||
@ -4006,28 +4007,14 @@ nsDisplayScrollLayer::BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
mDisplayPortContentsOpaque = false;
|
||||
}
|
||||
|
||||
return aManager->GetLayerBuilder()->
|
||||
BuildContainerLayerFor(aBuilder, aManager, mFrame, this, &mList,
|
||||
params, nullptr);
|
||||
return layer.forget();
|
||||
}
|
||||
|
||||
UniquePtr<FrameMetrics>
|
||||
nsDisplayScrollLayer::ComputeFrameMetrics(Layer* aLayer,
|
||||
const ContainerLayerParameters& aContainerParameters)
|
||||
bool
|
||||
nsDisplayScrollLayer::IsConstructingScrollLayerForScrolledFrame(const nsIFrame* aScrolledFrame)
|
||||
{
|
||||
ContainerLayerParameters params = aContainerParameters;
|
||||
if (mScrolledFrame->GetContent() &&
|
||||
nsLayoutUtils::GetCriticalDisplayPort(mScrolledFrame->GetContent(), nullptr)) {
|
||||
params.mInLowPrecisionDisplayPort = true;
|
||||
}
|
||||
|
||||
nsRect viewport = mScrollFrame->GetRect() -
|
||||
mScrollFrame->GetPosition() +
|
||||
mScrollFrame->GetOffsetToCrossDoc(ReferenceFrame());
|
||||
|
||||
return UniquePtr<FrameMetrics>(new FrameMetrics(
|
||||
ComputeFrameMetrics(mScrolledFrame, mScrollFrame, ReferenceFrame(), aLayer,
|
||||
mScrollParentId, viewport, false, false, params)));
|
||||
FrameProperties props = aScrolledFrame->Properties();
|
||||
return reinterpret_cast<intptr_t>(props.Get(nsIFrame::ScrollLayerCount())) != 0;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -24,8 +24,6 @@
|
||||
#include "nsDisplayListInvalidation.h"
|
||||
#include "DisplayListClipState.h"
|
||||
#include "LayerState.h"
|
||||
#include "FrameMetrics.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -45,8 +43,8 @@ namespace layers {
|
||||
class Layer;
|
||||
class ImageLayer;
|
||||
class ImageContainer;
|
||||
} //namespace
|
||||
} //namespace
|
||||
} //namepsace
|
||||
} //namepsace
|
||||
|
||||
// A set of blend modes, that never includes OP_OVER (since it's
|
||||
// considered the default, rather than a specific blend mode).
|
||||
@ -808,7 +806,6 @@ class nsDisplayItem : public nsDisplayItemLink {
|
||||
public:
|
||||
typedef mozilla::ContainerLayerParameters ContainerLayerParameters;
|
||||
typedef mozilla::DisplayItemClip DisplayItemClip;
|
||||
typedef mozilla::layers::FrameMetrics FrameMetrics;
|
||||
typedef mozilla::layers::FrameMetrics::ViewID ViewID;
|
||||
typedef mozilla::layers::Layer Layer;
|
||||
typedef mozilla::layers::LayerManager LayerManager;
|
||||
@ -2888,10 +2885,6 @@ public:
|
||||
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE;
|
||||
|
||||
NS_DISPLAY_DECL_NAME("SubDocument", TYPE_SUBDOCUMENT)
|
||||
|
||||
mozilla::UniquePtr<FrameMetrics> ComputeFrameMetrics(Layer* aLayer,
|
||||
const ContainerLayerParameters& aContainerParameters);
|
||||
|
||||
protected:
|
||||
ViewID mScrollParentId;
|
||||
};
|
||||
@ -3018,6 +3011,8 @@ public:
|
||||
// after merging, all the nsDisplayScrollLayers should flatten away.
|
||||
intptr_t GetScrollLayerCount();
|
||||
|
||||
static bool IsConstructingScrollLayerForScrolledFrame(const nsIFrame* aScrolledFrame);
|
||||
|
||||
virtual nsIFrame* GetScrollFrame() { return mScrollFrame; }
|
||||
virtual nsIFrame* GetScrolledFrame() { return mScrolledFrame; }
|
||||
|
||||
@ -3027,19 +3022,6 @@ public:
|
||||
|
||||
bool IsDisplayPortOpaque() { return mDisplayPortContentsOpaque; }
|
||||
|
||||
static FrameMetrics ComputeFrameMetrics(nsIFrame* aForFrame,
|
||||
nsIFrame* aScrollFrame,
|
||||
const nsIFrame* aReferenceFrame,
|
||||
Layer* aLayer,
|
||||
ViewID aScrollParentId,
|
||||
const nsRect& aViewport,
|
||||
bool aForceNullScrollId,
|
||||
bool aIsRoot,
|
||||
const ContainerLayerParameters& aContainerParameters);
|
||||
|
||||
mozilla::UniquePtr<FrameMetrics> ComputeFrameMetrics(Layer* aLayer,
|
||||
const ContainerLayerParameters& aContainerParameters);
|
||||
|
||||
protected:
|
||||
nsRect GetScrolledContentRectToDraw(nsDisplayListBuilder* aBuilder,
|
||||
nsRect* aDisplayPort);
|
||||
|
@ -63,22 +63,6 @@ using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::layout;
|
||||
|
||||
static bool
|
||||
BuildScrollContainerLayers()
|
||||
{
|
||||
static bool sContainerlessScrollingEnabled;
|
||||
static bool sContainerlessScrollingPrefCached = false;
|
||||
|
||||
if (!sContainerlessScrollingPrefCached) {
|
||||
sContainerlessScrollingPrefCached = true;
|
||||
Preferences::AddBoolVarCache(&sContainerlessScrollingEnabled,
|
||||
"layout.async-containerless-scrolling.enabled",
|
||||
true);
|
||||
}
|
||||
|
||||
return !sContainerlessScrollingEnabled;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
//----------nsHTMLScrollFrame-------------------------------------------
|
||||
@ -2902,8 +2886,6 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
(!mIsRoot || aBuilder->RootReferenceFrame()->PresContext() != mOuter->PresContext());
|
||||
}
|
||||
|
||||
mScrollParentID = aBuilder->GetCurrentScrollParentId();
|
||||
|
||||
nsDisplayListCollection scrolledContent;
|
||||
{
|
||||
// Note that setting the current scroll parent id here means that positioned children
|
||||
@ -2972,7 +2954,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
// scroll layer count. The display lists depend on this.
|
||||
ScrollLayerWrapper wrapper(mOuter, mScrolledFrame);
|
||||
|
||||
if (mShouldBuildScrollableLayer && BuildScrollContainerLayers()) {
|
||||
if (mShouldBuildScrollableLayer) {
|
||||
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
|
||||
|
||||
// For root scrollframes in documents where the CSS viewport has been
|
||||
@ -3014,31 +2996,6 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
scrolledContent.MoveTo(aLists);
|
||||
}
|
||||
|
||||
void
|
||||
ScrollFrameHelper::ComputeFrameMetrics(Layer* aLayer,
|
||||
nsIFrame* aContainerReferenceFrame,
|
||||
const ContainerLayerParameters& aParameters,
|
||||
nsRect* aClipRect,
|
||||
nsTArray<FrameMetrics>* aOutput) const
|
||||
{
|
||||
if (!mShouldBuildScrollableLayer || BuildScrollContainerLayers()) {
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(mScrolledFrame->GetContent());
|
||||
|
||||
nsRect viewport = mScrollPort +
|
||||
mOuter->GetOffsetToCrossDoc(aContainerReferenceFrame);
|
||||
|
||||
if (!(mIsRoot && mOuter->PresContext()->PresShell()->GetIsViewportOverridden())) {
|
||||
*aClipRect = viewport;
|
||||
}
|
||||
*aOutput->AppendElement() =
|
||||
nsDisplayScrollLayer::ComputeFrameMetrics(mScrolledFrame, mOuter,
|
||||
aContainerReferenceFrame, aLayer, mScrollParentID,
|
||||
viewport, false, false, aParameters);
|
||||
}
|
||||
|
||||
bool
|
||||
ScrollFrameHelper::IsRectNearlyVisible(const nsRect& aRect) const
|
||||
{
|
||||
|
@ -31,9 +31,6 @@ class nsIScrollPositionListener;
|
||||
struct ScrollReflowState;
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
class Layer;
|
||||
}
|
||||
namespace layout {
|
||||
class ScrollbarActivity;
|
||||
}
|
||||
@ -46,8 +43,6 @@ public:
|
||||
typedef nsIFrame::Sides Sides;
|
||||
typedef mozilla::CSSIntPoint CSSIntPoint;
|
||||
typedef mozilla::layout::ScrollbarActivity ScrollbarActivity;
|
||||
typedef mozilla::layers::FrameMetrics FrameMetrics;
|
||||
typedef mozilla::layers::Layer Layer;
|
||||
|
||||
class AsyncScroll;
|
||||
class AsyncSmoothMSDScroll;
|
||||
@ -330,10 +325,6 @@ public:
|
||||
}
|
||||
}
|
||||
bool WantAsyncScroll() const;
|
||||
void ComputeFrameMetrics(Layer* aLayer, nsIFrame* aContainerReferenceFrame,
|
||||
const ContainerLayerParameters& aParameters,
|
||||
nsRect* aClipRect,
|
||||
nsTArray<FrameMetrics>* aOutput) const;
|
||||
|
||||
// nsIScrollbarMediator
|
||||
void ScrollByPage(nsScrollbarFrame* aScrollbar, int32_t aDirection);
|
||||
@ -398,8 +389,6 @@ public:
|
||||
// The scroll position where we last updated image visibility.
|
||||
nsPoint mLastUpdateImagesPos;
|
||||
|
||||
FrameMetrics::ViewID mScrollParentID;
|
||||
|
||||
bool mNeverHasVerticalScrollbar:1;
|
||||
bool mNeverHasHorizontalScrollbar:1;
|
||||
bool mHasVerticalScrollbar:1;
|
||||
@ -719,13 +708,6 @@ public:
|
||||
virtual bool WantAsyncScroll() const MOZ_OVERRIDE {
|
||||
return mHelper.WantAsyncScroll();
|
||||
}
|
||||
virtual void ComputeFrameMetrics(Layer* aLayer, nsIFrame* aContainerReferenceFrame,
|
||||
const ContainerLayerParameters& aParameters,
|
||||
nsRect* aClipRect,
|
||||
nsTArray<FrameMetrics>* aOutput) const MOZ_OVERRIDE {
|
||||
mHelper.ComputeFrameMetrics(aLayer, aContainerReferenceFrame,
|
||||
aParameters, aClipRect, aOutput);
|
||||
}
|
||||
|
||||
// nsIStatefulFrame
|
||||
NS_IMETHOD SaveState(nsPresState** aState) MOZ_OVERRIDE {
|
||||
@ -1065,13 +1047,6 @@ public:
|
||||
virtual bool WantAsyncScroll() const MOZ_OVERRIDE {
|
||||
return mHelper.WantAsyncScroll();
|
||||
}
|
||||
virtual void ComputeFrameMetrics(Layer* aLayer, nsIFrame* aContainerReferenceFrame,
|
||||
const ContainerLayerParameters& aParameters,
|
||||
nsRect* aClipRect,
|
||||
nsTArray<FrameMetrics>* aOutput) const MOZ_OVERRIDE {
|
||||
mHelper.ComputeFrameMetrics(aLayer, aContainerReferenceFrame,
|
||||
aParameters, aClipRect, aOutput);
|
||||
}
|
||||
|
||||
// nsIStatefulFrame
|
||||
NS_IMETHOD SaveState(nsPresState** aState) MOZ_OVERRIDE {
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "mozilla/gfx/Point.h"
|
||||
#include "nsIScrollbarMediator.h"
|
||||
#include "Units.h"
|
||||
#include "FrameMetrics.h"
|
||||
|
||||
#define NS_DEFAULT_VERTICAL_SCROLL_DISTANCE 3
|
||||
#define NS_DEFAULT_HORIZONTAL_SCROLL_DISTANCE 5
|
||||
@ -28,13 +27,6 @@ class nsIContent;
|
||||
class nsRenderingContext;
|
||||
class nsIAtom;
|
||||
|
||||
namespace mozilla {
|
||||
struct ContainerLayerParameters;
|
||||
namespace layers {
|
||||
class Layer;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface for frames that are scrollable. This interface exposes
|
||||
* APIs for examining scroll state, observing changes to scroll state,
|
||||
@ -43,8 +35,6 @@ class Layer;
|
||||
class nsIScrollableFrame : public nsIScrollbarMediator {
|
||||
public:
|
||||
typedef mozilla::CSSIntPoint CSSIntPoint;
|
||||
typedef mozilla::ContainerLayerParameters ContainerLayerParameters;
|
||||
typedef mozilla::layers::FrameMetrics FrameMetrics;
|
||||
|
||||
NS_DECL_QUERYFRAME_TARGET(nsIScrollableFrame)
|
||||
|
||||
@ -350,15 +340,6 @@ public:
|
||||
* scroll frame.
|
||||
*/
|
||||
virtual bool WantAsyncScroll() const = 0;
|
||||
/**
|
||||
* aLayer's animated geometry root is this frame. If there needs to be a
|
||||
* FrameMetrics contributed by this frame, append it to aOutput.
|
||||
*/
|
||||
virtual void ComputeFrameMetrics(mozilla::layers::Layer* aLayer,
|
||||
nsIFrame* aContainerReferenceFrame,
|
||||
const ContainerLayerParameters& aParameters,
|
||||
nsRect* aOutClipRect,
|
||||
nsTArray<FrameMetrics>* aOutput) const = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,10 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<div style="width:400px; height:500px; overflow:hidden; border:2px solid black">
|
||||
<div style="width:300px; height:800px; overflow:hidden; border:2px solid blue; margin-top:-50px">
|
||||
<div style="height:450px"></div>
|
||||
<div style="height:200px; background:purple"></div>
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
@ -1,17 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html reftest-async-scroll>
|
||||
<body>
|
||||
<!-- Test that nested active scrolling elements work -->
|
||||
<div style="width:400px; height:500px; overflow:hidden; border:2px solid black"
|
||||
reftest-displayport-x="0" reftest-displayport-y="0"
|
||||
reftest-displayport-w="800" reftest-displayport-h="2000"
|
||||
reftest-async-scroll-x="0" reftest-async-scroll-y="50">
|
||||
<div style="width:300px; height:800px; overflow:hidden; border:2px solid blue"
|
||||
reftest-displayport-x="0" reftest-displayport-y="0"
|
||||
reftest-displayport-w="800" reftest-displayport-h="2000"
|
||||
reftest-async-scroll-x="0" reftest-async-scroll-y="50">
|
||||
<div style="height:500px"></div>
|
||||
<div style="height:200px; background:purple"></div>
|
||||
</div>
|
||||
</div>
|
||||
</html>
|
@ -1,26 +1,10 @@
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == bg-fixed-1.html bg-fixed-1-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == bg-fixed-cover-1.html bg-fixed-cover-1-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == bg-fixed-cover-2.html bg-fixed-cover-2-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == element-1.html element-1-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == nested-1.html nested-1-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == position-fixed-1.html position-fixed-1-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == position-fixed-2.html position-fixed-2-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == position-fixed-cover-1.html position-fixed-cover-1-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == position-fixed-cover-2.html position-fixed-cover-2-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == position-fixed-cover-3.html position-fixed-cover-3-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == split-layers-1.html split-layers-1-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == split-layers-multi-scrolling-1.html split-layers-multi-scrolling-1-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == split-opacity-layers-1.html split-opacity-layers-1-ref.html
|
||||
|
||||
pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == bg-fixed-1.html bg-fixed-1-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == bg-fixed-cover-1.html bg-fixed-cover-1-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == bg-fixed-cover-2.html bg-fixed-cover-2-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == element-1.html element-1-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-1.html position-fixed-1-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-2.html position-fixed-2-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-cover-1.html position-fixed-cover-1-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-cover-2.html position-fixed-cover-2-ref.html
|
||||
pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-cover-3.html position-fixed-cover-3-ref.html
|
||||
|
||||
skip-if(!asyncPanZoom) == bg-fixed-1.html bg-fixed-1-ref.html
|
||||
skip-if(!asyncPanZoom) == bg-fixed-cover-1.html bg-fixed-cover-1-ref.html
|
||||
skip-if(!asyncPanZoom) == bg-fixed-cover-2.html bg-fixed-cover-2-ref.html
|
||||
skip-if(!asyncPanZoom) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html
|
||||
skip-if(!asyncPanZoom) == element-1.html element-1-ref.html
|
||||
skip-if(!asyncPanZoom) == position-fixed-1.html position-fixed-1-ref.html
|
||||
skip-if(!asyncPanZoom) == position-fixed-2.html position-fixed-2-ref.html
|
||||
skip-if(!asyncPanZoom) == position-fixed-cover-1.html position-fixed-cover-1-ref.html
|
||||
skip-if(!asyncPanZoom) == position-fixed-cover-2.html position-fixed-cover-2-ref.html
|
||||
skip-if(!asyncPanZoom) == position-fixed-cover-3.html position-fixed-cover-3-ref.html
|
||||
|
@ -1,13 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<!-- Test that element content scrolls asynchronously even when content
|
||||
has to be split into separate layers with non-scrolling content in
|
||||
between -->
|
||||
<div style="width:400px; height:500px; overflow:hidden; border:2px solid black">
|
||||
<div style="height:450px"></div>
|
||||
<div style="height:100px; width:200px; float:left; background:purple"></div>
|
||||
<div style="left:200px; top:0; height:800px; width:300px; float:left; background:yellow; position:absolute; z-index:1;"></div>
|
||||
<div style="height:100px; width:200px; float:left; background:purple; position:relative; z-index:2;"></div>
|
||||
</div>
|
||||
</html>
|
@ -1,16 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html reftest-async-scroll>
|
||||
<body>
|
||||
<!-- Test that element content scrolls asynchronously even when content
|
||||
has to be split into separate layers with non-scrolling content in
|
||||
between -->
|
||||
<div style="width:400px; height:500px; overflow:hidden; border:2px solid black"
|
||||
reftest-displayport-x="0" reftest-displayport-y="0"
|
||||
reftest-displayport-w="800" reftest-displayport-h="2000"
|
||||
reftest-async-scroll-x="0" reftest-async-scroll-y="50">
|
||||
<div style="height:500px"></div>
|
||||
<div style="height:100px; width:200px; float:left; background:purple"></div>
|
||||
<div style="left:200px; top:0; height:800px; width:300px; float:left; background:yellow; position:absolute; z-index:1;"></div>
|
||||
<div style="height:100px; width:200px; float:left; background:purple; position:relative; z-index:2;"></div>
|
||||
</div>
|
||||
|
@ -1,14 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<!-- Test that element content scrolls asynchronously even when content
|
||||
has to be split into separate layers with non-scrolling content in
|
||||
between -->
|
||||
<div style="width:400px; height:500px; overflow:hidden; border:2px solid black; margin-top:-50px;">
|
||||
<div style="height:450px"></div>
|
||||
<div style="height:100px; width:200px; float:left; background:purple"></div>
|
||||
<div style="left:200px; top:-50px; height:800px; width:300px; float:left; background:yellow; position:absolute; z-index:1;"></div>
|
||||
<div style="height:100px; width:200px; float:left; background:purple; position:relative; z-index:2;"></div>
|
||||
</div>
|
||||
</html>
|
||||
|
@ -1,19 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html reftest-async-scroll
|
||||
reftest-displayport-x="0" reftest-displayport-y="0"
|
||||
reftest-displayport-w="800" reftest-displayport-h="2000"
|
||||
reftest-async-scroll-x="0" reftest-async-scroll-y="50">
|
||||
<body style="height:3000px; overflow:hidden">
|
||||
<!-- Test that element content scrolls asynchronously even when content
|
||||
has to be split into separate layers with non-scrolling content in
|
||||
between -->
|
||||
<div style="width:400px; height:500px; overflow:hidden; border:2px solid black"
|
||||
reftest-displayport-x="0" reftest-displayport-y="0"
|
||||
reftest-displayport-w="800" reftest-displayport-h="2000"
|
||||
reftest-async-scroll-x="0" reftest-async-scroll-y="50">
|
||||
<div style="height:500px"></div>
|
||||
<div style="height:100px; width:200px; float:left; background:purple"></div>
|
||||
<div style="left:200px; top:0; height:800px; width:300px; float:left; background:yellow; position:absolute; z-index:1;"></div>
|
||||
<div style="height:100px; width:200px; float:left; background:purple; position:relative; z-index:2;"></div>
|
||||
</div>
|
||||
|
@ -1,12 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<div style="width:400px; height:500px; overflow:hidden; border:2px solid black">
|
||||
<div style="height:450px"></div>
|
||||
<div style="height:100px; width:200px; float:left; background:purple"></div>
|
||||
<div style="opacity:0.5">
|
||||
<div style="left:200px; top:0; height:800px; width:300px; float:left; background:yellow; position:absolute; z-index:1;"></div>
|
||||
<div style="height:100px; width:200px; float:left; background:purple; position:relative; z-index:2;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,15 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html reftest-async-scroll>
|
||||
<body>
|
||||
<div style="width:400px; height:500px; overflow:hidden; border:2px solid black"
|
||||
reftest-displayport-x="0" reftest-displayport-y="0"
|
||||
reftest-displayport-w="800" reftest-displayport-h="2000"
|
||||
reftest-async-scroll-x="0" reftest-async-scroll-y="50">
|
||||
<div style="height:500px"></div>
|
||||
<div style="height:100px; width:200px; float:left; background:purple"></div>
|
||||
<div style="opacity:0.5">
|
||||
<div style="left:200px; top:0; height:800px; width:300px; float:left; background:yellow; position:absolute; z-index:1;"></div>
|
||||
<div style="height:100px; width:200px; float:left; background:purple; position:relative; z-index:2;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -426,9 +426,6 @@ pref("media.audio_data.enabled", false);
|
||||
// Whether to use async panning and zooming
|
||||
pref("layers.async-pan-zoom.enabled", false);
|
||||
|
||||
// Whether to enable containerless async scrolling
|
||||
pref("layout.async-containerless-scrolling.enabled", true);
|
||||
|
||||
// APZ preferences. For documentation/details on what these prefs do, check
|
||||
// gfx/layers/apz/src/AsyncPanZoomController.cpp.
|
||||
pref("apz.allow_checkerboarding", true);
|
||||
|
Loading…
Reference in New Issue
Block a user