Flutter Engine
Loading...
Searching...
No Matches
snapshot_controller.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/shell/common/snapshot_controller.h
"
6
7
#include "
flutter/shell/common/snapshot_controller_skia.h
"
8
9
#if IMPELLER_SUPPORTS_RENDERING
10
#include "
flutter/shell/common/snapshot_controller_impeller.h
"
11
#endif
// IMPELLER_SUPPORTS_RENDERING
12
13
namespace
flutter
{
14
15
std::unique_ptr<SnapshotController>
SnapshotController::Make
(
16
const
Delegate
& delegate,
17
const
Settings
& settings) {
18
#if IMPELLER_SUPPORTS_RENDERING
19
if
(settings.
enable_impeller
) {
20
return
std::make_unique<SnapshotControllerImpeller>(delegate);
21
}
22
#endif
// IMPELLER_SUPPORTS_RENDERING
23
#if !SLIMPELLER
24
return
std::make_unique<SnapshotControllerSkia>(delegate);
25
#else
// !SLIMPELLER
26
FML_LOG
(FATAL)
27
<<
"Cannot create a Skia snapshot controller in an Impeller build."
;
28
return
nullptr
;
29
#endif
// !SLIMPELLER
30
}
31
32
SnapshotController::SnapshotController
(
const
Delegate
& delegate)
33
:
delegate_
(delegate) {}
34
35
}
// namespace flutter
flutter::SnapshotController::Delegate
Definition
snapshot_controller.h:23
flutter::SnapshotController::Make
static std::unique_ptr< SnapshotController > Make(const Delegate &delegate, const Settings &settings)
Definition
snapshot_controller.cc:15
flutter::SnapshotController::SnapshotController
SnapshotController(const Delegate &delegate)
Definition
snapshot_controller.cc:32
delegate_
MockDelegate delegate_
Definition
engine_animator_unittests.cc:173
FML_LOG
#define FML_LOG(severity)
Definition
logging.h:101
flutter
Definition
asset_manager.cc:10
snapshot_controller.h
snapshot_controller_impeller.h
snapshot_controller_skia.h
flutter::Settings
Definition
settings.h:98
flutter::Settings::enable_impeller
bool enable_impeller
Definition
settings.h:230
shell
common
snapshot_controller.cc
Generated on Thu Nov 6 2025 16:11:25 for Flutter Engine by
1.9.8