SkCornerPathEffect.h revision 8a1c16ff38322f0210116fa7293eb8817c7e477e
184ed9a68bd9a13252b376b21a9167dabae254325Richard Oudkerk/* 284ed9a68bd9a13252b376b21a9167dabae254325Richard Oudkerk * Copyright (C) 2006 The Android Open Source Project 384ed9a68bd9a13252b376b21a9167dabae254325Richard Oudkerk * 422d0698d3b034f4f4314aa793da7225a5da640baSteve Dower * Licensed under the Apache License, Version 2.0 (the "License"); 522d0698d3b034f4f4314aa793da7225a5da640baSteve Dower * you may not use this file except in compliance with the License. 622d0698d3b034f4f4314aa793da7225a5da640baSteve Dower * You may obtain a copy of the License at 722d0698d3b034f4f4314aa793da7225a5da640baSteve Dower * 822d0698d3b034f4f4314aa793da7225a5da640baSteve Dower * http://www.apache.org/licenses/LICENSE-2.0 984ed9a68bd9a13252b376b21a9167dabae254325Richard Oudkerk * 1084ed9a68bd9a13252b376b21a9167dabae254325Richard Oudkerk * Unless required by applicable law or agreed to in writing, software 1184ed9a68bd9a13252b376b21a9167dabae254325Richard Oudkerk * distributed under the License is distributed on an "AS IS" BASIS, 1284ed9a68bd9a13252b376b21a9167dabae254325Richard Oudkerk * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef SkCornerPathEffect_DEFINED 18#define SkCornerPathEffect_DEFINED 19 20#include "SkPathEffect.h" 21 22/** \class SkCornerPathEffect 23 24 SkCornerPathEffect is a subclass of SkPathEffect that can turn sharp corners 25 into various treatments (e.g. rounded corners) 26*/ 27class SkCornerPathEffect : public SkPathEffect { 28public: 29 /** radius must be > 0 to have an effect. It specifies the distance from each corner 30 that should be "rounded". 31 */ 32 SkCornerPathEffect(SkScalar radius); 33 virtual ~SkCornerPathEffect(); 34 35 // overrides for SkPathEffect 36 // This method is not exported to java. 37 virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width); 38 39 // overrides for SkFlattenable 40 // This method is not exported to java. 41 virtual Factory getFactory(); 42 // This method is not exported to java. 43 virtual void flatten(SkFlattenableWriteBuffer&); 44 45protected: 46 SkCornerPathEffect(SkFlattenableReadBuffer&); 47 48private: 49 SkScalar fRadius; 50 51 static SkFlattenable* CreateProc(SkFlattenableReadBuffer&); 52 53 // illegal 54 SkCornerPathEffect(const SkCornerPathEffect&); 55 SkCornerPathEffect& operator=(const SkCornerPathEffect&); 56 57 typedef SkPathEffect INHERITED; 58}; 59 60#endif 61 62