Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8e7c29e

Browse files
committed
Address comment
1 parent 52acabf commit 8e7c29e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

shell/platform/darwin/macos/framework/Headers/FlutterEngine.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ FLUTTER_DARWIN_EXPORT
6565
/**
6666
* The default `FlutterViewController` associated with this engine, if any.
6767
*
68-
* The default view always has ID 0, and is the view operated by the APIs that
69-
* do not have a view ID specified.
68+
* The default view always has ID kFlutterDefaultViewId, and is the view
69+
* operated by the APIs that do not have a view ID specified.
7070
*/
7171
@property(nonatomic, nullable, weak) FlutterViewController* viewController;
7272

shell/platform/darwin/macos/framework/Source/FlutterEngine.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ - (FlutterCompositor*)createFlutterCompositor {
434434
// TODO(dkwingsmt): The compositor only supports single-view for now. As
435435
// more classes are gradually converted to multi-view, it should get the
436436
// view ID from somewhere.
437-
uint64_t viewId = 0;
437+
uint64_t viewId = kFlutterDefaultViewId;
438438
if (has_flutter_content) {
439439
return [weakSelf.renderer present:viewId] == YES;
440440
} else {

shell/platform/darwin/macos/framework/Source/FlutterMetalRenderer.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static FlutterMetalTexture OnGetNextDrawableForDefaultView(FlutterEngine* engine
1818
// TODO(dkwingsmt): This callback only supports single-view, therefore it only
1919
// operates on the default view. To support multi-view, we need a new callback
2020
// that also receives a view ID, or pass the ID via FlutterFrameInfo.
21-
uint64_t viewId = 0;
21+
uint64_t viewId = kFlutterDefaultViewId;
2222
CGSize size = CGSizeMake(frameInfo->size.width, frameInfo->size.height);
2323
FlutterMetalRenderer* metalRenderer = reinterpret_cast<FlutterMetalRenderer*>(engine.renderer);
2424
return [metalRenderer createTextureForView:viewId size:size];
@@ -29,7 +29,7 @@ static bool OnPresentDrawableOfDefaultView(FlutterEngine* engine,
2929
// TODO(dkwingsmt): This callback only supports single-view, therefore it only
3030
// operates on the default view. To support multi-view, we need a new callback
3131
// that also receives a view ID.
32-
uint64_t viewId = 0;
32+
uint64_t viewId = kFlutterDefaultViewId;
3333
return [engine.renderer present:viewId];
3434
}
3535

shell/platform/darwin/macos/framework/Source/FlutterMetalRendererTest.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void SetEngineDefaultView(FlutterEngine* engine, id flutterView) {
4040
id mockFlutterView = OCMClassMock([FlutterView class]);
4141
SetEngineDefaultView(engine, mockFlutterView);
4242
[(FlutterView*)[mockFlutterView expect] present];
43-
[renderer present:0];
43+
[renderer present:kFlutterDefaultViewId];
4444
}
4545

4646
TEST(FlutterMetalRenderer, TextureReturnedByFlutterView) {
@@ -56,7 +56,7 @@ void SetEngineDefaultView(FlutterEngine* engine, id flutterView) {
5656
frameInfo.size = dimensions;
5757
CGSize size = CGSizeMake(dimensions.width, dimensions.height);
5858
[[mockFlutterView expect] backingStoreForSize:size];
59-
[renderer createTextureForView:0 size:size];
59+
[renderer createTextureForView:kFlutterDefaultViewId size:size];
6060
}
6161

6262
} // namespace flutter::testing

0 commit comments

Comments
 (0)