-
Notifications
You must be signed in to change notification settings - Fork 6k
Migrate FlutterUIPressProxy, ios_context*, rendering_api_selection, and a few other files to ARC #51633
Migrate FlutterUIPressProxy, ios_context*, rendering_api_selection, and a few other files to ARC #51633
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,6 @@ class IOSContextMetalImpeller final : public IOSContext { | |
|
||
~IOSContextMetalImpeller(); | ||
|
||
fml::scoped_nsobject<FlutterDarwinContextMetalSkia> GetDarwinContext() const; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Hmm, why is |
||
|
||
IOSRenderingBackend GetBackend() const override; | ||
|
||
// |IOSContext| | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,6 +6,8 @@ | |||||
#include "flutter/impeller/entity/mtl/entity_shaders.h" | ||||||
#import "flutter/shell/platform/darwin/ios/ios_external_texture_metal.h" | ||||||
|
||||||
FLUTTER_ASSERT_ARC | ||||||
|
||||||
namespace flutter { | ||||||
|
||||||
IOSContextMetalImpeller::IOSContextMetalImpeller( | ||||||
|
@@ -16,11 +18,6 @@ | |||||
|
||||||
IOSContextMetalImpeller::~IOSContextMetalImpeller() = default; | ||||||
|
||||||
fml::scoped_nsobject<FlutterDarwinContextMetalSkia> IOSContextMetalImpeller::GetDarwinContext() | ||||||
const { | ||||||
return fml::scoped_nsobject<FlutterDarwinContextMetalSkia>{}; | ||||||
} | ||||||
|
||||||
IOSRenderingBackend IOSContextMetalImpeller::GetBackend() const { | ||||||
return IOSRenderingBackend::kImpeller; | ||||||
} | ||||||
|
@@ -54,9 +51,9 @@ | |||||
int64_t texture_id, | ||||||
fml::scoped_nsobject<NSObject<FlutterTexture>> texture) { | ||||||
return std::make_unique<IOSExternalTextureMetal>( | ||||||
fml::scoped_nsobject<FlutterDarwinExternalTextureMetal>{ | ||||||
[[darwin_context_metal_impeller_ createExternalTextureWithIdentifier:texture_id | ||||||
texture:texture] retain]}); | ||||||
fml::scoped_nsobject<FlutterDarwinExternalTextureMetal>{[darwin_context_metal_impeller_ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need the scoped_nsobject here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally the answer should be no, but since scoped_nsobject is ARC-friendly, we should be safe to do those in a followup patch if preferred. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
engine/shell/platform/darwin/ios/platform_view_ios.mm Lines 139 to 140 in a9a4496
I'm going to hold off on removing scoped_nsobject from this signature until I can remove it there as well. Do you foresee any issues with that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be fine to keep |
||||||
createExternalTextureWithIdentifier:texture_id | ||||||
texture:texture]}); | ||||||
} | ||||||
|
||||||
} // namespace flutter |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ | |
#import "flutter/shell/platform/darwin/ios/ios_external_texture_metal.h" | ||
#include "third_party/skia/include/gpu/GrContextOptions.h" | ||
|
||
FLUTTER_ASSERT_ARC | ||
|
||
namespace flutter { | ||
|
||
IOSContextMetalSkia::IOSContextMetalSkia(MsaaSampleCount msaa_samples) : IOSContext(msaa_samples) { | ||
|
@@ -52,8 +54,7 @@ | |
fml::scoped_nsobject<NSObject<FlutterTexture>> texture) { | ||
return std::make_unique<IOSExternalTextureMetal>( | ||
fml::scoped_nsobject<FlutterDarwinExternalTextureMetal>{ | ||
[[darwin_context_metal_ createExternalTextureWithIdentifier:texture_id | ||
texture:texture] retain]}); | ||
[darwin_context_metal_ createExternalTextureWithIdentifier:texture_id texture:texture]}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question here. |
||
} | ||
|
||
} // namespace flutter |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
#import "flutter/shell/platform/darwin/ios/ios_external_texture_metal.h" | ||
#include "flow/layers/layer.h" | ||
|
||
FLUTTER_ASSERT_ARC | ||
|
||
namespace flutter { | ||
|
||
IOSExternalTextureMetal::IOSExternalTextureMetal( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we convert this scoped_nsobject to a simple Obj-C object property now? |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were these properties accidentally weak before and it just hadn't happened to break anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess? The usages look like this:
engine/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm
Lines 1885 to 1889 in fef8499
so maybe
press
andevent
are being retained in thenextAction
block? I don't see any obvious bugs about it...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting - yeah seems like this should previously have been explicitly
strong
, and maybe worked because (I assume) it's retained in that map we create to pointer events being sent to the framework until we get a response? (Didn't look but IIRC we hold onto them there)