2017-07-20 19:43:35 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkEventTracingPriv_DEFINED
|
|
|
|
#define SkEventTracingPriv_DEFINED
|
|
|
|
|
2017-07-21 15:06:24 +00:00
|
|
|
#include "SkMutex.h"
|
2017-07-20 19:43:35 +00:00
|
|
|
|
|
|
|
/**
|
2017-07-24 18:27:18 +00:00
|
|
|
* Construct and install an SkEventTracer, based on the mode,
|
|
|
|
* defaulting to the --trace command line argument.
|
2017-07-20 19:43:35 +00:00
|
|
|
*/
|
2017-07-24 18:27:18 +00:00
|
|
|
void initializeEventTracingForTools(const char* mode = nullptr);
|
2017-07-20 19:43:35 +00:00
|
|
|
|
2017-07-21 15:06:24 +00:00
|
|
|
/**
|
|
|
|
* Helper class used by internal implementations of SkEventTracer to manage categories.
|
|
|
|
*/
|
|
|
|
class SkEventTracingCategories {
|
|
|
|
public:
|
|
|
|
SkEventTracingCategories() : fNumCategories(0) {}
|
|
|
|
|
|
|
|
uint8_t* getCategoryGroupEnabled(const char* name);
|
|
|
|
const char* getCategoryGroupName(const uint8_t* categoryEnabledFlag);
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum { kMaxCategories = 256 };
|
|
|
|
|
|
|
|
struct CategoryState {
|
|
|
|
uint8_t fEnabled;
|
|
|
|
const char* fName;
|
|
|
|
};
|
|
|
|
|
|
|
|
CategoryState fCategories[kMaxCategories];
|
|
|
|
int fNumCategories;
|
|
|
|
SkMutex fMutex;
|
|
|
|
};
|
|
|
|
|
2017-07-20 19:43:35 +00:00
|
|
|
#endif
|