Skip to content

Commit

Permalink
context
Browse files Browse the repository at this point in the history
  • Loading branch information
jmagman committed Apr 9, 2024
1 parent dc9e4fe commit cef18e6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
15 changes: 8 additions & 7 deletions shell/platform/darwin/ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,14 @@ source_set("flutter_framework_source_arc") {
"framework/Source/profiler_metrics_ios.mm",
"ios_context.h",
"ios_context.mm",
"ios_context_metal_impeller.h",
"ios_context_metal_impeller.mm",
"ios_context_metal_skia.h",
"ios_context_metal_skia.mm",
"ios_context_software.h",
"ios_context_software.mm",
"ios_external_texture_metal.h",
"ios_external_texture_metal.mm",
"rendering_api_selection.h",
"rendering_api_selection.mm",
]
Expand All @@ -86,9 +92,11 @@ source_set("flutter_framework_source_arc") {
]

deps += [
":ios_gpu_configuration",
"//flutter/common/graphics",
"//flutter/lib/ui",
"//flutter/shell/platform/darwin/common",
"//flutter/shell/platform/darwin/graphics",
"//flutter/shell/profiling:profiling",
]
}
Expand Down Expand Up @@ -158,12 +166,6 @@ source_set("flutter_framework_source") {
"framework/Source/accessibility_text_entry.mm",
"framework/Source/vsync_waiter_ios.h",
"framework/Source/vsync_waiter_ios.mm",
"ios_context_metal_impeller.h",
"ios_context_metal_impeller.mm",
"ios_context_metal_skia.h",
"ios_context_metal_skia.mm",
"ios_external_texture_metal.h",
"ios_external_texture_metal.mm",
"ios_external_view_embedder.h",
"ios_external_view_embedder.mm",
"ios_surface.h",
Expand Down Expand Up @@ -198,7 +200,6 @@ source_set("flutter_framework_source") {
"//flutter/shell/platform/common:common_cpp_input",
"//flutter/shell/platform/darwin/common",
"//flutter/shell/platform/darwin/common:framework_common",
"//flutter/shell/platform/darwin/graphics",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/profiling:profiling",
"//flutter/skia",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import <UIKit/UIKit.h>
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterUIPressProxy.h"

#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterUIPressProxy.h"

#import <UIKit/UIKit.h>

FLUTTER_ASSERT_ARC

Expand Down
8 changes: 5 additions & 3 deletions shell/platform/darwin/ios/ios_context_metal_impeller.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -54,9 +56,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_
createExternalTextureWithIdentifier:texture_id
texture:texture]});
}

} // namespace flutter
5 changes: 3 additions & 2 deletions shell/platform/darwin/ios/ios_context_metal_skia.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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]});
}

} // namespace flutter
2 changes: 2 additions & 0 deletions shell/platform/darwin/ios/ios_external_texture_metal.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit cef18e6

Please sign in to comment.