20#include <unordered_map>
24 std::unordered_map<uint64_t, uint32_t>
counts;
27 for (
int i = 1;
i < argc;
i++) {
28 const char* filename =
argv[
i];
36 &&
paint.getPathEffect() ==
nullptr
37 &&
paint.getMaskFilter() ==
nullptr;
39 uint64_t blobID = record.origUniqueID;
49 uint32_t posBits = (fx << 3 | fy) << 12;
51 uint64_t blobKey = blobID << 32u | posBits | colorBits;
52 auto lookup =
counts.find(blobKey);
53 if (lookup ==
counts.end()) {
55 std::tie(lookup,
ok) =
counts.insert({blobKey, 0});
59 std::cout << std::hex << blobKey <<
"\n";
62 std::cerr <<
"trace: " << filename
63 <<
" unique: " <<
counts.size()
65 <<
" ratio: " << (
float)total/
counts.size() <<
"\n";
69 bounds.join(record.blob->bounds().makeOffset(record.offset.x(), record.offset.y()));
79 canvas->
translate(8.0f - iBounds.
x(), 8.0f - iBounds.
y());
84 record.blob.get(), record.offset.x(), record.offset.y(), record.paint);
#define SkColorGetR(color)
#define SkColorGetG(color)
#define SkColorGetB(color)
constexpr SkColor SK_ColorWHITE
#define SkScalarToFixed(x)
static bool ok(int result)
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
int main(int argc, char **argv)
void translate(SkScalar dx, SkScalar dy)
void clear(SkColor color)
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
bool write(const void *buffer, size_t size) override
@ kFill_Style
set to fill geometry
sk_sp< SkImage > makeImageSnapshot()
static SkColor CanonicalColor(SkColor color)
@ kBackground
Suitable for threads that shouldn't disrupt high priority work.
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
Optional< SkRect > bounds
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
std::vector< SkTextBlobTrace::Record > CreateBlobTrace(SkStream *stream, sk_sp< SkFontMgr > lastResortMgr)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core counts
constexpr int32_t x() const
constexpr int32_t y() const
constexpr SkISize size() const
constexpr int32_t height() const
constexpr int32_t width() const
static SkImageInfo MakeN32Premul(int width, int height)