Flutter Engine
The Flutter Engine
SkTextBlobTrace.h
Go to the documentation of this file.
1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3#ifndef SkTextBlobTrace_DEFINED
4#define SkTextBlobTrace_DEFINED
5
12
13#include <cstddef>
14#include <cstdint>
15#include <vector>
16
17class SkFontMgr;
18class SkRefCntSet;
19class SkStream;
20class SkWStream;
21namespace sktext {
22class GlyphRunList;
23}
24
25namespace SkTextBlobTrace {
26
27struct Record {
28 uint32_t origUniqueID;
32};
33
34std::vector<SkTextBlobTrace::Record> CreateBlobTrace(SkStream* stream,
35 sk_sp<SkFontMgr> lastResortMgr);
36
37void DumpTrace(const std::vector<SkTextBlobTrace::Record>&);
38
39class Capture {
40public:
41 Capture();
43 void capture(const sktext::GlyphRunList&, const SkPaint&);
44 // If `dst` is nullptr, write to a file.
45 void dump(SkWStream* dst = nullptr) const;
46
47private:
48 size_t fBlobCount = 0;
49 sk_sp<SkRefCntSet> fTypefaceSet;
50 SkBinaryWriteBuffer fWriteBuffer;
51
52 Capture(const Capture&) = delete;
53 Capture& operator=(const Capture&) = delete;
54};
55
56} // namespace SkTextBlobTrace
57#endif // SkTextBlobTrace_DEFINED
void capture(const sktext::GlyphRunList &, const SkPaint &)
void dump(SkWStream *dst=nullptr) const
std::vector< SkTextBlobTrace::Record > CreateBlobTrace(SkStream *stream, sk_sp< SkFontMgr > lastResortMgr)
void DumpTrace(const std::vector< SkTextBlobTrace::Record > &)
dst
Definition: cp.py:12
sk_sp< SkTextBlob > blob