Flutter Engine
text_shadow.cc
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Google, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "text_shadow.h"
18 #include "third_party/skia/include/core/SkColor.h"
19 
20 namespace txt {
21 
24  : color(color), offset(offset), blur_radius(blur_radius) {}
25 
26 bool TextShadow::operator==(const TextShadow& other) const {
27  if (color != other.color)
28  return false;
29  if (offset != other.offset)
30  return false;
31  if (blur_radius != other.blur_radius)
32  return false;
33 
34  return true;
35 }
36 
37 bool TextShadow::operator!=(const TextShadow& other) const {
38  return !(*this == other);
39 }
40 
41 bool TextShadow::hasShadow() const {
42  if (!offset.isZero())
43  return true;
44  if (blur_radius != 0.0)
45  return true;
46 
47  return false;
48 }
49 
50 } // namespace txt
SkPoint offset
Definition: text_shadow.h:28
bool operator==(const TextShadow &other) const
Definition: text_shadow.cc:26
double blur_radius
Definition: text_shadow.h:29
bool operator!=(const TextShadow &other) const
Definition: text_shadow.cc:37
bool hasShadow() const
Definition: text_shadow.cc:41