Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
++
  • Loading branch information
jonahwilliams committed Sep 24, 2024
commit 625f597c0e26a0954b81d181435f92c25c53abe0
17 changes: 8 additions & 9 deletions shell/gpu/gpu_surface_metal_impeller_unittests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,16 @@ GPUCAMetalLayerHandle GetCAMetalLayer(const SkISize& frame_info) const override

TEST(GPUSurfaceMetalImpeller, CanCreateValidSurface) {
auto delegate = std::make_shared<TestGPUSurfaceMetalDelegate>();
auto surface = std::make_shared<GPUSurfaceMetalImpeller>(delegate.get(), CreateImpellerContext());
auto surface = std::make_shared<GPUSurfaceMetalImpeller>(
delegate.get(), std::make_shared<impeller::AiksContext>(CreateImpellerContext(), nullptr));

ASSERT_TRUE(surface->IsValid());
}

TEST(GPUSurfaceMetalImpeller, AcquireFrameFromCAMetalLayerNullChecksDrawable) {
auto delegate = std::make_shared<TestGPUSurfaceMetalDelegate>();
std::shared_ptr<Surface> surface =
std::make_shared<GPUSurfaceMetalImpeller>(delegate.get(), CreateImpellerContext());
std::shared_ptr<Surface> surface = std::make_shared<GPUSurfaceMetalImpeller>(
delegate.get(), std::make_shared<impeller::AiksContext>(CreateImpellerContext(), nullptr));

ASSERT_TRUE(surface->IsValid());

Expand All @@ -85,8 +86,8 @@ GPUCAMetalLayerHandle GetCAMetalLayer(const SkISize& frame_info) const override
TEST(GPUSurfaceMetalImpeller, AcquireFrameFromCAMetalLayerDoesNotRetainThis) {
auto delegate = std::make_shared<TestGPUSurfaceMetalDelegate>();
delegate->SetDevice();
std::unique_ptr<Surface> surface =
std::make_unique<GPUSurfaceMetalImpeller>(delegate.get(), CreateImpellerContext());
std::unique_ptr<Surface> surface = std::make_unique<GPUSurfaceMetalImpeller>(
delegate.get(), std::make_shared<impeller::AiksContext>(CreateImpellerContext(), nullptr));

ASSERT_TRUE(surface->IsValid());

Expand All @@ -105,8 +106,7 @@ GPUCAMetalLayerHandle GetCAMetalLayer(const SkISize& frame_info) const override

auto context = CreateImpellerContext();
std::unique_ptr<Surface> surface = std::make_unique<GPUSurfaceMetalImpeller>(
delegate.get(),
std::make_shared<impeller::AiksContext>(context, impeller::TypographerContextSkia::Make()));
delegate.get(), std::make_shared<impeller::AiksContext>(context, nullptr));

ASSERT_TRUE(surface->IsValid());

Expand All @@ -133,8 +133,7 @@ GPUCAMetalLayerHandle GetCAMetalLayer(const SkISize& frame_info) const override
delegate->SetDevice();

auto context = CreateImpellerContext();
auto aiks_context =
std::make_shared<impeller::AiksContext>(context, impeller::TypographerContextSkia::Make());
auto aiks_context = std::make_shared<impeller::AiksContext>(context, nullptr);

EXPECT_FALSE(context->GetCaptureManager()->CaptureScopeActive());

Expand Down