blob: 6df35f46ba9e87115f348d42b9139d60b0329f67 [file] [log] [blame]
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001// Copyright 2019 Google LLC.
Julia Lavrovaa3552c52019-05-30 16:12:56 -04002#include "include/core/SkColor.h"
Greg Danielf91aeb22019-06-18 09:58:02 -04003#include "modules/skparagraph/include/TextShadow.h"
Julia Lavrovaa3552c52019-05-30 16:12:56 -04004
5namespace skia {
6namespace textlayout {
7
8TextShadow::TextShadow() = default;
9TextShadow::TextShadow(SkColor color, SkPoint offset, double blurRadius)
10 : fColor(color), fOffset(offset), fBlurRadius(blurRadius) {}
11
12bool TextShadow::operator==(const TextShadow& other) const {
13 if (fColor != other.fColor) return false;
14 if (fOffset != other.fOffset) return false;
15 if (fBlurRadius != other.fBlurRadius) return false;
16
17 return true;
18}
19
20bool TextShadow::operator!=(const TextShadow& other) const { return !(*this == other); }
21
22bool TextShadow::hasShadow() const {
23 if (!fOffset.isZero()) return true;
24 if (fBlurRadius != 0.0) return true;
25
26 return false;
27}
28
29} // namespace textlayout
30} // namespace skia