本文整理汇总了C++中nsDisplayList::AppendToTop方法的典型用法代码示例。如果您正苦于以下问题:C++ nsDisplayList::AppendToTop方法的具体用法?C++ nsDisplayList::AppendToTop怎么用?C++ nsDisplayList::AppendToTop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsDisplayList
的用法示例。
在下文中一共展示了nsDisplayList::AppendToTop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFrameMetrics
// Use shadow layer tree to build display list for the browser's frame.
static void
BuildListForLayer(Layer* aLayer,
nsFrameLoader* aRootFrameLoader,
const gfx3DMatrix& aTransform,
nsDisplayListBuilder* aBuilder,
nsDisplayList& aShadowTree,
nsIFrame* aSubdocFrame)
{
const FrameMetrics* metrics = GetFrameMetrics(aLayer);
gfx3DMatrix transform;
if (metrics && metrics->IsScrollable()) {
const ViewID scrollId = metrics->mScrollId;
// We need to figure out the bounds of the scrollable region using the
// shadow layer tree from the remote process. The metrics viewport is
// defined based on all the transformations of its parent layers and
// the scale of the current layer.
// Calculate transform for this layer.
nsContentView* view =
aRootFrameLoader->GetCurrentRemoteFrame()->GetContentView(scrollId);
// XXX why don't we include aLayer->GetTransform() in the inverse-scale here?
// This seems wrong, but it doesn't seem to cause bugs!
gfx3DMatrix applyTransform = ComputeShadowTreeTransform(
aSubdocFrame, aRootFrameLoader, metrics, view->GetViewConfig(),
1 / GetXScale(aTransform), 1 / GetYScale(aTransform));
gfx3DMatrix layerTransform;
To3DMatrix(aLayer->GetTransform(), layerTransform);
transform = applyTransform * layerTransform * aTransform;
// As mentioned above, bounds calculation also depends on the scale
// of this layer.
gfx3DMatrix tmpTransform = aTransform;
Scale(tmpTransform, GetXScale(applyTransform), GetYScale(applyTransform));
// Calculate rect for this layer based on aTransform.
nsRect bounds;
{
bounds = CSSRect::ToAppUnits(metrics->mViewport);
nscoord auPerDevPixel = aSubdocFrame->PresContext()->AppUnitsPerDevPixel();
ApplyTransform(bounds, tmpTransform, auPerDevPixel);
}
aShadowTree.AppendToTop(
new (aBuilder) nsDisplayRemoteShadow(aBuilder, aSubdocFrame, bounds, scrollId));
} else {
gfx3DMatrix layerTransform;
To3DMatrix(aLayer->GetTransform(), layerTransform);
transform = layerTransform * aTransform;
}
for (Layer* child = aLayer->GetFirstChild(); child;
child = child->GetNextSibling()) {
BuildListForLayer(child, aRootFrameLoader, transform,
aBuilder, aShadowTree, aSubdocFrame);
}
}