| Flutter Impeller |

playground_impl.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 #ifndef FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_IMPL_H_
6 #define FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_IMPL_H_
7
8 #include <functional>
9 #include <memory>
10
11 #include "impeller/playground/playground.h"
12 #include "impeller/playground/switches.h"
13 #include "impeller/renderer/context.h"
14 #include "impeller/renderer/surface.h"
15
16 namespace impeller {
17
18 class PlaygroundImpl {
19 public:
20 static std::unique_ptr<PlaygroundImpl> Create(PlaygroundBackend backend,
21 PlaygroundSwitches switches);
22
23 virtual ~PlaygroundImpl();
24
25 using WindowHandle = void*;
26
27 virtual WindowHandle GetWindowHandle() const = 0;
28
29 virtual std::shared_ptr<Context> GetContext() const = 0;
30
31 virtual std::unique_ptr<Surface> AcquireSurfaceFrame(
32 std::shared_ptr<Context> context) = 0;
33
34 Vector2 GetContentScale() const;
35
36 virtual fml::Status SetCapabilities(
37 const std::shared_ptr<Capabilities>& capabilities) = 0;
38
39 virtual Playground::GLProcAddressResolver CreateGLProcAddressResolver() const;
40
41 virtual Playground::VKProcAddressResolver CreateVKProcAddressResolver() const;
42
43 virtual void SetGPUDisabled(bool disabled) const {}
44
45 protected:
46 const PlaygroundSwitches switches_;
47
48 explicit PlaygroundImpl(PlaygroundSwitches switches);
49
50 private:
51 PlaygroundImpl(const PlaygroundImpl&) = delete;
52
53 PlaygroundImpl& operator=(const PlaygroundImpl&) = delete;
54 };
55
56 } // namespace impeller
57
58 #endif // FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_IMPL_H_
impeller::Playground::VKProcAddressResolver
std::function< void *(void *instance, const char *proc_name)> VKProcAddressResolver
Definition: playground.h:122
impeller::Playground::GLProcAddressResolver
std::function< void *(const char *proc_name)> GLProcAddressResolver
Definition: playground.h:118
impeller::PlaygroundImpl
Definition: playground_impl.h:18
impeller::PlaygroundImpl::PlaygroundImpl
PlaygroundImpl(PlaygroundSwitches switches)
Definition: playground_impl.cc:55
impeller::PlaygroundImpl::AcquireSurfaceFrame
virtual std::unique_ptr< Surface > AcquireSurfaceFrame(std::shared_ptr< Context > context)=0
impeller::PlaygroundImpl::~PlaygroundImpl
virtual ~PlaygroundImpl()
impeller::PlaygroundImpl::GetContentScale
Vector2 GetContentScale() const
Definition: playground_impl.cc:60
impeller::PlaygroundImpl::GetContext
virtual std::shared_ptr< Context > GetContext() const =0
impeller::PlaygroundImpl::GetWindowHandle
virtual WindowHandle GetWindowHandle() const =0
impeller::PlaygroundImpl::SetGPUDisabled
virtual void SetGPUDisabled(bool disabled) const
Definition: playground_impl.h:43
impeller::PlaygroundImpl::Create
static std::unique_ptr< PlaygroundImpl > Create(PlaygroundBackend backend, PlaygroundSwitches switches)
Definition: playground_impl.cc:25
impeller::PlaygroundImpl::CreateGLProcAddressResolver
virtual Playground::GLProcAddressResolver CreateGLProcAddressResolver() const
Definition: playground_impl.cc:69
impeller::PlaygroundImpl::WindowHandle
void * WindowHandle
Definition: playground_impl.h:25
impeller::PlaygroundImpl::switches_
const PlaygroundSwitches switches_
Definition: playground_impl.h:46
impeller::PlaygroundImpl::CreateVKProcAddressResolver
virtual Playground::VKProcAddressResolver CreateVKProcAddressResolver() const
Definition: playground_impl.cc:74
impeller::PlaygroundImpl::SetCapabilities
virtual fml::Status SetCapabilities(const std::shared_ptr< Capabilities > &capabilities)=0
impeller
Definition: allocation.cc:12
impeller::PlaygroundBackend
PlaygroundBackend
Definition: playground.h:27
switches.h
playground.h
context.h
surface.h
impeller::PlaygroundSwitches
Definition: switches.h:16
impeller::TPoint< Scalar >