mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 1622360 - Remove rest of the RenderRootBoundary stuff. r=botond
Depends on D67866 Differential Revision: https://phabricator.services.mozilla.com/D67867 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
dd636055af
commit
f6825449bf
@ -258,7 +258,6 @@ EXPORTS.mozilla.layers += [
|
||||
'wr/ClipManager.h',
|
||||
'wr/DisplayItemCache.h',
|
||||
'wr/IpcResourceUpdateQueue.h',
|
||||
'wr/RenderRootBoundary.h',
|
||||
'wr/RenderRootStateManager.h',
|
||||
'wr/RenderRootTypes.h',
|
||||
'wr/StackingContextHelper.h',
|
||||
|
@ -1,96 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef GFX_RENDERROOTBOUNDARY_H
|
||||
#define GFX_RENDERROOTBOUNDARY_H
|
||||
|
||||
#include "mozilla/webrender/WebRenderTypes.h"
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
// clang-format off
|
||||
// A display list can have multiple nsDisplayRenderRoot instances in it, one
|
||||
// at each point that the display list transitions from being in one render root
|
||||
// to another. In particular, this means that a display list can transition
|
||||
// from e.g. the "Default" render root to the "Content" render root multiple
|
||||
// times. When we process this display list in WebRenderCommandBuilder, we build
|
||||
// a WebRenderScrollData for each render root, and they are "connected" by the
|
||||
// referent render root property on the WebRenderLayerScrollData instances.
|
||||
// (This is similar to how the layers id referent property works, i.e. a WRLSD
|
||||
// item with a referent is an attachment point for a subtree from a different
|
||||
// render root.) But given that there are multiple transitions to the same
|
||||
// "child" render root, we need an additional data point to uniquely identify
|
||||
// each of the transitions, so that we can attach the correct scroll data
|
||||
// subtree at each transition. Failure to uniquely identify the transitions
|
||||
// means that the entire "child" render root's scroll data tree will get
|
||||
// attached at each transition. The RenderRootBoundary class serves this
|
||||
// purpose.
|
||||
//
|
||||
// Example time! Consider the following display list structure:
|
||||
//
|
||||
// R // root of the display list
|
||||
// / \ //
|
||||
// A B // items in Default render root that generate scroll data
|
||||
// / / \ //
|
||||
// C D E // nsDisplayRenderRoot items transitioning to content
|
||||
// / \ / //
|
||||
// F G H // items in Content render root that generate scroll data
|
||||
//
|
||||
// In this example, the Default render root WebRenderScrollData will contain
|
||||
// 6 WRLSD items, one for each of R, A, B, C, D, E. Of these, C, D, and E will
|
||||
// have mReferentRenderRoot properties set. The WebRenderScrollData for the
|
||||
// Content render root will end up looking like this:
|
||||
//
|
||||
// Dummy root //
|
||||
// / \ //
|
||||
// C-Root E-Root //
|
||||
// / | | //
|
||||
// F G H //
|
||||
//
|
||||
// The RenderRootBoundary item on C will point to C-Root, and likewise for E.
|
||||
// The RenderRootBoundary item on D will be valid, but there will be no
|
||||
// corresponding subtree in the Content-side WebRenderScrollData. C-Root and
|
||||
// E-Root are created via WebRenderScrollDataCollection::AppendWrapper, and
|
||||
// have their mBoundaryRoot property set to the same RenderRootBoundary value
|
||||
// as the mReferentRenderRoot properties from C and E respectively.
|
||||
// clang-format on
|
||||
class RenderRootBoundary {
|
||||
public:
|
||||
explicit RenderRootBoundary(wr::RenderRoot aChildType)
|
||||
: mChildType(aChildType) {
|
||||
static uint64_t sCounter = 0;
|
||||
mId = ++sCounter;
|
||||
}
|
||||
|
||||
wr::RenderRoot GetChildType() const { return mChildType; }
|
||||
|
||||
bool operator==(const RenderRootBoundary& aOther) const {
|
||||
return mChildType == aOther.mChildType && mId == aOther.mId;
|
||||
}
|
||||
|
||||
friend struct IPC::ParamTraits<RenderRootBoundary>;
|
||||
// constructor for IPC
|
||||
RenderRootBoundary() = default;
|
||||
|
||||
std::string ToString() const {
|
||||
std::stringstream str;
|
||||
str << "childType=" << (int)mChildType << "; id=" << mId;
|
||||
return str.str();
|
||||
}
|
||||
|
||||
private:
|
||||
wr::RenderRoot mChildType;
|
||||
// The id is what distinguishes different transition points within a display
|
||||
// list (i.e. what would be different in C, D, and E in the example above).
|
||||
uint64_t mId;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // GFX_RENDERROOTBOUNDARY_H
|
@ -9,7 +9,6 @@
|
||||
|
||||
#include "mozilla/webrender/WebRenderAPI.h"
|
||||
#include "mozilla/layers/ClipManager.h"
|
||||
#include "mozilla/layers/RenderRootBoundary.h"
|
||||
#include "mozilla/layers/WebRenderMessages.h"
|
||||
#include "mozilla/layers/WebRenderScrollData.h"
|
||||
#include "mozilla/layers/WebRenderUserData.h"
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "mozilla/layers/LayerAttributes.h"
|
||||
#include "mozilla/layers/LayersMessageUtils.h"
|
||||
#include "mozilla/layers/FocusTarget.h"
|
||||
#include "mozilla/layers/RenderRootBoundary.h"
|
||||
#include "mozilla/layers/WebRenderMessageUtils.h"
|
||||
#include "mozilla/webrender/WebRenderTypes.h"
|
||||
#include "mozilla/HashTable.h"
|
||||
@ -97,11 +96,6 @@ class WebRenderLayerScrollData final {
|
||||
void SetReferentId(LayersId aReferentId) { mReferentId = Some(aReferentId); }
|
||||
Maybe<LayersId> GetReferentId() const { return mReferentId; }
|
||||
|
||||
Maybe<RenderRootBoundary> GetReferentRenderRoot() const {
|
||||
return Nothing();
|
||||
}
|
||||
Maybe<RenderRootBoundary> GetBoundaryRoot() const { return Nothing(); }
|
||||
|
||||
void SetScrollbarData(const ScrollbarData& aData) { mScrollbarData = aData; }
|
||||
const ScrollbarData& GetScrollbarData() const { return mScrollbarData; }
|
||||
void SetScrollbarAnimationId(const uint64_t& aId) {
|
||||
@ -261,10 +255,6 @@ class WebRenderScrollData final {
|
||||
|
||||
namespace IPC {
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::layers::RenderRootBoundary>
|
||||
: public PlainOldDataSerializer<mozilla::layers::RenderRootBoundary> {};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::layers::WebRenderLayerScrollData> {
|
||||
typedef mozilla::layers::WebRenderLayerScrollData paramType;
|
||||
|
@ -158,44 +158,6 @@ class MOZ_STACK_CLASS WebRenderScrollDataWrapper final {
|
||||
mLayerIndex + 1, subtreeLastIndex);
|
||||
}
|
||||
|
||||
if (mLayer->GetReferentRenderRoot()) {
|
||||
MOZ_ASSERT(!mLayer->GetReferentId());
|
||||
MOZ_ASSERT(mLayer->GetReferentRenderRoot()->GetChildType() !=
|
||||
mWrRootId.mRenderRoot);
|
||||
|
||||
WRRootId newWrRootId = WRRootId(
|
||||
mWrRootId.mLayersId, mLayer->GetReferentRenderRoot()->GetChildType());
|
||||
const WebRenderScrollData* childData =
|
||||
mUpdater->GetScrollData(newWrRootId);
|
||||
if (!childData) {
|
||||
// The other tree might not exist yet if the scene hasn't been built.
|
||||
return WebRenderScrollDataWrapper(*mUpdater, newWrRootId);
|
||||
}
|
||||
// See the comment above RenderRootBoundary for more context on what's
|
||||
// happening here. We need to fish out the appropriate wrapper root from
|
||||
// inside the dummy root. Note that the wrapper root should always be a
|
||||
// direct descendant of the dummy root, so we can pass
|
||||
// `childData->GetLayerCount()` for the `aContainingSubtreeLastIndex`
|
||||
// parameter below.
|
||||
Maybe<size_t> layerIndex;
|
||||
for (size_t i = 0; i < childData->GetLayerCount(); i++) {
|
||||
const WebRenderLayerScrollData* wrlsd = childData->GetLayerData(i);
|
||||
if (wrlsd->GetBoundaryRoot() == mLayer->GetReferentRenderRoot()) {
|
||||
// found it
|
||||
layerIndex = Some(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!layerIndex) {
|
||||
// It's possible that there's no wrapper root. In that case there are
|
||||
// no descendants
|
||||
return WebRenderScrollDataWrapper(*mUpdater, newWrRootId);
|
||||
}
|
||||
return WebRenderScrollDataWrapper(mUpdater, newWrRootId, childData,
|
||||
*layerIndex,
|
||||
childData->GetLayerCount());
|
||||
}
|
||||
|
||||
// We've run out of descendants. But! If the original layer was a RefLayer,
|
||||
// then it connects to another layer tree and we need to traverse that too.
|
||||
// So return a WebRenderScrollDataWrapper for the root of the child layer
|
||||
@ -326,11 +288,6 @@ class MOZ_STACK_CLASS WebRenderScrollDataWrapper final {
|
||||
Maybe<wr::RenderRoot> GetReferentRenderRoot() const {
|
||||
MOZ_ASSERT(IsValid());
|
||||
|
||||
if (AtBottomLayer()) {
|
||||
if (mLayer->GetReferentRenderRoot()) {
|
||||
return Some(mLayer->GetReferentRenderRoot()->GetChildType());
|
||||
}
|
||||
}
|
||||
return Nothing();
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "mozilla/layers/StackingContextHelper.h"
|
||||
#include "mozilla/webrender/WebRenderAPI.h"
|
||||
#include "mozilla/layers/AnimationInfo.h"
|
||||
#include "mozilla/layers/RenderRootBoundary.h"
|
||||
#include "mozilla/dom/RemoteBrowser.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "nsIFrame.h"
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "mozilla/gfx/UserData.h"
|
||||
#include "mozilla/layers/LayerAttributes.h"
|
||||
#include "mozilla/layers/RenderRootBoundary.h"
|
||||
#include "mozilla/layers/ScrollableLayerGuid.h"
|
||||
#include "nsCSSRenderingBorders.h"
|
||||
#include "nsPresArena.h"
|
||||
|
Loading…
Reference in New Issue
Block a user