Bug 700240 - Print nsSVGEffects types. r=roc

This commit is contained in:
Matt Woodrow 2011-11-17 16:44:16 +13:00
parent 4c0194acc2
commit 0f4f45950d
3 changed files with 50 additions and 0 deletions

View File

@ -64,6 +64,8 @@
#include "BasicLayers.h"
#include "nsBoxFrame.h"
#include "nsViewportFrame.h"
#include "nsSVGEffects.h"
#include "nsSVGClipPathFrame.h"
using namespace mozilla;
using namespace mozilla::layers;
@ -2998,3 +3000,44 @@ bool nsDisplaySVGEffects::TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem
other->mBounds + other->mEffectsFrame->GetOffsetTo(mEffectsFrame));
return true;
}
#ifdef MOZ_DUMP_PAINTING
void
nsDisplaySVGEffects::PrintEffects(FILE* aOutput)
{
nsIFrame* firstFrame =
nsLayoutUtils::GetFirstContinuationOrSpecialSibling(mEffectsFrame);
nsSVGEffects::EffectProperties effectProperties =
nsSVGEffects::GetEffectProperties(firstFrame);
bool isOK = true;
nsSVGClipPathFrame *clipPathFrame = effectProperties.GetClipPathFrame(&isOK);
bool first = true;
fprintf(aOutput, " effects=(");
if (mEffectsFrame->GetStyleDisplay()->mOpacity != 1.0f) {
first = false;
fprintf(aOutput, "opacity(%f)", mEffectsFrame->GetStyleDisplay()->mOpacity);
}
if (clipPathFrame) {
if (!first) {
fprintf(aOutput, ", ");
}
fprintf(aOutput, "clip(%s)", clipPathFrame->IsTrivial() ? "trivial" : "non-trivial");
first = false;
}
if (effectProperties.GetFilterFrame(&isOK)) {
if (!first) {
fprintf(aOutput, ", ");
}
fprintf(aOutput, "filter");
first = false;
}
if (effectProperties.GetMaskFrame(&isOK)) {
if (!first) {
fprintf(aOutput, ", ");
}
fprintf(aOutput, "mask");
}
fprintf(aOutput, ")");
}
#endif

View File

@ -2052,6 +2052,10 @@ public:
nsIFrame* GetEffectsFrame() { return mEffectsFrame; }
#ifdef MOZ_DUMP_PAINTING
void PrintEffects(FILE* aOutput);
#endif
private:
nsIFrame* mEffectsFrame;
// relative to mEffectsFrame

View File

@ -207,6 +207,9 @@ PrintDisplayListTo(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList,
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, aIndent + 4, aOutput);