Flutter Engine
The Flutter Engine
third_party
skia
tools
graphite
ContextFactory.h
Go to the documentation of this file.
1
/*
2
* Copyright 2021 Google LLC
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef skiatest_graphite_ContextFactory_DEFINED
9
#define skiatest_graphite_ContextFactory_DEFINED
10
11
#include "
include/core/SkRefCnt.h
"
12
#include "
include/gpu/graphite/ContextOptions.h
"
13
#include "
include/gpu/graphite/GraphiteTypes.h
"
14
#include "
include/private/base/SkTArray.h
"
15
#include "
tools/gpu/ContextType.h
"
16
#include "
tools/graphite/GraphiteTestContext.h
"
17
#include "
tools/graphite/TestOptions.h
"
18
19
namespace
skgpu::graphite
{
20
class
Context
;
21
}
22
23
namespace
skiatest::graphite
{
24
25
struct
ContextInfo
{
26
GraphiteTestContext
*
fTestContext
=
nullptr
;
27
skgpu::graphite::Context
*
fContext
=
nullptr
;
28
};
29
30
class
ContextFactory
{
31
public
:
32
explicit
ContextFactory
(
const
TestOptions
&);
33
ContextFactory
() =
default
;
34
ContextFactory
(
const
ContextFactory
&) =
delete
;
35
ContextFactory
&
operator=
(
const
ContextFactory
&) =
delete
;
36
37
~ContextFactory
() =
default
;
38
39
ContextInfo
getContextInfo
(
skgpu::ContextType
);
40
41
private
:
42
struct
OwnedContextInfo {
43
OwnedContextInfo();
44
OwnedContextInfo(
skgpu::ContextType
,
45
std::unique_ptr<GraphiteTestContext>,
46
std::unique_ptr<skgpu::graphite::Context>);
47
48
~OwnedContextInfo();
49
OwnedContextInfo(OwnedContextInfo&&);
50
OwnedContextInfo&
operator=
(OwnedContextInfo&&);
51
52
// This holds the same data as ContextInfo, but uses unique_ptr to maintain ownership.
53
skgpu::ContextType
fType =
skgpu::ContextType::kMock
;
54
std::unique_ptr<GraphiteTestContext> fTestContext;
55
std::unique_ptr<skgpu::graphite::Context>
fContext
;
56
};
57
58
static
ContextInfo
AsContextInfo(
const
OwnedContextInfo& ctx);
59
60
skia_private::TArray<OwnedContextInfo>
fContexts;
61
const
TestOptions
fOptions = {};
62
};
63
64
}
// namespace skiatest::graphite
65
66
#endif
// skiatest_graphite_ContextFactory_DEFINED
ContextOptions.h
ContextType.h
GraphiteTestContext.h
GraphiteTypes.h
SkRefCnt.h
fContext
const Context & fContext
Definition:
SkSLFindAndDeclareBuiltinVariables.cpp:120
SkTArray.h
TestOptions.h
skgpu::graphite::Context
Definition:
Context.h:43
skia_private::TArray< OwnedContextInfo >
skiatest::graphite::ContextFactory
Definition:
ContextFactory.h:30
skiatest::graphite::ContextFactory::getContextInfo
ContextInfo getContextInfo(skgpu::ContextType)
Definition:
ContextFactory.cpp:54
skiatest::graphite::ContextFactory::~ContextFactory
~ContextFactory()=default
skiatest::graphite::ContextFactory::operator=
ContextFactory & operator=(const ContextFactory &)=delete
skiatest::graphite::ContextFactory::ContextFactory
ContextFactory(const ContextFactory &)=delete
skiatest::graphite::ContextFactory::ContextFactory
ContextFactory()=default
skiatest::graphite::GraphiteTestContext
Definition:
GraphiteTestContext.h:34
skgpu::graphite
Definition:
BoundsManagerBench.cpp:27
skgpu::ContextType
ContextType
Definition:
ContextType.h:19
skgpu::ContextType::kMock
@ kMock
Dawn on OpenGL ES.
skiatest::graphite
Definition:
gm.h:36
Context
Definition:
SerialProcsTest.cpp:126
skiatest::graphite::ContextInfo
Definition:
ContextFactory.h:25
skiatest::graphite::ContextInfo::fTestContext
GraphiteTestContext * fTestContext
Definition:
ContextFactory.h:26
skiatest::graphite::ContextInfo::fContext
skgpu::graphite::Context * fContext
Definition:
ContextFactory.h:27
skiatest::graphite::TestOptions
Definition:
TestOptions.h:15
Generated on Sun Jun 23 2024 21:56:50 for Flutter Engine by
1.9.4