Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkSVGClipPath_DEFINED |
| 9 | #define SkSVGClipPath_DEFINED |
| 10 | |
| 11 | #include "modules/svg/include/SkSVGHiddenContainer.h" |
| 12 | #include "modules/svg/include/SkSVGTypes.h" |
| 13 | |
| 14 | class SkSVGClipPath final : public SkSVGHiddenContainer { |
| 15 | public: |
| 16 | static sk_sp<SkSVGClipPath> Make() { |
| 17 | return sk_sp<SkSVGClipPath>(new SkSVGClipPath()); |
| 18 | } |
| 19 | |
Florin Malita | 3c10618 | 2021-01-14 13:44:06 -0500 | [diff] [blame] | 20 | SVG_ATTR(ClipPathUnits, SkSVGObjectBoundingBoxUnits, |
| 21 | SkSVGObjectBoundingBoxUnits(SkSVGObjectBoundingBoxUnits::Type::kUserSpaceOnUse)) |
| 22 | |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 23 | private: |
Florin Malita | 3c10618 | 2021-01-14 13:44:06 -0500 | [diff] [blame] | 24 | friend class SkSVGRenderContext; |
| 25 | |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 26 | SkSVGClipPath(); |
| 27 | |
Florin Malita | 3c10618 | 2021-01-14 13:44:06 -0500 | [diff] [blame] | 28 | bool parseAndSetAttribute(const char*, const char*) override; |
| 29 | |
| 30 | SkPath resolveClip(const SkSVGRenderContext&) const; |
| 31 | |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 32 | using INHERITED = SkSVGHiddenContainer; |
| 33 | }; |
| 34 | |
| 35 | #endif // SkSVGClipPath_DEFINED |