SkCornerPathEffect.h revision 6bac947cd5bc460dd9166ada6310d678fd2e39f8
18a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com/* 28a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * Copyright (C) 2006 The Android Open Source Project 38a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * 48a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * Licensed under the Apache License, Version 2.0 (the "License"); 58a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * you may not use this file except in compliance with the License. 68a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * You may obtain a copy of the License at 78a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * 88a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * http://www.apache.org/licenses/LICENSE-2.0 98a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * 108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * Unless required by applicable law or agreed to in writing, software 118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * distributed under the License is distributed on an "AS IS" BASIS, 128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 138a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * See the License for the specific language governing permissions and 148a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * limitations under the License. 158a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com */ 168a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#ifndef SkCornerPathEffect_DEFINED 188a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#define SkCornerPathEffect_DEFINED 198a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 208a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkPathEffect.h" 218a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 228a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com/** \class SkCornerPathEffect 238a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 248a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com SkCornerPathEffect is a subclass of SkPathEffect that can turn sharp corners 258a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com into various treatments (e.g. rounded corners) 268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com*/ 277ffb1b21abcc7bbed5a0fc711f6dd7b9dbb4f577ctguil@chromium.orgclass SK_API SkCornerPathEffect : public SkPathEffect { 288a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.compublic: 298a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com /** radius must be > 0 to have an effect. It specifies the distance from each corner 308a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com that should be "rounded". 318a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com */ 328a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com SkCornerPathEffect(SkScalar radius); 338a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com virtual ~SkCornerPathEffect(); 348a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 358a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com // overrides for SkPathEffect 368a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com // This method is not exported to java. 378a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width); 388a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 398a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com // overrides for SkFlattenable 408a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com // This method is not exported to java. 418a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com virtual Factory getFactory(); 428a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com // This method is not exported to java. 438a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com virtual void flatten(SkFlattenableWriteBuffer&); 448a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 456bac947cd5bc460dd9166ada6310d678fd2e39f8reed@google.com static SkFlattenable* CreateProc(SkFlattenableReadBuffer&); 466bac947cd5bc460dd9166ada6310d678fd2e39f8reed@google.com 478a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprotected: 488a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com SkCornerPathEffect(SkFlattenableReadBuffer&); 498a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 508a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprivate: 518a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com SkScalar fRadius; 528a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 538a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com typedef SkPathEffect INHERITED; 548a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com}; 558a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 568a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif 578a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 58