| Flutter Impeller |

playground_impl_mtl.h
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 #pragma once
6
7 #include <memory>
8
9 #include "flutter/fml/concurrent_message_loop.h"
10 #include "flutter/fml/macros.h"
11 #include "flutter/fml/synchronization/sync_switch.h"
12 #include "impeller/playground/playground_impl.h"
13
14 namespace impeller {
15
16 class PlaygroundImplMTL final : public PlaygroundImpl {
17 public:
18 explicit PlaygroundImplMTL(PlaygroundSwitches switches);
19
20 ~PlaygroundImplMTL();
21
22 private:
23 struct Data;
24
25 static void DestroyWindowHandle(WindowHandle handle);
26 using UniqueHandle = std::unique_ptr<void, decltype(&DestroyWindowHandle)>;
27 UniqueHandle handle_;
28
29 // To ensure that ObjC stuff doesn't leak into C++ TUs.
30 std::unique_ptr<Data> data_;
31 std::shared_ptr<Context> context_;
32 std::shared_ptr<fml::ConcurrentMessageLoop> concurrent_loop_;
33 std::shared_ptr<const fml::SyncSwitch> is_gpu_disabled_sync_switch_;
34
35 // |PlaygroundImpl|
36 std::shared_ptr<Context> GetContext() const override;
37
38 // |PlaygroundImpl|
39 WindowHandle GetWindowHandle() const override;
40
41 // |PlaygroundImpl|
42 std::unique_ptr<Surface> AcquireSurfaceFrame(
43 std::shared_ptr<Context> context) override;
44
45 FML_DISALLOW_COPY_AND_ASSIGN(PlaygroundImplMTL);
46 };
47
48 } // namespace impeller
impeller::PlaygroundImplMTL::~PlaygroundImplMTL
~PlaygroundImplMTL()
impeller::PlaygroundImplMTL::Data
Definition: playground_impl_mtl.mm:31
impeller::PlaygroundImplMTL
Definition: playground_impl_mtl.h:16
impeller::PlaygroundImpl
Definition: playground_impl.h:17
impeller::PlaygroundSwitches
Definition: switches.h:15
impeller::PlaygroundImplMTL::PlaygroundImplMTL
PlaygroundImplMTL(PlaygroundSwitches switches)
Definition: playground_impl_mtl.mm:63
playground_impl.h
impeller
Definition: aiks_context.cc:10
impeller::PlaygroundImpl::WindowHandle
void * WindowHandle
Definition: playground_impl.h:24