Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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"
19
20namespace txt {
21
24 : color(color), offset(offset), blur_sigma(blur_sigma) {}
25
26bool 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_sigma != other.blur_sigma)
32 return false;
33
34 return true;
35}
36
37bool TextShadow::operator!=(const TextShadow& other) const {
38 return !(*this == other);
39}
40
42 if (!offset.isZero())
43 return true;
44 if (blur_sigma > 0.5)
45 return true;
46
47 return false;
48}
49
50} // namespace txt
SkColor4f color
uint32_t SkColor
Definition SkColor.h:37
bool hasShadow() const
bool operator==(const TextShadow &other) const
bool operator!=(const TextShadow &other) const
Point offset
bool isZero() const