Flutter Engine
The Flutter Engine
third_party
txt
src
txt
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
22
TextShadow::TextShadow
() {}
23
TextShadow::TextShadow
(
SkColor
color
,
SkPoint
offset
,
double
blur_sigma)
24
:
color
(
color
),
offset
(
offset
), blur_sigma(blur_sigma) {}
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_sigma
!= other.
blur_sigma
)
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_sigma
> 0.5)
45
return
true
;
46
47
return
false
;
48
}
49
50
}
// namespace txt
SkColor.h
SkColor
uint32_t SkColor
Definition:
SkColor.h:37
txt::TextShadow
Definition:
text_shadow.h:25
txt::TextShadow::hasShadow
bool hasShadow() const
Definition:
text_shadow.cc:41
txt::TextShadow::color
SkColor color
Definition:
text_shadow.h:27
txt::TextShadow::TextShadow
TextShadow()
Definition:
text_shadow.cc:22
txt::TextShadow::offset
SkPoint offset
Definition:
text_shadow.h:28
txt::TextShadow::blur_sigma
double blur_sigma
Definition:
text_shadow.h:29
txt::TextShadow::operator==
bool operator==(const TextShadow &other) const
Definition:
text_shadow.cc:26
txt::TextShadow::operator!=
bool operator!=(const TextShadow &other) const
Definition:
text_shadow.cc:37
color
DlColor color
Definition:
dl_golden_blur_unittests.cc:23
txt
Definition:
paragraph_builder_skia.cc:27
offset
SeparatedVector2 offset
Definition:
stroke_path_geometry.cc:311
SkPoint
Definition:
SkPoint_impl.h:163
SkPoint::isZero
bool isZero() const
Definition:
SkPoint_impl.h:193
text_shadow.h
Generated on Sun Jun 23 2024 21:56:53 for Flutter Engine by
1.9.4