Flutter Impeller
surface.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_TOOLKIT_INTEROP_SURFACE_H_
6 #define FLUTTER_IMPELLER_TOOLKIT_INTEROP_SURFACE_H_
7 
8 #include <memory>
9 
15 
16 namespace impeller::interop {
17 
18 class Surface final
19  : public Object<Surface, IMPELLER_INTERNAL_HANDLE_NAME(ImpellerSurface)> {
20  public:
21  static ScopedObject<Surface> WrapFBO(Context& context,
22  uint64_t fbo,
23  PixelFormat color_format,
24  ISize size);
25 
26  explicit Surface(Context& context,
27  std::shared_ptr<impeller::Surface> surface);
28 
29  ~Surface() override;
30 
31  Surface(const Surface&) = delete;
32 
33  Surface& operator=(const Surface&) = delete;
34 
35  bool IsValid() const;
36 
37  bool DrawDisplayList(const DisplayList& dl) const;
38 
39  private:
40  ScopedObject<Context> context_;
41  std::shared_ptr<impeller::Surface> surface_;
42  bool is_valid_ = false;
43 };
44 
45 } // namespace impeller::interop
46 
47 #endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_SURFACE_H_
Surface & operator=(const Surface &)=delete
bool IsValid() const
Definition: surface.cc:48
Surface(Context &context, std::shared_ptr< impeller::Surface > surface)
Definition: surface.cc:15
static ScopedObject< Surface > WrapFBO(Context &context, uint64_t fbo, PixelFormat color_format, ISize size)
Definition: surface.cc:23
bool DrawDisplayList(const DisplayList &dl) const
Definition: surface.cc:52
Surface(const Surface &)=delete
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:99