Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
dl_test_surface_provider_impeller_metal.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
6
7#include "third_party/glfw/include/GLFW/glfw3.h"
8
9namespace flutter {
10namespace testing {
11
12std::unique_ptr<DlSurfaceProvider> DlSurfaceProvider::CreateImpellerMetal() {
13 return std::make_unique<DlSurfaceProviderImpellerMetal>();
14}
15
16std::unique_ptr<DlSurfaceProvider> DlSurfaceProvider::CreateImpellerMetalSDF() {
17 return std::make_unique<DlSurfaceProviderImpellerMetalSDF>();
18}
19
22
23std::unique_ptr<impeller::PlaygroundImpl>
24 DlSurfaceProviderImpellerMetal::playground_;
25
28
29std::unique_ptr<impeller::PlaygroundImpl>
30 DlSurfaceProviderImpellerMetalSDF::playground_;
31
33 const {
34 if (playground_ == nullptr) {
35 FML_CHECK(::glfwInit() == GLFW_TRUE);
37 switches.enable_wide_gamut = true;
38 switches.flags.use_sdfs = false;
40 }
41 return playground_.get();
42}
43
45 const {
46 if (playground_ == nullptr) {
47 FML_CHECK(::glfwInit() == GLFW_TRUE);
49 switches.enable_wide_gamut = true;
50 switches.flags.use_sdfs = true;
51 playground_ =
53 }
54 return playground_.get();
55}
56
58 return "ImpellerMetal";
59}
60
62 const {
63 return BackendType::kImpellerMetal;
64}
65
67 return "ImpellerMetalSDF";
68}
69
72 return BackendType::kImpellerMetalSDF;
73}
74
75} // namespace testing
76} // namespace flutter
static std::unique_ptr< impeller::PlaygroundImpl > MakePlayground(impeller::PlaygroundBackend backend, const impeller::PlaygroundSwitches &switches)
#define GLFW_TRUE
#define FML_CHECK(condition)
Definition logging.h:104
bool use_sdfs
Use SDFs for rendering.
Definition flags.h:13