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:
22  std::shared_ptr<IOSContext> context,
23  FlutterPlatformViewsController* platform_views_controller);
24 
25  ~IOSSurfaceSoftware() override;
26 
27  // |IOSSurface|
28  bool IsValid() const override;
29 
30  // |IOSSurface|
31  void UpdateStorageSizeIfNecessary() override;
32 
33  // |IOSSurface|
34  std::unique_ptr<Surface> CreateGPUSurface(GrDirectContext* gr_context = nullptr) override;
35 
36  // |GPUSurfaceSoftwareDelegate|
37  sk_sp<SkSurface> AcquireBackingStore(const SkISize& size) override;
38 
39  // |GPUSurfaceSoftwareDelegate|
40  bool PresentBackingStore(sk_sp<SkSurface> backing_store) override;
41 
42  // |GPUSurfaceSoftwareDelegate|
44 
45  private:
47  sk_sp<SkSurface> sk_surface_;
48 
49  FML_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceSoftware);
50 };
51 
52 } // namespace flutter
53 
54 #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
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
IOSSurfaceSoftware(fml::scoped_nsobject< CALayer > layer, std::shared_ptr< IOSContext > context, FlutterPlatformViewsController *platform_views_controller)
ExternalViewEmbedder * GetExternalViewEmbedder() override
Gets the view embedder that controls how the Flutter layer hierarchy split into multiple chunks shoul...
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...