Backed out changeset 442b037713d6 (bug 1389138)

This commit is contained in:
Sebastian Hengst 2017-08-17 21:08:20 +02:00
Родитель 6c9b12dc58
Коммит 953d244299
3 изменённых файлов: 7 добавлений и 11 удалений

Просмотреть файл

@ -21,6 +21,7 @@ ScrollingLayersHelper::ScrollingLayersHelper(WebRenderLayer* aLayer,
: mLayer(aLayer)
, mBuilder(&aBuilder)
, mPushedLayerLocalClip(false)
, mClipsPushed(0)
{
if (!mLayer->WrManager()->AsyncPanZoomEnabled()) {
// If APZ is disabled then we don't need to push the scrolling clips. We
@ -92,6 +93,7 @@ ScrollingLayersHelper::ScrollingLayersHelper(nsDisplayItem* aItem,
: mLayer(nullptr)
, mBuilder(&aBuilder)
, mPushedLayerLocalClip(false)
, mClipsPushed(0)
{
DefineAndPushChain(aItem->GetClipChain(), aBuilder, aStackingContext,
aItem->Frame()->PresContext()->AppUnitsPerDevPixel(), aCache);
@ -136,7 +138,7 @@ ScrollingLayersHelper::DefineAndPushChain(const DisplayItemClipChain* aChain,
// Finally, push the clip onto the WR stack
MOZ_ASSERT(clipId);
aBuilder.PushClip(clipId.value());
mPushedClips.push_back(wr::ScrollOrClipId(clipId.value()));
mClipsPushed++;
}
bool
@ -211,12 +213,10 @@ ScrollingLayersHelper::PushLayerClip(const LayerClip& aClip,
ScrollingLayersHelper::~ScrollingLayersHelper()
{
if (!mLayer) {
// For layers-free mode.
while (!mPushedClips.empty()) {
wr::ScrollOrClipId id = mPushedClips.back();
MOZ_ASSERT(id.is<wr::WrClipId>());
// For layers-free mode
while (mClipsPushed > 0) {
mBuilder->PopClip();
mPushedClips.pop_back();
mClipsPushed--;
}
return;
}

Просмотреть файл

@ -51,7 +51,7 @@ private:
WebRenderLayer* mLayer;
wr::DisplayListBuilder* mBuilder;
bool mPushedLayerLocalClip;
std::vector<wr::ScrollOrClipId> mPushedClips;
int mClipsPushed;
};
} // namespace layers

Просмотреть файл

@ -6,7 +6,6 @@
#ifndef GFX_WEBRENDERTYPES_H
#define GFX_WEBRENDERTYPES_H
#include "FrameMetrics.h"
#include "mozilla/webrender/webrender_ffi.h"
#include "mozilla/Maybe.h"
#include "mozilla/gfx/Matrix.h"
@ -15,7 +14,6 @@
#include "mozilla/layers/LayersTypes.h"
#include "mozilla/PodOperations.h"
#include "mozilla/Range.h"
#include "mozilla/Variant.h"
#include "Units.h"
#include "RoundedRect.h"
#include "nsStyleConsts.h"
@ -664,8 +662,6 @@ struct WrClipId {
}
};
typedef Variant<layers::FrameMetrics::ViewID, WrClipId> ScrollOrClipId;
} // namespace wr
} // namespace mozilla