本文整理汇总了C++中RenderLayerBacking::backingStoreMemoryEstimate方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderLayerBacking::backingStoreMemoryEstimate方法的具体用法?C++ RenderLayerBacking::backingStoreMemoryEstimate怎么用?C++ RenderLayerBacking::backingStoreMemoryEstimate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderLayerBacking
的用法示例。
在下文中一共展示了RenderLayerBacking::backingStoreMemoryEstimate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
PassRefPtr<TypeBuilder::LayerTree::Layer> InspectorLayerTreeAgent::buildObjectForLayer(ErrorString* errorString, RenderLayer* renderLayer)
{
RenderObject* renderer = &renderLayer->renderer();
RenderLayerBacking* backing = renderLayer->backing();
Node* node = renderer->node();
bool isReflection = renderLayer->isReflection();
bool isGenerated = (isReflection ? renderer->parent() : renderer)->isBeforeOrAfterContent();
bool isAnonymous = renderer->isAnonymous();
if (renderer->isRenderView())
node = &renderer->document();
else if (isReflection && isGenerated)
node = renderer->parent()->generatingElement();
else if (isGenerated)
node = renderer->generatingNode();
else if (isReflection || isAnonymous)
node = renderer->parent()->element();
// Basic set of properties.
RefPtr<TypeBuilder::LayerTree::Layer> layerObject = TypeBuilder::LayerTree::Layer::create()
.setLayerId(bind(renderLayer))
.setNodeId(idForNode(errorString, node))
.setBounds(buildObjectForIntRect(renderer->absoluteBoundingBoxRect()))
.setMemory(backing->backingStoreMemoryEstimate())
.setCompositedBounds(buildObjectForIntRect(enclosingIntRect(backing->compositedBounds())))
.setPaintCount(backing->graphicsLayer()->repaintCount());
if (node && node->shadowHost())
layerObject->setIsInShadowTree(true);
if (isReflection)
layerObject->setIsReflection(true);
if (isGenerated) {
if (isReflection)
renderer = renderer->parent();
layerObject->setIsGeneratedContent(true);
layerObject->setPseudoElementId(bindPseudoElement(toPseudoElement(renderer->node())));
if (renderer->isBeforeContent())
layerObject->setPseudoElement("before");
else if (renderer->isAfterContent())
layerObject->setPseudoElement("after");
}
// FIXME: RenderView is now really anonymous but don't tell about it to the frontend before making sure it can handle it.
if (isAnonymous && !renderer->isRenderView()) {
layerObject->setIsAnonymous(true);
if (RenderStyle* style = renderer->style()) {
if (style->styleType() == FIRST_LETTER)
layerObject->setPseudoElement("first-letter");
else if (style->styleType() == FIRST_LINE)
layerObject->setPseudoElement("first-line");
}
}
return layerObject;
}
示例2:
PassRefPtr<TypeBuilder::LayerTree::Layer> InspectorLayerTreeAgent::buildObjectForLayer(RenderLayer* renderLayer)
{
bool isComposited = renderLayer->isComposited();
// Basic set of properties.
RefPtr<TypeBuilder::LayerTree::Layer> layerObject = TypeBuilder::LayerTree::Layer::create()
.setLayerId(bind(renderLayer))
.setBounds(buildObjectForIntRect(enclosingIntRect(renderLayer->localBoundingBox())))
.setIsComposited(isComposited);
// Optional properties for composited layers only.
if (isComposited) {
RenderLayerBacking* backing = renderLayer->backing();
layerObject->setMemory(backing->backingStoreMemoryEstimate());
layerObject->setCompositedBounds(buildObjectForIntRect(backing->compositedBounds()));
layerObject->setPaintCount(backing->graphicsLayer()->repaintCount());
}
// Process children layers.
RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > childrenArray = TypeBuilder::Array<TypeBuilder::LayerTree::Layer>::create();
renderLayer->updateLayerListsIfNeeded();
// Check if we have a reflection layer.
if (renderLayer->reflectionLayer())
childrenArray->addItem(buildObjectForLayer(renderLayer->reflectionLayer()));
if (renderLayer->isStackingContext()) {
if (Vector<RenderLayer*>* negZOrderList = renderLayer->negZOrderList()) {
size_t listSize = negZOrderList->size();
for (size_t i = 0; i < listSize; ++i)
childrenArray->addItem(buildObjectForLayer(negZOrderList->at(i)));
}
}
if (Vector<RenderLayer*>* normalFlowList = renderLayer->normalFlowList()) {
size_t listSize = normalFlowList->size();
for (size_t i = 0; i < listSize; ++i)
childrenArray->addItem(buildObjectForLayer(normalFlowList->at(i)));
}
if (renderLayer->isStackingContext()) {
if (Vector<RenderLayer*>* posZOrderList = renderLayer->posZOrderList()) {
size_t listSize = posZOrderList->size();
for (size_t i = 0; i < listSize; ++i)
childrenArray->addItem(buildObjectForLayer(posZOrderList->at(i)));
}
}
layerObject->setChildLayers(childrenArray);
return layerObject;
}