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