|
Flutter iOS Embedder
|
|
Go to the documentation of this file.
5 #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_OVERLAY_LAYER_POOL_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_OVERLAY_LAYER_POOL_H_
8 #include <Metal/Metal.h>
11 #import <UIKit/UIKit.h>
13 #include "flow/surface.h"
14 #include "fml/platform/darwin/scoped_nsobject.h"
27 std::unique_ptr<Surface>
surface);
44 void UpdateViewState(UIView* flutter_view, SkRect rect, int64_t view_id, int64_t overlay_id);
68 const std::shared_ptr<IOSContext>& ios_context,
69 MTLPixelFormat pixel_format);
96 size_t available_layer_index_ = 0;
97 std::vector<std::shared_ptr<OverlayLayer>> layers_;
102 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_OVERLAY_LAYER_POOL_H_
std::shared_ptr< OverlayLayer > GetNextLayer()
Gets a layer from the pool if available.
State holder for a Flutter overlay layer.
~OverlayLayerPool()=default
void CreateLayer(GrDirectContext *gr_context, const std::shared_ptr< IOSContext > &ios_context, MTLPixelFormat pixel_format)
Create a new overlay layer.
size_t size() const
The count of layers currently in the pool.
std::unique_ptr< IOSSurface > ios_surface
GrDirectContext * gr_context
std::unique_ptr< Surface > surface
bool did_submit_last_frame
void RecycleLayers()
Marks the layers in the pool as available for reuse.
std::vector< std::shared_ptr< OverlayLayer > > RemoveUnusedLayers()
Removes unused layers from the pool. Returns the unused layers.
OverlayLayer(const fml::scoped_nsobject< UIView > &overlay_view, const fml::scoped_nsobject< UIView > &overlay_view_wrapper, std::unique_ptr< IOSSurface > ios_surface, std::unique_ptr< Surface > surface)
fml::scoped_nsobject< UIView > overlay_view
fml::scoped_nsobject< UIView > overlay_view_wrapper
void UpdateViewState(UIView *flutter_view, SkRect rect, int64_t view_id, int64_t overlay_id)
OverlayLayerPool()=default
Storage for Overlay layers across frames.