#ifndef CC_PAINT_PATH_EFFECT_H_
#define CC_PAINT_PATH_EFFECT_H_
#include "cc/paint/paint_export.h"
#include "third_party/skia/include/core/SkRefCnt.h"
class SkPathEffect;
namespace cc {
class PaintOpWriter;
class PaintOpReader;
class CC_PAINT_EXPORT PathEffect : public SkRefCnt {
public:
PathEffect(const PathEffect&) = delete;
PathEffect& operator=(const PathEffect&) = delete;
static sk_sp<PathEffect> MakeDash(const float intervals[],
int count,
float phase);
static sk_sp<PathEffect> MakeCorner(float radius);
bool EqualsForTesting(const PathEffect& other) const;
virtual size_t dash_interval_count() const;
protected:
friend class PaintFlags;
friend class PaintOpReader;
friend class PaintOpWriter;
enum class Type {
kNull,
kDash,
kCorner,
kMaxValue = kCorner,
};
virtual sk_sp<SkPathEffect> GetSkPathEffect() const = 0;
explicit PathEffect(Type type);
virtual size_t SerializedDataSize() const = 0;
virtual void SerializeData(PaintOpWriter& writer) const = 0;
static sk_sp<PathEffect> Deserialize(PaintOpReader& reader, Type type);
Type type_;
};
}
#endif