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 
15 
16 namespace impeller {
17 
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 
40 
41  protected:
43 
44  explicit PlaygroundImpl(PlaygroundSwitches switches);
45 
46  private:
47  PlaygroundImpl(const PlaygroundImpl&) = delete;
48 
49  PlaygroundImpl& operator=(const PlaygroundImpl&) = delete;
50 };
51 
52 } // namespace impeller
53 
54 #endif // FLUTTER_IMPELLER_PLAYGROUND_PLAYGROUND_IMPL_H_
std::function< void *(const char *proc_name)> GLProcAddressResolver
Definition: playground.h:118
PlaygroundImpl(PlaygroundSwitches switches)
virtual std::unique_ptr< Surface > AcquireSurfaceFrame(std::shared_ptr< Context > context)=0
Vector2 GetContentScale() const
virtual std::shared_ptr< Context > GetContext() const =0
virtual WindowHandle GetWindowHandle() const =0
static std::unique_ptr< PlaygroundImpl > Create(PlaygroundBackend backend, PlaygroundSwitches switches)
virtual Playground::GLProcAddressResolver CreateGLProcAddressResolver() const
const PlaygroundSwitches switches_
virtual fml::Status SetCapabilities(const std::shared_ptr< Capabilities > &capabilities)=0
PlaygroundBackend
Definition: playground.h:27