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 #include "base/notreached.h"
8 
9 namespace blink {
10 
Create(float angle,RaySize size,bool contain)11 scoped_refptr<StyleRay> StyleRay::Create(float angle,
12                                          RaySize size,
13                                          bool contain) {
14   return base::AdoptRef(new StyleRay(angle, size, contain));
15 }
16 
StyleRay(float angle,RaySize size,bool contain)17 StyleRay::StyleRay(float angle, RaySize size, bool contain)
18     : angle_(angle), size_(size), contain_(contain) {}
19 
operator ==(const BasicShape & o) const20 bool StyleRay::operator==(const BasicShape& o) const {
21   if (!IsSameType(o))
22     return false;
23   const StyleRay& other = To<StyleRay>(o);
24   return angle_ == other.angle_ && size_ == other.size_ &&
25          contain_ == other.contain_;
26 }
27 
GetPath(Path &,const FloatRect &,float)28 void StyleRay::GetPath(Path&, const FloatRect&, float) {
29   // ComputedStyle::ApplyMotionPathTransform cannot call GetPath
30   // for rays as they may have infinite length.
31   NOTREACHED();
32 }
33 
34 }  // namespace blink
35