Flutter Engine
embedder_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_EMBEDDER_EMBEDDER_SURFACE_SOFTWARE_H_
6 #define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_SOFTWARE_H_
7 
8 #include "flutter/fml/macros.h"
9 #include "flutter/shell/gpu/gpu_surface_software.h"
10 #include "flutter/shell/platform/embedder/embedder_external_view_embedder.h"
11 #include "flutter/shell/platform/embedder/embedder_surface.h"
12 
13 namespace flutter {
14 
17  public:
19  std::function<bool(const void* allocation, size_t row_bytes, size_t height)>
21  };
22 
24  SoftwareDispatchTable software_dispatch_table,
25  std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder);
26 
27  ~EmbedderSurfaceSoftware() override;
28 
29  private:
30  bool valid_ = false;
31  SoftwareDispatchTable software_dispatch_table_;
32  sk_sp<SkSurface> sk_surface_;
33  std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder_;
34 
35  // |EmbedderSurface|
36  bool IsValid() const override;
37 
38  // |EmbedderSurface|
39  std::unique_ptr<Surface> CreateGPUSurface() override;
40 
41  // |EmbedderSurface|
42  sk_sp<GrDirectContext> CreateResourceContext() const override;
43 
44  // |GPUSurfaceSoftwareDelegate|
45  sk_sp<SkSurface> AcquireBackingStore(const SkISize& size) override;
46 
47  // |GPUSurfaceSoftwareDelegate|
48  bool PresentBackingStore(sk_sp<SkSurface> backing_store) override;
49 
50  // |GPUSurfaceSoftwareDelegate|
51  ExternalViewEmbedder* GetExternalViewEmbedder() override;
52 
54 };
55 
56 } // namespace flutter
57 
58 #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_SURFACE_SOFTWARE_H_
EmbedderSurfaceSoftware(SoftwareDispatchTable software_dispatch_table, std::shared_ptr< EmbedderExternalViewEmbedder > external_view_embedder)
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...
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition: macros.h:27
std::function< bool(const void *allocation, size_t row_bytes, size_t height)> software_present_backing_store