2008-12-17 15:59:43 +00:00
|
|
|
/*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Copyright 2006 The Android Open Source Project
|
2008-12-17 15:59:43 +00:00
|
|
|
*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
2008-12-17 15:59:43 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef Sk1DPathEffect_DEFINED
|
|
|
|
#define Sk1DPathEffect_DEFINED
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkPathEffect.h"
|
2008-12-17 15:59:43 +00:00
|
|
|
|
2021-05-20 19:16:34 +00:00
|
|
|
class SK_API SkPath1DPathEffect {
|
2008-12-17 15:59:43 +00:00
|
|
|
public:
|
|
|
|
enum Style {
|
|
|
|
kTranslate_Style, // translate the shape to each position
|
|
|
|
kRotate_Style, // rotate the shape about its center
|
|
|
|
kMorph_Style, // transform each point, and turn lines into curves
|
2016-02-22 15:42:18 +00:00
|
|
|
|
2016-02-22 20:50:25 +00:00
|
|
|
kLastEnum_Style = kMorph_Style,
|
2008-12-17 15:59:43 +00:00
|
|
|
};
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
/** Dash by replicating the specified path.
|
|
|
|
@param path The path to replicate (dash)
|
|
|
|
@param advance The space between instances of path
|
|
|
|
@param phase distance (mod advance) along path for its initial position
|
|
|
|
@param style how to transform path at each point (based on the current
|
|
|
|
position and tangent)
|
|
|
|
*/
|
2016-03-18 18:22:57 +00:00
|
|
|
static sk_sp<SkPathEffect> Make(const SkPath& path, SkScalar advance, SkScalar phase, Style);
|
|
|
|
|
2021-05-20 19:16:34 +00:00
|
|
|
static void RegisterFlattenables();
|
2008-12-17 15:59:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|