Flutter iOS Embedder
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
ios_surface_software.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_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_
7 
8 #include "flutter/flow/embedded_views.h"
9 #include "flutter/fml/macros.h"
10 #include "flutter/shell/gpu/gpu_surface_software.h"
13 
14 #include "third_party/skia/include/core/SkSurface.h"
15 
16 @class CALayer;
17 
18 namespace flutter {
19 
20 class IOSSurfaceSoftware final : public IOSSurface, public GPUSurfaceSoftwareDelegate {
21  public:
22  IOSSurfaceSoftware(CALayer* layer, std::shared_ptr<IOSContext> context);
23 
24  ~IOSSurfaceSoftware() override;
25 
26  // |IOSSurface|
27  bool IsValid() const override;
28 
29  // |IOSSurface|
30  void UpdateStorageSizeIfNecessary() override;
31 
32  // |IOSSurface|
33  std::unique_ptr<Surface> CreateGPUSurface(GrDirectContext* gr_context = nullptr) override;
34 
35  // |GPUSurfaceSoftwareDelegate|
36  sk_sp<SkSurface> AcquireBackingStore(const SkISize& size) override;
37 
38  // |GPUSurfaceSoftwareDelegate|
39  bool PresentBackingStore(sk_sp<SkSurface> backing_store) override;
40 
41  private:
42  CALayer* layer_;
43  sk_sp<SkSurface> sk_surface_;
44 
45  FML_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceSoftware);
46 };
47 
48 } // namespace flutter
49 
50 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_
IOSSurfaceSoftware(CALayer *layer, std::shared_ptr< IOSContext > context)
bool PresentBackingStore(sk_sp< SkSurface > backing_store) override
void UpdateStorageSizeIfNecessary() override
sk_sp< SkSurface > AcquireBackingStore(const SkISize &size) override
std::unique_ptr< Surface > CreateGPUSurface(GrDirectContext *gr_context=nullptr) override