From 675f15c5e7c46e384f9197d1064924ee0b0477ec Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Wed, 4 Mar 2020 17:31:21 -0800 Subject: [PATCH 1/3] documented fluttertexture.h --- .../common/framework/Headers/FlutterTexture.h | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/shell/platform/darwin/common/framework/Headers/FlutterTexture.h b/shell/platform/darwin/common/framework/Headers/FlutterTexture.h index bfb66b092a684..063e55fe6ae80 100644 --- a/shell/platform/darwin/common/framework/Headers/FlutterTexture.h +++ b/shell/platform/darwin/common/framework/Headers/FlutterTexture.h @@ -13,7 +13,13 @@ NS_ASSUME_NONNULL_BEGIN FLUTTER_EXPORT +/** + * Represents a texture that can be shared with Flutter. + * + * See also: https://github.com/flutter/plugins/tree/master/packages/camera + */ @protocol FlutterTexture +/** Copy the contents of the texture into a `CVPixelBuffer`. */ - (CVPixelBufferRef _Nullable)copyPixelBuffer; /** @@ -26,9 +32,26 @@ FLUTTER_EXPORT @end FLUTTER_EXPORT +/** + * A collection of registered `FlutterTexture`'s. + */ @protocol FlutterTextureRegistry +/** + * Registers a `FlutterTexture` for usage in Flutter and returns an id that can be used to reference + * that texture when calling into Flutter with channels. + */ - (int64_t)registerTexture:(NSObject*)texture; +/** + * Notifies Flutter that the context of the previously registered texture has been updated. + * + * See also: `flutter::PlatformView::MarkTextureFrameAvailable` + */ - (void)textureFrameAvailable:(int64_t)textureId; +/** + * Unregisters a `FlutterTexture` that has previously regeistered with `registerTexture:`. + * + * @param textureId The result that was previously returned from `registerTexture:`. + */ - (void)unregisterTexture:(int64_t)textureId; @end From 4be6a29a4604623e4b8776c37b422a3c01209cb2 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Thu, 5 Mar 2020 11:19:24 -0800 Subject: [PATCH 2/3] spelling error --- shell/platform/darwin/common/framework/Headers/FlutterTexture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/darwin/common/framework/Headers/FlutterTexture.h b/shell/platform/darwin/common/framework/Headers/FlutterTexture.h index 063e55fe6ae80..d25b18dad3489 100644 --- a/shell/platform/darwin/common/framework/Headers/FlutterTexture.h +++ b/shell/platform/darwin/common/framework/Headers/FlutterTexture.h @@ -42,7 +42,7 @@ FLUTTER_EXPORT */ - (int64_t)registerTexture:(NSObject*)texture; /** - * Notifies Flutter that the context of the previously registered texture has been updated. + * Notifies Flutter that the content of the previously registered texture has been updated. * * See also: `flutter::PlatformView::MarkTextureFrameAvailable` */ From a00bcccb1e55498287c18007129965707a352c9b Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Thu, 5 Mar 2020 11:46:18 -0800 Subject: [PATCH 3/3] updated textureFrameAvailable docstring --- shell/platform/darwin/common/framework/Headers/FlutterTexture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/darwin/common/framework/Headers/FlutterTexture.h b/shell/platform/darwin/common/framework/Headers/FlutterTexture.h index d25b18dad3489..cfda1e2df83d7 100644 --- a/shell/platform/darwin/common/framework/Headers/FlutterTexture.h +++ b/shell/platform/darwin/common/framework/Headers/FlutterTexture.h @@ -44,7 +44,7 @@ FLUTTER_EXPORT /** * Notifies Flutter that the content of the previously registered texture has been updated. * - * See also: `flutter::PlatformView::MarkTextureFrameAvailable` + * This will trigger a call to `-[FlutterTexture copyPixelBuffer]` on the GPU thread. */ - (void)textureFrameAvailable:(int64_t)textureId; /**