Flutter Engine
The Flutter Engine
dl_runtime_effect.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 "flutter/display_list/effects/dl_runtime_effect.h"
6
8
9namespace flutter {
10
11//------------------------------------------------------------------------------
12/// DlRuntimeEffect
13///
14
17
19 const sk_sp<SkRuntimeEffect>& runtime_effect) {
20 return sk_make_sp<DlRuntimeEffectSkia>(runtime_effect);
21}
22
24 std::shared_ptr<impeller::RuntimeStage> runtime_stage) {
25 return sk_make_sp<DlRuntimeEffectImpeller>(std::move(runtime_stage));
26}
27
28//------------------------------------------------------------------------------
29/// DlRuntimeEffectSkia
30///
31
32DlRuntimeEffectSkia::~DlRuntimeEffectSkia() = default;
33
34DlRuntimeEffectSkia::DlRuntimeEffectSkia(
35 const sk_sp<SkRuntimeEffect>& runtime_effect)
36 : skia_runtime_effect_(runtime_effect) {}
37
39 return skia_runtime_effect_;
40}
41
42std::shared_ptr<impeller::RuntimeStage> DlRuntimeEffectSkia::runtime_stage()
43 const {
44 return nullptr;
45}
46
47//------------------------------------------------------------------------------
48/// DlRuntimeEffectImpeller
49///
50
51DlRuntimeEffectImpeller::~DlRuntimeEffectImpeller() = default;
52
53DlRuntimeEffectImpeller::DlRuntimeEffectImpeller(
54 std::shared_ptr<impeller::RuntimeStage> runtime_stage)
55 : runtime_stage_(std::move(runtime_stage)){};
56
58 return nullptr;
59}
60
61std::shared_ptr<impeller::RuntimeStage> DlRuntimeEffectImpeller::runtime_stage()
62 const {
63 return runtime_stage_;
64}
65
66} // namespace flutter
sk_sp< SkRuntimeEffect > skia_runtime_effect() const override
std::shared_ptr< impeller::RuntimeStage > runtime_stage() const override
sk_sp< SkRuntimeEffect > skia_runtime_effect() const override
std::shared_ptr< impeller::RuntimeStage > runtime_stage() const override
static sk_sp< DlRuntimeEffect > MakeSkia(const sk_sp< SkRuntimeEffect > &runtime_effect)
virtual std::shared_ptr< impeller::RuntimeStage > runtime_stage() const =0
static sk_sp< DlRuntimeEffect > MakeImpeller(std::shared_ptr< impeller::RuntimeStage > runtime_stage)
Definition: ref_ptr.h:256