本文整理汇总了C++中ContainerLayer::Manager方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainerLayer::Manager方法的具体用法?C++ ContainerLayer::Manager怎么用?C++ ContainerLayer::Manager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContainerLayer
的用法示例。
在下文中一共展示了ContainerLayer::Manager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsTempLayerManager
already_AddRefed<Layer>
RenderFrameParent::BuildLayer(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
LayerManager* aManager,
const nsIntRect& aVisibleRect)
{
NS_ABORT_IF_FALSE(aFrame,
"makes no sense to have a shadow tree without a frame");
NS_ABORT_IF_FALSE(!mContainer ||
IsTempLayerManager(aManager) ||
mContainer->Manager() == aManager,
"retaining manager changed out from under us ... HELP!");
if (mContainer && mContainer->Manager() != aManager) {
// This can happen if aManager is a "temporary" manager, or if the
// widget's layer manager changed out from under us. We need to
// FIXME handle the former case somehow, probably with an API to
// draw a manager's subtree. The latter is bad bad bad, but the
// the NS_ABORT_IF_FALSE() above will flag it. Returning NULL
// here will just cause the shadow subtree not to be rendered.
return nsnull;
}
if (mContainer) {
ClearContainer(mContainer);
}
ContainerLayer* shadowRoot = GetRootLayer();
if (!shadowRoot) {
mContainer = nsnull;
return nsnull;
}
NS_ABORT_IF_FALSE(!shadowRoot || shadowRoot->Manager() == aManager,
"retaining manager changed out from under us ... HELP!");
// Wrap the shadow layer tree in mContainer.
if (!mContainer) {
mContainer = aManager->CreateContainerLayer();
}
NS_ABORT_IF_FALSE(!mContainer->GetFirstChild(),
"container of shadow tree shouldn't have a 'root' here");
mContainer->InsertAfter(shadowRoot, nsnull);
AssertInTopLevelChromeDoc(mContainer, aFrame);
ViewTransform transform;
TransformShadowTree(aBuilder, mFrameLoader, aFrame, shadowRoot, transform);
mContainer->SetClipRect(nsnull);
if (mFrameLoader->AsyncScrollEnabled()) {
const nsContentView* view = GetContentView(FrameMetrics::ROOT_SCROLL_ID);
BuildBackgroundPatternFor(mContainer,
shadowRoot,
view->GetViewConfig(),
mBackgroundColor,
aManager, aFrame);
}
mContainer->SetVisibleRegion(aVisibleRect);
return nsRefPtr<Layer>(mContainer).forget();
}