18a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com/*
2ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Copyright 2006 The Android Open Source Project
38a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com *
4ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Use of this source code is governed by a BSD-style license that can be
5ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * found in the LICENSE file.
68a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com */
78a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
88a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#ifndef SkCornerPathEffect_DEFINED
98a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#define SkCornerPathEffect_DEFINED
108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkPathEffect.h"
128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
138a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com/** \class SkCornerPathEffect
148a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
158a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkCornerPathEffect is a subclass of SkPathEffect that can turn sharp corners
168a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    into various treatments (e.g. rounded corners)
178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com*/
187ffb1b21abcc7bbed5a0fc711f6dd7b9dbb4f577ctguil@chromium.orgclass SK_API SkCornerPathEffect : public SkPathEffect {
198a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.compublic:
208a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    /** radius must be > 0 to have an effect. It specifies the distance from each corner
218a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com        that should be "rounded".
228a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    */
230a2bf90dccba3bde188e0386a7f0c60e6dde1ae9commit-bot@chromium.org    static SkCornerPathEffect* Create(SkScalar radius) {
240a2bf90dccba3bde188e0386a7f0c60e6dde1ae9commit-bot@chromium.org        return SkNEW_ARGS(SkCornerPathEffect, (radius));
250a2bf90dccba3bde188e0386a7f0c60e6dde1ae9commit-bot@chromium.org    }
268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual ~SkCornerPathEffect();
278a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
28548a1f321011292359ef163f78c8a1d4871b3b7freed@google.com    virtual bool filterPath(SkPath* dst, const SkPath& src,
294bbdeac58cc928dc66296bde3bd06e78070d96b7reed@google.com                            SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
308a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
31ba28d03e94dc221d6a803bf2a84a420b9159255cdjsollen@google.com    SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkCornerPathEffect)
326bac947cd5bc460dd9166ada6310d678fd2e39f8reed@google.com
338a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprotected:
34bd0be25074e53a6d1abc284562568c9745191984commit-bot@chromium.org    explicit SkCornerPathEffect(SkScalar radius);
359fa60daad4d5f54c0dbe3dbcc7608a8f6d721187reed#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
36bd0be25074e53a6d1abc284562568c9745191984commit-bot@chromium.org    explicit SkCornerPathEffect(SkReadBuffer&);
379fa60daad4d5f54c0dbe3dbcc7608a8f6d721187reed#endif
388b0e8ac5f582de80356019406e2975079bf0829dcommit-bot@chromium.org    virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
398a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
408a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprivate:
418a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkScalar    fRadius;
42fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com
438a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    typedef SkPathEffect INHERITED;
448a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com};
458a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
468a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif
47