Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions shell/platform/embedder/tests/embedder_test_context_metal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions shell/platform/embedder/tests/embedder_test_context_metal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion shell/platform/embedder/tests/embedder_unittests_metal.mm
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ GrBackendTexture backend_texture(texture_size.width(), texture_size.height(), Gr

auto collect_context = std::make_unique<CollectContext>();
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;
Expand Down