Bug 942268 - Add RecordedEvent::GetEventName. r=mstange

This commit is contained in:
Bas Schouten 2013-11-27 12:21:49 +01:00
parent 63bb72465e
commit 2b983bacde
2 changed files with 67 additions and 0 deletions

View File

@ -64,6 +64,69 @@ RecordedEvent::LoadEventFromStream(std::istream &aStream, EventType aType)
}
}
string
RecordedEvent::GetEventName(EventType aType)
{
switch (aType) {
case DRAWTARGETCREATION:
return "DrawTarget Creation";
case DRAWTARGETDESTRUCTION:
return "DrawTarget Destruction";
case FILLRECT:
return "FillRect";
case STROKERECT:
return "StrokeRect";
case STROKELINE:
return "StrokeLine";
case CLEARRECT:
return "ClearRect";
case COPYSURFACE:
return "CopySurface";
case SETTRANSFORM:
return "SetTransform";
case PUSHCLIP:
return "PushClip";
case PUSHCLIPRECT:
return "PushClipRect";
case POPCLIP:
return "PopClip";
case FILL:
return "Fill";
case FILLGLYPHS:
return "FillGlyphs";
case MASK:
return "Mask";
case STROKE:
return "Stroke";
case DRAWSURFACE:
return "DrawSurface";
case DRAWSURFACEWITHSHADOW:
return "DrawSurfaceWithShadow";
case PATHCREATION:
return "PathCreation";
case PATHDESTRUCTION:
return "PathDestruction";
case SOURCESURFACECREATION:
return "SourceSurfaceCreation";
case SOURCESURFACEDESTRUCTION:
return "SourceSurfaceDestruction";
case GRADIENTSTOPSCREATION:
return "GradientStopsCreation";
case GRADIENTSTOPSDESTRUCTION:
return "GradientStopsDestruction";
case SNAPSHOT:
return "Snapshot";
case SCALEDFONTCREATION:
return "ScaledFontCreation";
case SCALEDFONTDESTRUCTION:
return "ScaledFontDestruction";
case MASKSURFACE:
return "MaskSurface";
default:
return "Unknown";
}
}
void
RecordedEvent::RecordPatternData(std::ostream &aStream, const PatternStorage &aPattern) const
{

View File

@ -164,6 +164,10 @@ public:
MASKSURFACE
};
static const uint32_t kTotalEventTypes = RecordedEvent::MASKSURFACE + 1;
static std::string GetEventName(EventType aType);
virtual void PlayEvent(Translator *aTranslator) const {}
virtual void RecordToStream(std::ostream &aStream) const {}