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.
|
|
|
|
*/
|
|
|
|
|
2019-03-20 17:01:47 +00:00
|
|
|
#ifndef EventTracingPriv_DEFINED
|
|
|
|
#define EventTracingPriv_DEFINED
|
2017-07-20 19:43:35 +00:00
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/private/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) {}
|
|
|
|
|
2019-03-20 17:01:47 +00:00
|
|
|
uint8_t* getCategoryGroupEnabled(const char* name);
|
2017-07-21 15:06:24 +00:00
|
|
|
const char* getCategoryGroupName(const uint8_t* categoryEnabledFlag);
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum { kMaxCategories = 256 };
|
|
|
|
|
|
|
|
struct CategoryState {
|
2019-03-20 17:01:47 +00:00
|
|
|
uint8_t fEnabled;
|
2017-07-21 15:06:24 +00:00
|
|
|
const char* fName;
|
|
|
|
};
|
|
|
|
|
|
|
|
CategoryState fCategories[kMaxCategories];
|
2019-03-20 17:01:47 +00:00
|
|
|
int fNumCategories;
|
|
|
|
SkMutex fMutex;
|
2017-07-21 15:06:24 +00:00
|
|
|
};
|
|
|
|
|
2017-07-20 19:43:35 +00:00
|
|
|
#endif
|