blob: cbaab89e5b05a671b1fa4c3867a4b9fa72f0d011 [file] [log] [blame]
Mike Reed41232232018-03-07 17:02:47 -05001/*
2 * Copyright 2018 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 SkTrimImpl_DEFINED
9#define SkTrimImpl_DEFINED
10
Cary Clark4dc5a452018-05-21 11:56:57 -040011#include "SkFlattenablePriv.h"
Mike Reed41232232018-03-07 17:02:47 -050012#include "SkPathEffect.h"
13
Florin Malita827af662018-03-09 16:08:58 -050014#include "SkTrimPathEffect.h"
15
Mike Reed41232232018-03-07 17:02:47 -050016class SkTrimPE : public SkPathEffect {
17public:
Florin Malita827af662018-03-09 16:08:58 -050018 SkTrimPE(SkScalar startT, SkScalar stopT, SkTrimPathEffect::Mode);
Mike Reed41232232018-03-07 17:02:47 -050019
Mike Reed41232232018-03-07 17:02:47 -050020 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTrimPE)
21
22protected:
23 void flatten(SkWriteBuffer&) const override;
Mike Reed6d10f8b2018-08-16 13:22:16 -040024 bool onFilterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*) const override;
Mike Reed41232232018-03-07 17:02:47 -050025
26private:
Florin Malita827af662018-03-09 16:08:58 -050027 const SkScalar fStartT,
28 fStopT;
29 const SkTrimPathEffect::Mode fMode;
Mike Reed41232232018-03-07 17:02:47 -050030
31 typedef SkPathEffect INHERITED;
32};
33
34#endif