Flutter Engine
 
Loading...
Searching...
No Matches
dl_image_color_source.h
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
5#ifndef FLUTTER_DISPLAY_LIST_EFFECTS_COLOR_SOURCES_DL_IMAGE_COLOR_SOURCE_H_
6#define FLUTTER_DISPLAY_LIST_EFFECTS_COLOR_SOURCES_DL_IMAGE_COLOR_SOURCE_H_
7
9
10namespace flutter {
11
13 public:
14 DlImageColorSource(sk_sp<const DlImage> image,
18 const DlMatrix* matrix = nullptr);
19
20 bool isUIThreadSafe() const override {
21 return image_ ? image_->isUIThreadSafe() : true;
22 }
23
24 const DlImageColorSource* asImage() const override { return this; }
25
26 std::shared_ptr<DlColorSource> shared() const override {
27 return WithSampling(sampling_);
28 }
29
30 std::shared_ptr<DlColorSource> WithSampling(DlImageSampling sampling) const;
31
33 size_t size() const override { return sizeof(*this); }
34
35 bool is_opaque() const override { return image_->isOpaque(); }
36
37 sk_sp<const DlImage> image() const { return image_; }
38 DlTileMode horizontal_tile_mode() const { return horizontal_tile_mode_; }
39 DlTileMode vertical_tile_mode() const { return vertical_tile_mode_; }
40 DlImageSampling sampling() const { return sampling_; }
41
42 protected:
43 bool equals_(DlColorSource const& other) const override;
44
45 private:
46 sk_sp<const DlImage> image_;
47 DlTileMode horizontal_tile_mode_;
48 DlTileMode vertical_tile_mode_;
49 DlImageSampling sampling_;
50
52};
53
54} // namespace flutter
55
56#endif // FLUTTER_DISPLAY_LIST_EFFECTS_COLOR_SOURCES_DL_IMAGE_COLOR_SOURCE_H_
bool equals_(DlColorSource const &other) const override
std::shared_ptr< DlColorSource > shared() const override
bool isUIThreadSafe() const override
If the underlying platform data held by this object is held in a way that it can be stored and potent...
DlImageSampling sampling() const
DlColorSourceType type() const override
std::shared_ptr< DlColorSource > WithSampling(DlImageSampling sampling) const
const DlImageColorSource * asImage() const override
DlTileMode horizontal_tile_mode() const
sk_sp< const DlImage > image() const
#define FML_DISALLOW_COPY_ASSIGN_AND_MOVE(TypeName)
Definition macros.h:31
A 4x4 matrix using column-major storage.
Definition matrix.h:37