20 "Artificially slow down tracing test to produce nicer JSON");
31 virtual ~TracingShape() {
34 void traceSnapshot() {
50 virtual const char* typeName() {
return "TracingShape"; }
54struct TracingCircle :
public TracingShape {
56 const char* typeName()
override {
return "TracingCircle"; }
60#if defined(SK_ANDROID_FRAMEWORK_USE_PERFETTO)
61 void WriteIntoTrace(::perfetto::TracedValue context) {
62 std::move(context).WriteString(toString().c_str());
70struct TracingRect :
public TracingShape {
72 const char* typeName()
override {
return "TracingRect"; }
87 if (FLAGS_slowTracingTest) {
88 for (
int i = 0;
i < howMuchWork * 100; ++
i) {
125 for (
int i = 0;
i < 180; ++
i) {
136 for (
int i = 0;
i < 180; ++
i) {
149 for (
int i = 0;
i < 180; ++
i) {
165 TracingCircle* circle =
new TracingCircle(
SkPoint::Make(20, 20), 15);
166 circle->traceSnapshot();
171 rect->traceSnapshot();
175 circle->fCenter.offset(10, 10);
176 circle->traceSnapshot();
182 TRACE_EVENT1(
"skia",
"Processing Shape",
"#shape", circle);
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
#define SkDegreesToRadians(degrees)
#define SkScalarSin(radians)
#define SkScalarCos(radians)
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
#define TRACE_COUNTER1(category_group, name, value)
#define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id)
#define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id)
#define TRACE_COUNTER2(category_group, name, value1_name, value1_val, value2_name, value2_val)
#define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group, name, id, snapshot)
#define TRACE_STR_COPY(str)
static SkScalar center(float pos0, float pos1)
static void do_work(int howMuchWork)
static void test_trace_objects()
static void test_trace_counters()
static void test_trace_simple()
static SkScalar gTracingTestWorkSink
static DEFINE_bool(slowTracingTest, false, "Artificially slow down tracing test to produce nicer JSON")
DEF_TEST(Tracing, reporter)
sk_sp< SkBlender > blender SkRect rect
static constexpr SkPoint Make(float x, float y)
SkScalar fBottom
larger y-axis bounds
SkScalar fLeft
smaller x-axis bounds
SkScalar fRight
larger x-axis bounds
static constexpr SkRect MakeWH(float w, float h)
SkScalar fTop
smaller y-axis bounds
#define TRACE_EVENT0(category_group, name)
#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val)