Flutter Engine
 
Loading...
Searching...
No Matches
dl_local_matrix_image_filter.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_IMAGE_FILTERS_DL_LOCAL_MATRIX_IMAGE_FILTER_H_
6#define FLUTTER_DISPLAY_LIST_EFFECTS_IMAGE_FILTERS_DL_LOCAL_MATRIX_IMAGE_FILTER_H_
7
9
10namespace flutter {
11
13 public:
15 const DlMatrix& matrix,
16 const std::shared_ptr<DlImageFilter>& filter)
17 : matrix_(matrix), image_filter_(filter) {}
19 : DlLocalMatrixImageFilter(filter->matrix_, filter->image_filter_) {}
22
23 std::shared_ptr<DlImageFilter> shared() const override {
24 return std::make_shared<DlLocalMatrixImageFilter>(this);
25 }
26
27 static std::shared_ptr<DlImageFilter> Make(
28 const DlMatrix& matrix,
29 const std::shared_ptr<DlImageFilter>& filter);
30
31 DlImageFilterType type() const override {
33 }
34 size_t size() const override { return sizeof(*this); }
35
36 const DlMatrix& matrix() const { return matrix_; }
37
38 const std::shared_ptr<DlImageFilter> image_filter() const {
39 return image_filter_;
40 }
41
42 const DlLocalMatrixImageFilter* asLocalMatrix() const override {
43 return this;
44 }
45
46 bool modifies_transparent_black() const override;
47
48 DlRect* map_local_bounds(const DlRect& input_bounds,
49 DlRect& output_bounds) const override;
50
51 DlIRect* map_device_bounds(const DlIRect& input_bounds,
52 const DlMatrix& ctm,
53 DlIRect& output_bounds) const override;
54
55 DlIRect* get_input_device_bounds(const DlIRect& output_bounds,
56 const DlMatrix& ctm,
57 DlIRect& input_bounds) const override;
58
59 protected:
60 bool equals_(const DlImageFilter& other) const override;
61
62 private:
63 DlMatrix matrix_;
64 std::shared_ptr<DlImageFilter> image_filter_;
65};
66
67} // namespace flutter
68
69#endif // FLUTTER_DISPLAY_LIST_EFFECTS_IMAGE_FILTERS_DL_LOCAL_MATRIX_IMAGE_FILTER_H_
DlLocalMatrixImageFilter(const DlLocalMatrixImageFilter &filter)
const DlLocalMatrixImageFilter * asLocalMatrix() const override
bool equals_(const DlImageFilter &other) const override
DlIRect * map_device_bounds(const DlIRect &input_bounds, const DlMatrix &ctm, DlIRect &output_bounds) const override
DlLocalMatrixImageFilter(const DlLocalMatrixImageFilter *filter)
DlImageFilterType type() const override
DlIRect * get_input_device_bounds(const DlIRect &output_bounds, const DlMatrix &ctm, DlIRect &input_bounds) const override
static std::shared_ptr< DlImageFilter > Make(const DlMatrix &matrix, const std::shared_ptr< DlImageFilter > &filter)
const std::shared_ptr< DlImageFilter > image_filter() const
std::shared_ptr< DlImageFilter > shared() const override
DlRect * map_local_bounds(const DlRect &input_bounds, DlRect &output_bounds) const override
DlLocalMatrixImageFilter(const DlMatrix &matrix, const std::shared_ptr< DlImageFilter > &filter)
A 4x4 matrix using column-major storage.
Definition matrix.h:37