blob: e7d69562d5674bd07691c2c5159851cfb82843b0 [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
yangsu@google.comef7bdfa2011-08-12 14:27:47 +000010#include "SkDumpCanvas.h"
yangsu@google.coma8a42e22011-06-16 20:49:55 +000011#include "SkEvent.h"
12
yangsu@google.coma8a42e22011-06-16 20:49:55 +000013/** Formats the draw commands, and send them to a function-pointer provided
14 by the caller.
15 */
yangsu@google.comef7bdfa2011-08-12 14:27:47 +000016class SkDebugDumper : public SkDumpCanvas::Dumper {
yangsu@google.coma8a42e22011-06-16 20:49:55 +000017public:
18 SkDebugDumper(SkEventSinkID cID, SkEventSinkID clID, SkEventSinkID ipID);
19 // override from baseclass that does the formatting, and in turn calls
20 // the function pointer that was passed to the constructor
yangsu@google.comef7bdfa2011-08-12 14:27:47 +000021 virtual void dump(SkDumpCanvas*, SkDumpCanvas::Verb, const char str[],
yangsu@google.coma8a42e22011-06-16 20:49:55 +000022 const SkPaint*);
rmistry@google.comd6176b02012-08-23 18:14:13 +000023
yangsu@google.coma8a42e22011-06-16 20:49:55 +000024 void load() { fInit = true; };
25 void unload() { fInit = false; fCount = 0;};
26 void disable() { fDisabled = true; };
27 void enable() { fDisabled = false; };
28private:
29 int fCount;
30 bool fInit;
31 bool fDisabled;
32 SkEventSinkID fContentID;
yangsu@google.comef7bdfa2011-08-12 14:27:47 +000033 SkEventSinkID fCommandsID;
34 SkEventSinkID fStateID;
rmistry@google.comd6176b02012-08-23 18:14:13 +000035
yangsu@google.comef7bdfa2011-08-12 14:27:47 +000036 typedef SkDumpCanvas::Dumper INHERITED;
yangsu@google.coma8a42e22011-06-16 20:49:55 +000037};
caryclark@google.com9da0cea32012-06-06 12:11:33 +000038#endif