Flutter Engine
The Flutter Engine
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
13namespace flutter {
14
15std::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
27 << "Cannot create a Skia snapshot controller in an Impeller build.";
28 return nullptr;
29#endif // !SLIMPELLER
30}
31
33 : delegate_(delegate) {}
34
35} // namespace flutter
static std::unique_ptr< SnapshotController > Make(const Delegate &delegate, const Settings &settings)
SnapshotController(const Delegate &delegate)
MockDelegate delegate_
#define FATAL(error)
#define FML_LOG(severity)
Definition: logging.h:82