yangsu@google.com | a8a42e2 | 2011-06-16 20:49:55 +0000 | [diff] [blame] | 1 | #ifndef SkDebugDumper_DEFINED |
| 2 | #define SkDebugDumper_DEFINED |
| 3 | #include "SkDumpCanvasM.h" |
| 4 | #include "SkEvent.h" |
| 5 | |
| 6 | class CommandListView; |
| 7 | class InfoPanelView; |
| 8 | class ContentView; |
| 9 | /** Formats the draw commands, and send them to a function-pointer provided |
| 10 | by the caller. |
| 11 | */ |
| 12 | class SkDebugDumper : public SkDumpCanvasM::Dumper { |
| 13 | public: |
| 14 | SkDebugDumper(SkEventSinkID cID, SkEventSinkID clID, SkEventSinkID ipID); |
| 15 | // override from baseclass that does the formatting, and in turn calls |
| 16 | // the function pointer that was passed to the constructor |
| 17 | virtual void dump(SkDumpCanvasM*, SkDumpCanvasM::Verb, const char str[], |
| 18 | const SkPaint*); |
| 19 | |
| 20 | void load() { fInit = true; }; |
| 21 | void unload() { fInit = false; fCount = 0;}; |
| 22 | void disable() { fDisabled = true; }; |
| 23 | void enable() { fDisabled = false; }; |
| 24 | private: |
| 25 | int fCount; |
| 26 | bool fInit; |
| 27 | bool fDisabled; |
| 28 | SkEventSinkID fContentID; |
| 29 | SkEventSinkID fCommandListID; |
| 30 | SkEventSinkID fInfoPanelID; |
| 31 | |
| 32 | typedef SkDumpCanvasM::Dumper INHERITED; |
| 33 | }; |
| 34 | #endif |