| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google, Inc. | 2 * Copyright (C) 2012 Google, Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #ifndef LayoutSVGEllipse_h | 27 #ifndef LayoutSVGEllipse_h |
| 28 #define LayoutSVGEllipse_h | 28 #define LayoutSVGEllipse_h |
| 29 | 29 |
| 30 #include "core/layout/svg/LayoutSVGShape.h" | 30 #include "core/layout/svg/LayoutSVGShape.h" |
| 31 | 31 |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| 34 class LayoutSVGEllipse final : public LayoutSVGShape { | 34 class LayoutSVGEllipse final : public LayoutSVGShape { |
| 35 public: | 35 public: |
| 36 explicit LayoutSVGEllipse(SVGGeometryElement*); | 36 explicit LayoutSVGEllipse(SVGGeometryElement*); |
| 37 virtual ~LayoutSVGEllipse(); | 37 ~LayoutSVGEllipse() override; |
| 38 | 38 |
| 39 virtual ShapeGeometryCodePath geometryCodePath() const override { return m_u
sePathFallback ? PathGeometry : EllipseGeometryFastPath; } | 39 ShapeGeometryCodePath geometryCodePath() const override { return m_usePathFa
llback ? PathGeometry : EllipseGeometryFastPath; } |
| 40 | 40 |
| 41 virtual const char* name() const override { return "LayoutSVGEllipse"; } | 41 const char* name() const override { return "LayoutSVGEllipse"; } |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; | 44 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; |
| 45 void updateShapeFromElement() override; | 45 void updateShapeFromElement() override; |
| 46 void updateStrokeAndFillBoundingBoxes() override; | 46 void updateStrokeAndFillBoundingBoxes() override; |
| 47 virtual bool isShapeEmpty() const override { return m_usePathFallback ? Layo
utSVGShape::isShapeEmpty() : m_fillBoundingBox.isEmpty(); } | 47 bool isShapeEmpty() const override { return m_usePathFallback ? LayoutSVGSha
pe::isShapeEmpty() : m_fillBoundingBox.isEmpty(); } |
| 48 virtual bool shapeDependentStrokeContains(const FloatPoint&) override; | 48 bool shapeDependentStrokeContains(const FloatPoint&) override; |
| 49 virtual bool shapeDependentFillContains(const FloatPoint&, const WindRule) c
onst override; | 49 bool shapeDependentFillContains(const FloatPoint&, const WindRule) const ove
rride; |
| 50 void calculateRadiiAndCenter(); | 50 void calculateRadiiAndCenter(); |
| 51 bool hasContinuousStroke(const SVGComputedStyle&) const; | 51 bool hasContinuousStroke(const SVGComputedStyle&) const; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 FloatPoint m_center; | 54 FloatPoint m_center; |
| 55 FloatSize m_radii; | 55 FloatSize m_radii; |
| 56 bool m_usePathFallback; | 56 bool m_usePathFallback; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } | 59 } |
| 60 | 60 |
| 61 #endif | 61 #endif |
| OLD | NEW |