| Flutter Impeller |

color_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
5 #include "impeller/toolkit/interop/color_filter.h"
6
7 namespace impeller::interop {
8
9 ScopedObject<ColorFilter> ColorFilter::MakeBlend(Color color, BlendMode mode) {
10 auto filter = flutter::DlColorFilter::MakeBlend(ToDisplayListType(color),
11 ToDisplayListType(mode));
12 if (!filter) {
13 return nullptr;
14 }
15 return Create<ColorFilter>(std::move(filter));
16 }
17
18 ScopedObject<ColorFilter> ColorFilter::MakeMatrix(const float matrix[20]) {
19 auto filter = flutter::DlColorFilter::MakeMatrix(matrix);
20 if (!filter) {
21 return nullptr;
22 }
23 return Create<ColorFilter>(std::move(filter));
24 }
25
26 ColorFilter::ColorFilter(std::shared_ptr<const flutter::DlColorFilter> filter)
27 : filter_(std::move(filter)) {}
28
29 ColorFilter::~ColorFilter() = default;
30
31 const std::shared_ptr<const flutter::DlColorFilter>&
32 ColorFilter::GetColorFilter() const {
33 return filter_;
34 }
35
36 } // namespace impeller::interop
impeller::interop::ColorFilter::~ColorFilter
~ColorFilter() override
impeller::interop::ColorFilter::GetColorFilter
const std::shared_ptr< const flutter::DlColorFilter > & GetColorFilter() const
Definition: color_filter.cc:32
impeller::interop::ColorFilter::ColorFilter
ColorFilter(std::shared_ptr< const flutter::DlColorFilter > filter)
Definition: color_filter.cc:26
impeller::interop::ColorFilter::MakeMatrix
static ScopedObject< ColorFilter > MakeMatrix(const float matrix[20])
Definition: color_filter.cc:18
impeller::interop::ColorFilter::MakeBlend
static ScopedObject< ColorFilter > MakeBlend(Color color, BlendMode mode)
Definition: color_filter.cc:9
impeller::interop::ScopedObject
Definition: object.h:67
impeller::interop
Definition: context_gles.cc:12
impeller::interop::ToDisplayListType
constexpr flutter::DlColor ToDisplayListType(Color color)
Definition: formats.h:77
impeller::BlendMode
BlendMode
Definition: color.h:58
std
Definition: comparable.h:95
impeller::Color
Definition: color.h:124
color_filter.h