| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
| 15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
| 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 #ifndef LayoutSVGResourceMasker_h | 20 #ifndef LayoutSVGResourceMasker_h |
| 21 #define LayoutSVGResourceMasker_h | 21 #define LayoutSVGResourceMasker_h |
| 22 | 22 |
| 23 #include "core/layout/svg/LayoutSVGResourceContainer.h" | 23 #include "core/layout/svg/LayoutSVGResourceContainer.h" |
| 24 #include "core/svg/SVGMaskElement.h" | 24 #include "core/svg/SVGMaskElement.h" |
| 25 #include "core/svg/SVGUnitTypes.h" | 25 #include "core/svg/SVGUnitTypes.h" |
| 26 #include "platform/geometry/FloatRect.h" | 26 #include "platform/geometry/FloatRect.h" |
| 27 #include "skia/ext/cdl_common.h" |
| 27 #include "third_party/skia/include/core/SkRefCnt.h" | 28 #include "third_party/skia/include/core/SkRefCnt.h" |
| 28 | 29 |
| 29 class SkPicture; | |
| 30 | |
| 31 namespace blink { | 30 namespace blink { |
| 32 | 31 |
| 33 class AffineTransform; | 32 class AffineTransform; |
| 34 class GraphicsContext; | 33 class GraphicsContext; |
| 35 | 34 |
| 36 class LayoutSVGResourceMasker final : public LayoutSVGResourceContainer { | 35 class LayoutSVGResourceMasker final : public LayoutSVGResourceContainer { |
| 37 public: | 36 public: |
| 38 explicit LayoutSVGResourceMasker(SVGMaskElement*); | 37 explicit LayoutSVGResourceMasker(SVGMaskElement*); |
| 39 ~LayoutSVGResourceMasker() override; | 38 ~LayoutSVGResourceMasker() override; |
| 40 | 39 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 55 SVGUnitTypes::SVGUnitType maskContentUnits() const { | 54 SVGUnitTypes::SVGUnitType maskContentUnits() const { |
| 56 return toSVGMaskElement(element()) | 55 return toSVGMaskElement(element()) |
| 57 ->maskContentUnits() | 56 ->maskContentUnits() |
| 58 ->currentValue() | 57 ->currentValue() |
| 59 ->enumValue(); | 58 ->enumValue(); |
| 60 } | 59 } |
| 61 | 60 |
| 62 static const LayoutSVGResourceType s_resourceType = MaskerResourceType; | 61 static const LayoutSVGResourceType s_resourceType = MaskerResourceType; |
| 63 LayoutSVGResourceType resourceType() const override { return s_resourceType; } | 62 LayoutSVGResourceType resourceType() const override { return s_resourceType; } |
| 64 | 63 |
| 65 sk_sp<const SkPicture> createContentPicture(AffineTransform&, | 64 sk_sp<const CdlPicture> createContentPicture(AffineTransform&, |
| 66 const FloatRect&, | 65 const FloatRect&, |
| 67 GraphicsContext&); | 66 GraphicsContext&); |
| 68 | 67 |
| 69 private: | 68 private: |
| 70 void calculateMaskContentVisualRect(); | 69 void calculateMaskContentVisualRect(); |
| 71 | 70 |
| 72 sk_sp<const SkPicture> m_maskContentPicture; | 71 sk_sp<const CdlPicture> m_maskContentPicture; |
| 73 FloatRect m_maskContentBoundaries; | 72 FloatRect m_maskContentBoundaries; |
| 74 }; | 73 }; |
| 75 | 74 |
| 76 DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(LayoutSVGResourceMasker, | 75 DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(LayoutSVGResourceMasker, |
| 77 MaskerResourceType); | 76 MaskerResourceType); |
| 78 | 77 |
| 79 } // namespace blink | 78 } // namespace blink |
| 80 | 79 |
| 81 #endif | 80 #endif |
| OLD | NEW |