зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 20c649cb4a21 (bug 1389138) for bustage at dist/include/mozilla/layers/ScrollingLayersHelper.h:22: class 'FrameMetrics' was previously declared as a struct. r=backout
This commit is contained in:
Родитель
953d244299
Коммит
8b042b8f29
|
@ -51,7 +51,29 @@ ScrollingLayersHelper::ScrollingLayersHelper(WebRenderLayer* aLayer,
|
|||
PushLayerLocalClip(aStackingContext);
|
||||
}
|
||||
|
||||
PushScrollLayer(fm, aStackingContext);
|
||||
if (!fm.IsScrollable()) {
|
||||
continue;
|
||||
}
|
||||
LayerRect contentRect = ViewAs<LayerPixel>(
|
||||
fm.GetExpandedScrollableRect() * fm.GetDevPixelsPerCSSPixel(),
|
||||
PixelCastJustification::WebRenderHasUnitResolution);
|
||||
// TODO: check coordinate systems are sane here
|
||||
LayerRect clipBounds = ViewAs<LayerPixel>(
|
||||
fm.GetCompositionBounds(),
|
||||
PixelCastJustification::MovingDownToChildren);
|
||||
// The content rect that we hand to PushScrollLayer should be relative to
|
||||
// the same origin as the clipBounds that we hand to PushScrollLayer - that
|
||||
// is, both of them should be relative to the stacking context `aStackingContext`.
|
||||
// However, when we get the scrollable rect from the FrameMetrics, the origin
|
||||
// has nothing to do with the position of the frame but instead represents
|
||||
// the minimum allowed scroll offset of the scrollable content. While APZ
|
||||
// uses this to clamp the scroll position, we don't need to send this to
|
||||
// WebRender at all. Instead, we take the position from the composition
|
||||
// bounds.
|
||||
contentRect.MoveTo(clipBounds.TopLeft());
|
||||
mBuilder->PushScrollLayer(fm.GetScrollId(),
|
||||
aStackingContext.ToRelativeLayoutRect(contentRect),
|
||||
aStackingContext.ToRelativeLayoutRect(clipBounds));
|
||||
}
|
||||
|
||||
// The scrolled clip on the layer is "inside" all of the scrollable metadatas
|
||||
|
@ -141,36 +163,6 @@ ScrollingLayersHelper::DefineAndPushChain(const DisplayItemClipChain* aChain,
|
|||
mClipsPushed++;
|
||||
}
|
||||
|
||||
bool
|
||||
ScrollingLayersHelper::PushScrollLayer(const FrameMetrics& aMetrics,
|
||||
const StackingContextHelper& aStackingContext)
|
||||
{
|
||||
if (!aMetrics.IsScrollable()) {
|
||||
return false;
|
||||
}
|
||||
LayerRect contentRect = ViewAs<LayerPixel>(
|
||||
aMetrics.GetExpandedScrollableRect() * aMetrics.GetDevPixelsPerCSSPixel(),
|
||||
PixelCastJustification::WebRenderHasUnitResolution);
|
||||
// TODO: check coordinate systems are sane here
|
||||
LayerRect clipBounds = ViewAs<LayerPixel>(
|
||||
aMetrics.GetCompositionBounds(),
|
||||
PixelCastJustification::MovingDownToChildren);
|
||||
// The content rect that we hand to PushScrollLayer should be relative to
|
||||
// the same origin as the clipBounds that we hand to PushScrollLayer - that
|
||||
// is, both of them should be relative to the stacking context `aStackingContext`.
|
||||
// However, when we get the scrollable rect from the FrameMetrics, the origin
|
||||
// has nothing to do with the position of the frame but instead represents
|
||||
// the minimum allowed scroll offset of the scrollable content. While APZ
|
||||
// uses this to clamp the scroll position, we don't need to send this to
|
||||
// WebRender at all. Instead, we take the position from the composition
|
||||
// bounds.
|
||||
contentRect.MoveTo(clipBounds.TopLeft());
|
||||
mBuilder->PushScrollLayer(aMetrics.GetScrollId(),
|
||||
aStackingContext.ToRelativeLayoutRect(contentRect),
|
||||
aStackingContext.ToRelativeLayoutRect(clipBounds));
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
ScrollingLayersHelper::PushLayerLocalClip(const StackingContextHelper& aStackingContext)
|
||||
{
|
||||
|
|
|
@ -19,7 +19,6 @@ class DisplayListBuilder;
|
|||
|
||||
namespace layers {
|
||||
|
||||
class FrameMetrics;
|
||||
struct LayerClip;
|
||||
class StackingContextHelper;
|
||||
class WebRenderLayer;
|
||||
|
@ -42,8 +41,6 @@ private:
|
|||
const StackingContextHelper& aStackingContext,
|
||||
int32_t aAppUnitsPerDevPixel,
|
||||
WebRenderLayerManager::ClipIdMap& aCache);
|
||||
bool PushScrollLayer(const FrameMetrics& aMetrics,
|
||||
const StackingContextHelper& aStackingContext);
|
||||
void PushLayerLocalClip(const StackingContextHelper& aStackingContext);
|
||||
void PushLayerClip(const LayerClip& aClip,
|
||||
const StackingContextHelper& aSc);
|
||||
|
|
Загрузка…
Ссылка в новой задаче