Flutter Engine
 
Loading...
Searching...
No Matches
dl_matrix_color_source_base.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_MATRIX_COLOR_SOURCE_BASE_H_
6#define FLUTTER_DISPLAY_LIST_EFFECTS_COLOR_SOURCES_DL_MATRIX_COLOR_SOURCE_BASE_H_
7
9
10namespace flutter {
11
12// Utility base class common to all DlColorSource implementations that
13// hold an optional DlMatrix
15 public:
16 const DlMatrix& matrix() const { return matrix_; }
17 const DlMatrix* matrix_ptr() const {
18 return matrix_.IsIdentity() ? nullptr : &matrix_;
19 }
20
21 protected:
23 : matrix_(matrix ? *matrix : DlMatrix()) {}
24
25 private:
26 const DlMatrix matrix_;
27};
28
29} // namespace flutter
30
31#endif // FLUTTER_DISPLAY_LIST_EFFECTS_COLOR_SOURCES_DL_MATRIX_COLOR_SOURCE_BASE_H_
A 4x4 matrix using column-major storage.
Definition matrix.h:37
constexpr bool IsIdentity() const
Definition matrix.h:467