Flutter Engine
Loading...
Searching...
No Matches
test_metal_surface_impl.h
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
#ifndef FLUTTER_TESTING_TEST_METAL_SURFACE_IMPL_H_
6
#define FLUTTER_TESTING_TEST_METAL_SURFACE_IMPL_H_
7
8
#include "
flutter/fml/macros.h
"
9
#include "
flutter/testing/test_metal_context.h
"
10
#include "
flutter/testing/test_metal_surface.h
"
11
12
#include "third_party/skia/include/core/SkSurface.h"
13
14
namespace
flutter::testing
{
15
16
class
TestMetalSurfaceImpl
:
public
TestMetalSurface
{
17
public
:
18
TestMetalSurfaceImpl
(
const
TestMetalContext
& test_metal_context,
19
const
DlISize
& surface_size);
20
21
TestMetalSurfaceImpl
(
const
TestMetalContext
& test_metal_context,
22
int64_t
texture_id
,
23
const
DlISize
& surface_size);
24
25
// |TestMetalSurface|
26
~TestMetalSurfaceImpl
()
override
;
27
28
private
:
29
void
Init(
const
TestMetalContext::TextureInfo
& texture_info,
30
const
DlISize
& surface_size);
31
32
const
TestMetalContext
& test_metal_context_;
33
bool
is_valid_ =
false
;
34
sk_sp<SkSurface> surface_;
35
TestMetalContext::TextureInfo
texture_info_;
36
37
// |TestMetalSurface|
38
bool
IsValid()
const override
;
39
40
// |TestMetalSurface|
41
sk_sp<GrDirectContext> GetGrContext()
const override
;
42
43
// |TestMetalSurface|
44
sk_sp<SkSurface> GetSurface()
const override
;
45
46
// |TestMetalSurface|
47
sk_sp<SkImage> GetRasterSurfaceSnapshot()
override
;
48
49
// |TestMetalSurface|
50
TestMetalContext::TextureInfo
GetTextureInfo()
override
;
51
52
FML_DISALLOW_COPY_AND_ASSIGN
(
TestMetalSurfaceImpl
);
53
};
54
55
}
// namespace flutter::testing
56
57
#endif
// FLUTTER_TESTING_TEST_METAL_SURFACE_IMPL_H_
flutter::testing::TestMetalContext
Definition
test_metal_context.h:22
flutter::testing::TestMetalSurface
Creates a MTLTexture backed SkSurface and context that can be used to render to in unit-tests.
Definition
test_metal_surface.h:21
flutter::testing::TestMetalSurfaceImpl
Definition
test_metal_surface_impl.h:16
flutter::testing::TestMetalSurfaceImpl::~TestMetalSurfaceImpl
~TestMetalSurfaceImpl() override
macros.h
FML_DISALLOW_COPY_AND_ASSIGN
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition
macros.h:27
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_context.h
test_metal_surface.h
texture_id
int64_t texture_id
Definition
texture_registrar_unittests.cc:24
testing
test_metal_surface_impl.h
Generated on Thu Nov 6 2025 16:11:29 for Flutter Engine by
1.9.8