blob: 73cb1b2a4d43232e50bb633abd7fe202ac153b1c [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
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.coma8a42e22011-06-16 20:49:55 +00008#ifndef SkDebugDumper_DEFINED
9#define SkDebugDumper_DEFINED
10#include "SkDumpCanvasM.h"
11#include "SkEvent.h"
12
13class CommandListView;
14class InfoPanelView;
15class ContentView;
16/** Formats the draw commands, and send them to a function-pointer provided
17 by the caller.
18 */
19class SkDebugDumper : public SkDumpCanvasM::Dumper {
20public:
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; };
31private:
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