1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "third_party/blink/renderer/core/style/style_ray.h"
6 
7 namespace blink {
8 
Create(float angle,RaySize size,bool contain)9 scoped_refptr<StyleRay> StyleRay::Create(float angle,
10                                          RaySize size,
11                                          bool contain) {
12   return base::AdoptRef(new StyleRay(angle, size, contain));
13 }
14 
StyleRay(float angle,RaySize size,bool contain)15 StyleRay::StyleRay(float angle, RaySize size, bool contain)
16     : angle_(angle), size_(size), contain_(contain) {}
17 
operator ==(const BasicShape & o) const18 bool StyleRay::operator==(const BasicShape& o) const {
19   if (!IsSameType(o))
20     return false;
21   const StyleRay& other = To<StyleRay>(o);
22   return angle_ == other.angle_ && size_ == other.size_ &&
23          contain_ == other.contain_;
24 }
25 
GetPath(Path &,const FloatRect &)26 void StyleRay::GetPath(Path&, const FloatRect&) {
27   // ComputedStyle::ApplyMotionPathTransform cannot call GetPath
28   // for rays as they may have infinite length.
29   NOTREACHED();
30 }
31 
32 }  // namespace blink
33