22 if (!stream.isValid()) {
23 SkDebugf(
"BISECT: invalid input file at \"%s\"\n", filepath);
33 matrix.mapRect(&bounds, path.getBounds());
34 bounds.roundOut(&ibounds);
35 bisect->fDrawBounds.join(ibounds);
36 bisect->fFoundPaths.push_back() = {path,
paint, matrix};
41BisectSlide::BisectSlide(
const char filepath[])
42 : fFilePath(filepath) {
44 fName.
printf(
"BISECT_%s", basename ? basename + 1 : fFilePath.c_str());
50 if (!fTossedPaths.
empty()) {
52 swap(fFoundPaths, fTossedPaths);
53 if (
'X' == fTrail.
back()) {
62 if (fFoundPaths.
size() > 1) {
63 int midpt = (fFoundPaths.
size() + 1) / 2;
64 fPathHistory.emplace(fFoundPaths, fTossedPaths);
65 fTossedPaths.
reset(fFoundPaths.
begin() + midpt, fFoundPaths.
size() - midpt);
72 if (!fPathHistory.empty()) {
73 fFoundPaths = fPathHistory.top().first;
74 fTossedPaths = fPathHistory.top().second;
87 if (!fTrail.
empty()) {
89 for (
char ch : fTrail) {
94 for (
const FoundPath& foundPath : fFoundPaths) {
95 foundPath.fPath.dump();
107 for (
const FoundPath& path : fFoundPaths) {
109 canvas->
concat(path.fViewMatrix);
110 canvas->
drawPath(path.fPath, path.fPaint);
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
void swap(sk_sp< T > &a, sk_sp< T > &b)
void draw(SkCanvas *canvas) override
bool onChar(SkUnichar c) override
static sk_sp< BisectSlide > Create(const char filepath[])
void translate(SkScalar dx, SkScalar dy)
void drawPath(const SkPath &path, const SkPaint &paint)
void concat(const SkMatrix &matrix)
static constexpr char SEPARATOR
void printf(const char format[],...) SK_PRINTF_LIKE(2
const char * c_str() const
void resize_back(int newCount)
constexpr int32_t top() const
constexpr int32_t left() const