Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
dm
DMJsonWriter.h
Go to the documentation of this file.
1
/*
2
* Copyright 2014 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef DMJsonWriter_DEFINED
9
#define DMJsonWriter_DEFINED
10
11
#include "
include/core/SkString.h
"
12
#include "
tools/flags/CommandLineFlags.h
"
13
14
namespace
DM
{
15
16
/**
17
* Class for collecting results from DM and writing to a json file.
18
* All methods are thread-safe.
19
*/
20
class
JsonWriter
{
21
public
:
22
/**
23
* Info describing a single run.
24
*/
25
struct
BitmapResult
{
26
SkString
name
;
// E.g. "ninepatch-stretch", "desk_gws.skp"
27
SkString
config
;
// "gpu", "8888", "serialize", "pipe"
28
SkString
sourceType
;
// "gm", "skp", "image"
29
SkString
sourceOptions
;
// "image", "codec", "subset", "scanline"
30
SkString
md5
;
// In ASCII, so 32 bytes long.
31
SkString
ext
;
// Extension of file we wrote: "png", "pdf", ...
32
SkString
gamut
;
33
SkString
transferFn
;
34
SkString
colorType
;
35
SkString
alphaType
;
36
SkString
colorDepth
;
37
};
38
39
/**
40
* Add a result to the end of the list of results.
41
*/
42
static
void
AddBitmapResult
(
const
BitmapResult
&);
43
44
/**
45
* Write all collected results to the file dir/dm.json.
46
*/
47
static
void
DumpJson
(
const
char
* dir,
48
CommandLineFlags::StringArray
key
,
49
CommandLineFlags::StringArray
properties);
50
51
/**
52
* Read JSON file at path written by DumpJson, calling callback for each
53
* BitmapResult recorded in the file. Return success.
54
*/
55
static
bool
ReadJson
(
const
char
* path,
void
(*
callback
)(
BitmapResult
));
56
};
57
58
59
}
// namespace DM
60
#endif
// DMJsonWriter_DEFINED
CommandLineFlags.h
SkString.h
CommandLineFlags::StringArray
Definition
CommandLineFlags.h:127
DM::JsonWriter
Definition
DMJsonWriter.h:20
DM::JsonWriter::AddBitmapResult
static void AddBitmapResult(const BitmapResult &)
Definition
DMJsonWriter.cpp:31
DM::JsonWriter::ReadJson
static bool ReadJson(const char *path, void(*callback)(BitmapResult))
Definition
DMJsonWriter.cpp:106
DM::JsonWriter::DumpJson
static void DumpJson(const char *dir, CommandLineFlags::StringArray key, CommandLineFlags::StringArray properties)
Definition
DMJsonWriter.cpp:36
SkString
Definition
SkString.h:118
callback
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
Definition
fl_key_channel_responder.cc:120
key
int key
Definition
keyboard_key_handler_unittests.cc:114
DM
Definition
DMJsonWriter.cpp:22
DM::JsonWriter::BitmapResult
Definition
DMJsonWriter.h:25
DM::JsonWriter::BitmapResult::sourceType
SkString sourceType
Definition
DMJsonWriter.h:28
DM::JsonWriter::BitmapResult::alphaType
SkString alphaType
Definition
DMJsonWriter.h:35
DM::JsonWriter::BitmapResult::config
SkString config
Definition
DMJsonWriter.h:27
DM::JsonWriter::BitmapResult::colorType
SkString colorType
Definition
DMJsonWriter.h:34
DM::JsonWriter::BitmapResult::name
SkString name
Definition
DMJsonWriter.h:26
DM::JsonWriter::BitmapResult::transferFn
SkString transferFn
Definition
DMJsonWriter.h:33
DM::JsonWriter::BitmapResult::md5
SkString md5
Definition
DMJsonWriter.h:30
DM::JsonWriter::BitmapResult::colorDepth
SkString colorDepth
Definition
DMJsonWriter.h:36
DM::JsonWriter::BitmapResult::sourceOptions
SkString sourceOptions
Definition
DMJsonWriter.h:29
DM::JsonWriter::BitmapResult::gamut
SkString gamut
Definition
DMJsonWriter.h:32
DM::JsonWriter::BitmapResult::ext
SkString ext
Definition
DMJsonWriter.h:31
Generated on Fri Apr 26 2024 06:15:28 for Flutter Engine by
1.9.8