2011-07-28 14:26:00 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2011 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
2011-06-16 20:49:55 +00:00
|
|
|
#ifndef SkDebugDumper_DEFINED
|
|
|
|
#define SkDebugDumper_DEFINED
|
2011-08-12 14:27:47 +00:00
|
|
|
#include "SkDumpCanvas.h"
|
2011-06-16 20:49:55 +00:00
|
|
|
#include "SkEvent.h"
|
|
|
|
|
|
|
|
/** Formats the draw commands, and send them to a function-pointer provided
|
|
|
|
by the caller.
|
|
|
|
*/
|
2011-08-12 14:27:47 +00:00
|
|
|
class SkDebugDumper : public SkDumpCanvas::Dumper {
|
2011-06-16 20:49:55 +00:00
|
|
|
public:
|
|
|
|
SkDebugDumper(SkEventSinkID cID, SkEventSinkID clID, SkEventSinkID ipID);
|
|
|
|
// override from baseclass that does the formatting, and in turn calls
|
|
|
|
// the function pointer that was passed to the constructor
|
2011-08-12 14:27:47 +00:00
|
|
|
virtual void dump(SkDumpCanvas*, SkDumpCanvas::Verb, const char str[],
|
2011-06-16 20:49:55 +00:00
|
|
|
const SkPaint*);
|
|
|
|
|
|
|
|
void load() { fInit = true; };
|
|
|
|
void unload() { fInit = false; fCount = 0;};
|
|
|
|
void disable() { fDisabled = true; };
|
|
|
|
void enable() { fDisabled = false; };
|
|
|
|
private:
|
|
|
|
int fCount;
|
|
|
|
bool fInit;
|
|
|
|
bool fDisabled;
|
|
|
|
SkEventSinkID fContentID;
|
2011-08-12 14:27:47 +00:00
|
|
|
SkEventSinkID fCommandsID;
|
|
|
|
SkEventSinkID fStateID;
|
2011-06-16 20:49:55 +00:00
|
|
|
|
2011-08-12 14:27:47 +00:00
|
|
|
typedef SkDumpCanvas::Dumper INHERITED;
|
2011-06-16 20:49:55 +00:00
|
|
|
};
|
2012-06-06 12:11:33 +00:00
|
|
|
#endif
|