diff --git a/shell/platform/embedder/tests/embedder_test_context_metal.cc b/shell/platform/embedder/tests/embedder_test_context_metal.cc index aa83ca73ddd03..7a4c9b92a58fa 100644 --- a/shell/platform/embedder/tests/embedder_test_context_metal.cc +++ b/shell/platform/embedder/tests/embedder_test_context_metal.cc @@ -47,6 +47,10 @@ TestMetalContext* EmbedderTestContextMetal::GetTestMetalContext() { return metal_context_.get(); } +TestMetalSurface* EmbedderTestContextMetal::GetTestMetalSurface() { + return metal_surface_.get(); +} + void EmbedderTestContextMetal::SetPresentCallback( PresentCallback present_callback) { present_callback_ = std::move(present_callback); @@ -79,10 +83,6 @@ bool EmbedderTestContextMetal::PopulateExternalTexture( } } -TestMetalContext::TextureInfo EmbedderTestContextMetal::GetTextureInfo() { - return metal_surface_->GetTextureInfo(); -} - void EmbedderTestContextMetal::SetNextDrawableCallback( NextDrawableCallback next_drawable_callback) { next_drawable_callback_ = std::move(next_drawable_callback); diff --git a/shell/platform/embedder/tests/embedder_test_context_metal.h b/shell/platform/embedder/tests/embedder_test_context_metal.h index ad1e08b83173c..a8f49089997e8 100644 --- a/shell/platform/embedder/tests/embedder_test_context_metal.h +++ b/shell/platform/embedder/tests/embedder_test_context_metal.h @@ -53,8 +53,7 @@ class EmbedderTestContextMetal : public EmbedderTestContext { TestMetalContext* GetTestMetalContext(); - // Returns the TextureInfo for the test Metal surface. - TestMetalContext::TextureInfo GetTextureInfo(); + TestMetalSurface* GetTestMetalSurface(); // Override the default handling for GetNextDrawable. void SetNextDrawableCallback(NextDrawableCallback next_drawable_callback); diff --git a/shell/platform/embedder/tests/embedder_unittests_metal.mm b/shell/platform/embedder/tests/embedder_unittests_metal.mm index 7d07b54d7e894..62b7a43bcc83d 100644 --- a/shell/platform/embedder/tests/embedder_unittests_metal.mm +++ b/shell/platform/embedder/tests/embedder_unittests_metal.mm @@ -242,7 +242,8 @@ GrBackendTexture backend_texture(texture_size.width(), texture_size.height(), Gr auto collect_context = std::make_unique(); context.SetNextDrawableCallback([&context, &collect_context](const FlutterFrameInfo* frame_info) { - auto texture_info = context.GetTextureInfo(); + auto texture_info = context.GetTestMetalSurface()->GetTextureInfo(); + FlutterMetalTexture texture; texture.struct_size = sizeof(FlutterMetalTexture); texture.texture_id = texture_info.texture_id;