Flutter Engine
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/fml/platform/darwin/scoped_nsobject.h"
11 #include "flutter/shell/gpu/gpu_surface_software.h"
12 #import "flutter/shell/platform/darwin/ios/ios_context.h"
13 #import "flutter/shell/platform/darwin/ios/ios_surface.h"
14 
15 @class CALayer;
16 
17 namespace flutter {
18 
20  public:
21  IOSSurfaceSoftware(fml::scoped_nsobject<CALayer> layer, std::shared_ptr<IOSContext> context);
22 
23  ~IOSSurfaceSoftware() override;
24 
25  // |IOSSurface|
26  bool IsValid() const override;
27 
28  // |IOSSurface|
29  void UpdateStorageSizeIfNecessary() override;
30 
31  // |IOSSurface|
32  std::unique_ptr<Surface> CreateGPUSurface(GrDirectContext* gr_context = nullptr) override;
33 
34  // |GPUSurfaceSoftwareDelegate|
35  sk_sp<SkSurface> AcquireBackingStore(const SkISize& size) override;
36 
37  // |GPUSurfaceSoftwareDelegate|
38  bool PresentBackingStore(sk_sp<SkSurface> backing_store) override;
39 
40  private:
42  sk_sp<SkSurface> sk_surface_;
43 
44  FML_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceSoftware);
45 };
46 
47 } // namespace flutter
48 
49 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_
sk_sp< SkSurface > AcquireBackingStore(const SkISize &size) override
Called when the GPU surface needs a new buffer to render a new frame into.
void UpdateStorageSizeIfNecessary() override
IOSSurfaceSoftware(fml::scoped_nsobject< CALayer > layer, std::shared_ptr< IOSContext > context)
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
Interface implemented by all platform surfaces that can present a software backing store to the "scre...
std::unique_ptr< Surface > CreateGPUSurface(GrDirectContext *gr_context=nullptr) override
bool PresentBackingStore(sk_sp< SkSurface > backing_store) override
Called by the platform when a frame has been rendered into the backing store and the platform must di...