SkDiscretePathEffect.h revision ba28d03e94dc221d6a803bf2a84a420b9159255c
1ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com 28a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com/* 3ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Copyright 2006 The Android Open Source Project 48a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * 5ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Use of this source code is governed by a BSD-style license that can be 6ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * found in the LICENSE file. 78a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com */ 88a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 9ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com 108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#ifndef SkDiscretePathEffect_DEFINED 118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#define SkDiscretePathEffect_DEFINED 128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 138a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkPathEffect.h" 148a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 158a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com/** \class SkDiscretePathEffect 168a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com This path effect chops a path into discrete segments, and randomly displaces them. 188a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com*/ 198a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkDiscretePathEffect : public SkPathEffect { 208a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.compublic: 218a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com /** Break the path into segments of segLength length, and randomly move the endpoints 228a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com away from the original path by a maximum of deviation. 238a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com Note: works on filled or framed paths 248a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com */ 258a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com SkDiscretePathEffect(SkScalar segLength, SkScalar deviation); 268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 278a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com // overrides for SkPathEffect 288a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com // This method is not exported to java. 298a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width); 308a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 318a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com // overrides for SkFlattenable 328a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com // This method is not exported to java. 338a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com virtual void flatten(SkFlattenableWriteBuffer&); 34ba28d03e94dc221d6a803bf2a84a420b9159255cdjsollen@google.com SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDiscretePathEffect) 356bac947cd5bc460dd9166ada6310d678fd2e39f8reed@google.com 368a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprotected: 378a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com SkDiscretePathEffect(SkFlattenableReadBuffer&); 388a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 398a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprivate: 408a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com SkScalar fSegLength, fPerterb; 418a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 428a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com typedef SkPathEffect INHERITED; 438a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com}; 448a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 458a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif 468a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 47