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_
flutter::IOSSurfaceSoftware::IsValid
bool IsValid() const override
Definition: ios_surface_software.mm:28
flutter::IOSSurfaceSoftware::PresentBackingStore
bool PresentBackingStore(sk_sp< SkSurface > backing_store) override
Definition: ios_surface_software.mm:71
flutter::IOSSurfaceSoftware::IOSSurfaceSoftware
IOSSurfaceSoftware(CALayer *layer, std::shared_ptr< IOSContext > context)
Definition: ios_surface_software.mm:23
flutter::IOSSurface
Definition: ios_surface.h:20
flutter::IOSSurfaceSoftware::AcquireBackingStore
sk_sp< SkSurface > AcquireBackingStore(const SkISize &size) override
Definition: ios_surface_software.mm:53
flutter::IOSSurfaceSoftware
Definition: ios_surface_software.h:20
ios_surface.h
flutter
Definition: accessibility_bridge.h:27
flutter::IOSSurfaceSoftware::UpdateStorageSizeIfNecessary
void UpdateStorageSizeIfNecessary() override
Definition: ios_surface_software.mm:32
ios_context.h
flutter::IOSSurfaceSoftware::CreateGPUSurface
std::unique_ptr< Surface > CreateGPUSurface(GrDirectContext *gr_context=nullptr) override
Definition: ios_surface_software.mm:39
flutter::IOSSurfaceSoftware::~IOSSurfaceSoftware
~IOSSurfaceSoftware() override