Flutter Engine
 
Loading...
Searching...
No Matches
dl_sweep_gradient_color_source.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter 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
6
7namespace flutter {
8
9DlSweepGradientColorSource::DlSweepGradientColorSource(
10 const DlSweepGradientColorSource* source)
11 : DlGradientColorSourceBase(source->stop_count(),
12 source->tile_mode(),
13 source->matrix_ptr()),
14 center_(source->center()),
15 start_(source->start()),
16 end_(source->end()) {
17 store_color_stops(this + 1, source->colors(), source->stops());
18}
19
20std::shared_ptr<DlColorSource> DlSweepGradientColorSource::shared() const {
21 return MakeSweep(center_, start_, end_, stop_count(), colors(), stops(),
22 tile_mode(), matrix_ptr());
23}
24
25bool DlSweepGradientColorSource::equals_(DlColorSource const& other) const {
26 FML_DCHECK(other.type() == DlColorSourceType::kSweepGradient);
27 auto that = static_cast<DlSweepGradientColorSource const*>(&other);
28 return (center_ == that->center_ && start_ == that->start_ &&
29 end_ == that->end_ && base_equals_(that));
30}
31
32} // namespace flutter
virtual T type() const =0
#define FML_DCHECK(condition)
Definition logging.h:122
const size_t start
const size_t end