本文整理汇总了C++中nsDisplayList::GetBottom方法的典型用法代码示例。如果您正苦于以下问题:C++ nsDisplayList::GetBottom方法的具体用法?C++ nsDisplayList::GetBottom怎么用?C++ nsDisplayList::GetBottom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsDisplayList
的用法示例。
在下文中一共展示了nsDisplayList::GetBottom方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fputc
static void
PrintDisplayListTo(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList,
PRInt32 aIndent, FILE* aOutput)
{
for (nsDisplayItem* i = aList.GetBottom(); i != nsnull; i = i->GetAbove()) {
if (aList.DidComputeVisibility() && i->GetVisibleRect().IsEmpty())
continue;
for (PRInt32 j = 0; j < aIndent; ++j) {
fputc(' ', aOutput);
}
nsIFrame* f = i->GetUnderlyingFrame();
nsAutoString fName;
if (f) {
f->GetFrameName(fName);
}
nsRect rect = i->GetBounds(aBuilder);
switch (i->GetType()) {
case nsDisplayItem::TYPE_CLIP:
case nsDisplayItem::TYPE_CLIP_ROUNDED_RECT: {
nsDisplayClip* c = static_cast<nsDisplayClip*>(i);
rect = c->GetClipRect();
break;
}
default:
break;
}
nscolor color;
nsRect vis = i->GetVisibleRect();
nsDisplayList* list = i->GetList();
nsRegion opaque;
if (!list || list->DidComputeVisibility()) {
opaque = i->GetOpaqueRegion(aBuilder);
}
if (i->GetType() == nsDisplayItem::TYPE_TRANSFORM) {
nsDisplayTransform* t = static_cast<nsDisplayTransform*>(i);
list = t->GetStoredList()->GetList();
}
fprintf(aOutput, "%s %p(%s) (%d,%d,%d,%d)(%d,%d,%d,%d)%s%s",
i->Name(), (void*)f, NS_ConvertUTF16toUTF8(fName).get(),
rect.x, rect.y, rect.width, rect.height,
vis.x, vis.y, vis.width, vis.height,
opaque.IsEmpty() ? "" : " opaque",
i->IsUniform(aBuilder, &color) ? " uniform" : "");
if (f) {
PRUint32 key = i->GetPerFrameKey();
Layer* layer = aBuilder->LayerBuilder()->GetOldLayerFor(f, key);
if (layer) {
fprintf(aOutput, " layer=%p", layer);
}
}
fputc('\n', aOutput);
if (list) {
PrintDisplayListTo(aBuilder, *list, aIndent + 4, aOutput);
}
}
}
示例2: PrintDisplayItemTo
static void
PrintDisplayListTo(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList,
std::stringstream& aStream, uint32_t aIndent, bool aDumpHtml)
{
if (aDumpHtml) {
aStream << "<ul>";
}
for (nsDisplayItem* i = aList.GetBottom(); i != nullptr; i = i->GetAbove()) {
if (aDumpHtml) {
aStream << "<li>";
}
PrintDisplayItemTo(aBuilder, i, aStream, aIndent, true, aDumpHtml);
if (aDumpHtml) {
aStream << "</li>";
}
}
if (aDumpHtml) {
aStream << "</ul>";
}
}
示例3: string
static void
PrintDisplayListTo(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList,
FILE* aOutput)
{
fprintf(aOutput, "<ul>");
for (nsDisplayItem* i = aList.GetBottom(); i != nsnull; i = i->GetAbove()) {
#ifdef DEBUG
if (aList.DidComputeVisibility() && i->GetVisibleRect().IsEmpty())
continue;
#endif
fprintf(aOutput, "<li>");
nsIFrame* f = i->GetUnderlyingFrame();
nsAutoString fName;
#ifdef DEBUG
if (f) {
f->GetFrameName(fName);
}
#endif
bool snap;
nsRect rect = i->GetBounds(aBuilder, &snap);
switch (i->GetType()) {
case nsDisplayItem::TYPE_CLIP:
case nsDisplayItem::TYPE_CLIP_ROUNDED_RECT: {
nsDisplayClip* c = static_cast<nsDisplayClip*>(i);
rect = c->GetClipRect();
break;
}
default:
break;
}
nscolor color;
nsRect vis = i->GetVisibleRect();
nsDisplayList* list = i->GetList();
nsRegion opaque;
if (i->GetType() == nsDisplayItem::TYPE_TRANSFORM) {
nsDisplayTransform* t = static_cast<nsDisplayTransform*>(i);
list = t->GetStoredList()->GetList();
}
#ifdef DEBUG
if (!list || list->DidComputeVisibility()) {
opaque = i->GetOpaqueRegion(aBuilder, &snap);
}
#endif
if (i->Painted()) {
nsCString string(i->Name());
string.Append("-");
string.AppendInt((PRUint64)i);
fprintf(aOutput, "<a href=\"javascript:ViewImage('%s')\">", string.BeginReading());
}
fprintf(aOutput, "%s %p(%s) (%d,%d,%d,%d)(%d,%d,%d,%d)%s%s",
i->Name(), (void*)f, NS_ConvertUTF16toUTF8(fName).get(),
rect.x, rect.y, rect.width, rect.height,
vis.x, vis.y, vis.width, vis.height,
opaque.IsEmpty() ? "" : " opaque",
i->IsUniform(aBuilder, &color) ? " uniform" : "");
if (i->Painted()) {
fprintf(aOutput, "</a>");
}
if (f) {
PRUint32 key = i->GetPerFrameKey();
Layer* layer = aBuilder->LayerBuilder()->GetOldLayerFor(f, key);
if (layer) {
fprintf(aOutput, " <a href=\"#%p\">layer=%p</a>", layer, layer);
}
}
if (i->GetType() == nsDisplayItem::TYPE_SVG_EFFECTS) {
(static_cast<nsDisplaySVGEffects*>(i))->PrintEffects(aOutput);
}
fputc('\n', aOutput);
if (list) {
PrintDisplayListTo(aBuilder, *list, aOutput);
}
fprintf(aOutput, "</li>");
}
fprintf(aOutput, "</ul>");
}
示例4: string
static void
PrintDisplayListTo(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList,
FILE* aOutput, bool aDumpHtml)
{
if (aDumpHtml) {
fprintf(aOutput, "<ul>");
}
for (nsDisplayItem* i = aList.GetBottom(); i != nullptr; i = i->GetAbove()) {
#ifdef DEBUG
if (aList.DidComputeVisibility() && i->GetVisibleRect().IsEmpty())
continue;
#endif
if (aDumpHtml) {
fprintf(aOutput, "<li>");
} else {
sPrintDisplayListIndent ++;
for (int indent = 0; indent < sPrintDisplayListIndent; indent++) {
fprintf(aOutput, " ");
}
}
nsIFrame* f = i->GetUnderlyingFrame();
nsAutoString fName;
#ifdef DEBUG
if (f) {
f->GetFrameName(fName);
}
#endif
bool snap;
nsRect rect = i->GetBounds(aBuilder, &snap);
switch (i->GetType()) {
case nsDisplayItem::TYPE_CLIP:
case nsDisplayItem::TYPE_CLIP_ROUNDED_RECT: {
nsDisplayClip* c = static_cast<nsDisplayClip*>(i);
rect = c->GetClipRect();
break;
}
default:
break;
}
nscolor color;
nsRect vis = i->GetVisibleRect();
nsRect component = i->GetComponentAlphaBounds(aBuilder);
nsDisplayList* list = i->GetChildren();
nsRegion opaque;
#ifdef DEBUG
if (!list || list->DidComputeVisibility()) {
opaque = i->GetOpaqueRegion(aBuilder, &snap);
}
#endif
if (aDumpHtml && i->Painted()) {
nsCString string(i->Name());
string.Append("-");
string.AppendInt((uint64_t)i);
fprintf(aOutput, "<a href=\"javascript:ViewImage('%s')\">", string.BeginReading());
}
fprintf(aOutput, "%s %p(%s) (%d,%d,%d,%d)(%d,%d,%d,%d)(%d,%d,%d,%d)%s",
i->Name(), (void*)f, NS_ConvertUTF16toUTF8(fName).get(),
rect.x, rect.y, rect.width, rect.height,
vis.x, vis.y, vis.width, vis.height,
component.x, component.y, component.width, component.height,
i->IsUniform(aBuilder, &color) ? " uniform" : "");
nsRegionRectIterator iter(opaque);
for (const nsRect* r = iter.Next(); r; r = iter.Next()) {
printf("(opaque %d,%d,%d,%d)", r->x, r->y, r->width, r->height);
}
if (aDumpHtml && i->Painted()) {
fprintf(aOutput, "</a>");
}
if (f) {
uint32_t key = i->GetPerFrameKey();
Layer* layer = mozilla::FrameLayerBuilder::GetDebugOldLayerFor(f, key);
if (layer) {
if (aDumpHtml) {
fprintf(aOutput, " <a href=\"#%p\">layer=%p</a>", layer, layer);
} else {
fprintf(aOutput, " layer=%p", layer);
}
}
}
if (i->GetType() == nsDisplayItem::TYPE_SVG_EFFECTS) {
(static_cast<nsDisplaySVGEffects*>(i))->PrintEffects(aOutput);
}
fputc('\n', aOutput);
if (list) {
PrintDisplayListTo(aBuilder, *list, aOutput, aDumpHtml);
}
if (aDumpHtml) {
fprintf(aOutput, "</li>");
} else {
sPrintDisplayListIndent --;
}
}
if (aDumpHtml) {
fprintf(aOutput, "</ul>");
}
}