Flutter Engine
Loading...
Searching...
No Matches
test_metal_surface.mm
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "
flutter/testing/test_metal_surface.h
"
6
7
#include "
flutter/fml/logging.h
"
8
#include "
flutter/testing/test_metal_surface_impl.h
"
9
10
#include "third_party/skia/include/core/SkSurface.h"
11
12
namespace
flutter::testing
{
13
14
bool
TestMetalSurface::PlatformSupportsMetal
() {
15
return
true
;
16
}
17
18
std::unique_ptr<TestMetalSurface>
TestMetalSurface::Create
(
19
const
TestMetalContext
& test_metal_context,
20
DlISize
surface_size) {
21
return
std::make_unique<TestMetalSurfaceImpl>(test_metal_context, surface_size);
22
}
23
24
std::unique_ptr<TestMetalSurface>
TestMetalSurface::Create
(
25
const
TestMetalContext
& test_metal_context,
26
int64_t
texture_id
,
27
DlISize
surface_size) {
28
return
std::make_unique<TestMetalSurfaceImpl>(test_metal_context,
texture_id
, surface_size);
29
}
30
31
TestMetalSurface::TestMetalSurface
() =
default
;
32
33
TestMetalSurface::~TestMetalSurface
() =
default
;
34
35
bool
TestMetalSurface::IsValid
()
const
{
36
return
impl_ ? impl_->IsValid() :
false
;
37
}
38
39
sk_sp<GrDirectContext>
TestMetalSurface::GetGrContext
()
const
{
40
return
impl_ ? impl_->GetGrContext() :
nullptr
;
41
}
42
43
sk_sp<SkSurface>
TestMetalSurface::GetSurface
()
const
{
44
return
impl_ ? impl_->GetSurface() :
nullptr
;
45
}
46
47
sk_sp<SkImage>
TestMetalSurface::GetRasterSurfaceSnapshot
() {
48
return
impl_ ? impl_->GetRasterSurfaceSnapshot() :
nullptr
;
49
}
50
51
TestMetalContext::TextureInfo
TestMetalSurface::GetTextureInfo
() {
52
return
impl_ ? impl_->GetTextureInfo() :
TestMetalContext::TextureInfo
();
53
}
54
55
}
// namespace flutter::testing
flutter::testing::TestMetalContext
Definition
test_metal_context.h:22
flutter::testing::TestMetalSurface::Create
static std::unique_ptr< TestMetalSurface > Create(const TestMetalContext &test_metal_context, DlISize surface_size=DlISize())
Definition
test_metal_surface.mm:18
flutter::testing::TestMetalSurface::~TestMetalSurface
virtual ~TestMetalSurface()
flutter::testing::TestMetalSurface::GetGrContext
virtual sk_sp< GrDirectContext > GetGrContext() const
Definition
test_metal_surface.mm:39
flutter::testing::TestMetalSurface::GetTextureInfo
virtual TestMetalContext::TextureInfo GetTextureInfo()
Definition
test_metal_surface.mm:51
flutter::testing::TestMetalSurface::PlatformSupportsMetal
static bool PlatformSupportsMetal()
Definition
test_metal_surface.mm:14
flutter::testing::TestMetalSurface::TestMetalSurface
TestMetalSurface()
flutter::testing::TestMetalSurface::GetSurface
virtual sk_sp< SkSurface > GetSurface() const
Definition
test_metal_surface.mm:43
flutter::testing::TestMetalSurface::IsValid
virtual bool IsValid() const
Definition
test_metal_surface.mm:35
flutter::testing::TestMetalSurface::GetRasterSurfaceSnapshot
virtual sk_sp< SkImage > GetRasterSurfaceSnapshot()
Definition
test_metal_surface.mm:47
logging.h
flutter::testing
Definition
native_assets_unittests.cc:10
flutter::testing::TestMetalContext::TextureInfo
Definition
test_metal_context.h:24
impeller::TSize
Definition
size.h:25
test_metal_surface.h
test_metal_surface_impl.h
texture_id
int64_t texture_id
Definition
texture_registrar_unittests.cc:24
testing
test_metal_surface.mm
Generated on Thu Nov 6 2025 16:11:29 for Flutter Engine by
1.9.8