Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Unified Diff: third_party/WebKit/Source/core/style/StyleRay.h

Issue 2881673003: CSS Motion Path: Support parsing of ray(<angle>) paths (Closed)
Patch Set: DCHECK_EQ Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/style/StyleRay.h
diff --git a/third_party/WebKit/Source/core/style/StyleRay.h b/third_party/WebKit/Source/core/style/StyleRay.h
new file mode 100644
index 0000000000000000000000000000000000000000..c7f93c31e1d86b4a64f7b5f3a0932c79a3b666a3
--- /dev/null
+++ b/third_party/WebKit/Source/core/style/StyleRay.h
@@ -0,0 +1,47 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef StyleRay_h
+#define StyleRay_h
+
+#include "core/style/BasicShapes.h"
+
+namespace blink {
+
+class StyleRay : public BasicShape {
+ public:
+ enum class RaySize {
+ kClosestSide,
+ kClosestCorner,
+ kFarthestSide,
+ kFarthestCorner,
+ kSides
+ };
+
+ static PassRefPtr<StyleRay> Create(float angle, RaySize, bool contain);
+ virtual ~StyleRay() {}
+
+ float Angle() const { return angle_; }
+ RaySize Size() const { return size_; }
+ bool Contain() const { return contain_; }
+
+ void GetPath(Path&, const FloatRect&) override;
+ PassRefPtr<BasicShape> Blend(const BasicShape*, double) const override;
+ bool operator==(const BasicShape&) const override;
+
+ ShapeType GetType() const override { return kStyleRayType; }
+
+ private:
+ StyleRay(float angle, RaySize, bool contain);
+
+ float angle_;
+ RaySize size_;
+ bool contain_;
+};
+
+DEFINE_BASICSHAPE_TYPE_CASTS(StyleRay);
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698