Flutter Engine
 
Loading...
Searching...
No Matches
dl_local_matrix_image_filter.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
8
9namespace flutter {
10
11std::shared_ptr<DlImageFilter> DlLocalMatrixImageFilter::Make(
12 const DlMatrix& matrix,
13 const std::shared_ptr<DlImageFilter>& filter) {
14 return std::make_shared<DlLocalMatrixImageFilter>(matrix, filter);
15}
16
18 if (!image_filter_) {
19 return false;
20 }
21 return image_filter_->modifies_transparent_black();
22}
23
25 const DlRect& input_bounds,
26 DlRect& output_bounds) const {
27 if (!image_filter_) {
28 output_bounds = input_bounds;
29 return &output_bounds;
30 }
31 return image_filter_->map_local_bounds(input_bounds, output_bounds);
32}
33
35 const DlIRect& input_bounds,
36 const DlMatrix& ctm,
37 DlIRect& output_bounds) const {
38 if (!image_filter_) {
39 output_bounds = input_bounds;
40 return &output_bounds;
41 }
42 return image_filter_->map_device_bounds(input_bounds, ctm * matrix_,
43 output_bounds);
44}
45
47 const DlIRect& output_bounds,
48 const DlMatrix& ctm,
49 DlIRect& input_bounds) const {
50 if (!image_filter_) {
51 input_bounds = output_bounds;
52 return &input_bounds;
53 }
54 return image_filter_->get_input_device_bounds(output_bounds, ctm * matrix_,
55 input_bounds);
56}
57
60 auto that = static_cast<const DlLocalMatrixImageFilter*>(&other);
61 return (matrix_ == that->matrix_ &&
62 Equals(image_filter_, that->image_filter_));
63}
64
65} // namespace flutter
virtual T type() const =0
bool equals_(const DlImageFilter &other) const override
DlIRect * map_device_bounds(const DlIRect &input_bounds, const DlMatrix &ctm, DlIRect &output_bounds) 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)
DlRect * map_local_bounds(const DlRect &input_bounds, DlRect &output_bounds) const override
#define FML_DCHECK(condition)
Definition logging.h:122
bool Equals(const T *a, const U *b)
A 4x4 matrix using column-major storage.
Definition matrix.h:37