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 SkDiscretePathEffect_DEFINED
|
|
|
|
#define SkDiscretePathEffect_DEFINED
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkPathEffect.h"
|
2008-12-17 15:59:43 +00:00
|
|
|
|
|
|
|
/** \class SkDiscretePathEffect
|
|
|
|
|
|
|
|
This path effect chops a path into discrete segments, and randomly displaces them.
|
|
|
|
*/
|
2021-05-21 21:42:14 +00:00
|
|
|
class SK_API SkDiscretePathEffect {
|
2008-12-17 15:59:43 +00:00
|
|
|
public:
|
|
|
|
/** Break the path into segments of segLength length, and randomly move the endpoints
|
|
|
|
away from the original path by a maximum of deviation.
|
|
|
|
Note: works on filled or framed paths
|
2014-06-13 05:55:08 +00:00
|
|
|
|
|
|
|
@param seedAssist This is a caller-supplied seedAssist that modifies
|
|
|
|
the seed value that is used to randomize the path
|
|
|
|
segments' endpoints. If not supplied it defaults to 0,
|
|
|
|
in which case filtering a path multiple times will
|
|
|
|
result in the same set of segments (this is useful for
|
|
|
|
testing). If a caller does not want this behaviour
|
|
|
|
they can pass in a different seedAssist to get a
|
|
|
|
different set of path segments.
|
2008-12-17 15:59:43 +00:00
|
|
|
*/
|
2016-03-18 18:22:57 +00:00
|
|
|
static sk_sp<SkPathEffect> Make(SkScalar segLength, SkScalar dev, uint32_t seedAssist = 0);
|
|
|
|
|
2021-05-21 15:00:36 +00:00
|
|
|
static void RegisterFlattenables();
|
2008-12-17 15:59:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|