Flutter Engine
 
Loading...
Searching...
No Matches
dl_image_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
10 DlTileMode horizontal_tile_mode,
11 DlTileMode vertical_tile_mode,
12 DlImageSampling sampling,
13 const DlMatrix* matrix)
15 image_(std::move(image)),
16 horizontal_tile_mode_(horizontal_tile_mode),
17 vertical_tile_mode_(vertical_tile_mode),
18 sampling_(sampling) {}
19
20std::shared_ptr<DlColorSource> DlImageColorSource::WithSampling(
21 DlImageSampling sampling) const {
22 return std::make_shared<DlImageColorSource>(image_, horizontal_tile_mode_,
23 vertical_tile_mode_, sampling,
24 matrix_ptr());
25}
26
29 auto that = static_cast<DlImageColorSource const*>(&other);
30 return (image_->Equals(that->image_) && matrix() == that->matrix() &&
31 horizontal_tile_mode_ == that->horizontal_tile_mode_ &&
32 vertical_tile_mode_ == that->vertical_tile_mode_ &&
33 sampling_ == that->sampling_);
34}
35
36} // namespace flutter
virtual T type() const =0
bool equals_(DlColorSource const &other) const override
DlImageColorSource(sk_sp< const DlImage > image, DlTileMode horizontal_tile_mode, DlTileMode vertical_tile_mode, DlImageSampling sampling=DlImageSampling::kLinear, const DlMatrix *matrix=nullptr)
DlImageSampling sampling() const
std::shared_ptr< DlColorSource > WithSampling(DlImageSampling sampling) const
FlutterVulkanImage * image
#define FML_DCHECK(condition)
Definition logging.h:122
Definition ref_ptr.h:261
A 4x4 matrix using column-major storage.
Definition matrix.h:37