Flutter Engine
The Flutter Engine
third_party
skia
tests
GrContextAbandonTest.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2016 Google Inc.
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
#include "
include/core/SkTypes.h
"
9
#include "
include/gpu/GrDirectContext.h
"
10
#include "
tests/CtsEnforcement.h
"
11
#include "
tests/Test.h
"
12
#include "
tools/gpu/ContextType.h
"
13
#include "
tools/gpu/FenceSync.h
"
14
15
struct
GrContextOptions
;
16
17
using namespace
sk_gpu_test
;
18
19
DEF_GANESH_TEST
(GrContext_abandonContext,
reporter
,
options
,
CtsEnforcement::kApiLevel_T
) {
20
for
(
int
testType = 0; testType < 6; ++testType) {
21
for
(
int
i
= 0;
i
<
skgpu::kContextTypeCount
; ++
i
) {
22
GrContextFactory
testFactory(
options
);
23
auto
ctxType =
static_cast<
skgpu::ContextType
>
(
i
);
24
ContextInfo
info
= testFactory.
getContextInfo
(ctxType);
25
if
(
auto
context =
info
.directContext()) {
26
switch
(testType) {
27
case
0:
28
context->abandonContext();
29
break
;
30
case
1:
31
context->releaseResourcesAndAbandonContext();
32
break
;
33
case
2:
34
context->abandonContext();
35
context->abandonContext();
36
break
;
37
case
3:
38
context->abandonContext();
39
context->releaseResourcesAndAbandonContext();
40
break
;
41
case
4:
42
context->releaseResourcesAndAbandonContext();
43
context->abandonContext();
44
break
;
45
case
5:
46
context->releaseResourcesAndAbandonContext();
47
context->releaseResourcesAndAbandonContext();
48
break
;
49
}
50
}
51
}
52
}
53
}
options
const char * options
Definition:
CommonFlagsConfig.cpp:43
ContextType.h
CtsEnforcement.h
info
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition:
DM.cpp:213
FenceSync.h
reporter
reporter
Definition:
FontMgrTest.cpp:39
DEF_GANESH_TEST
DEF_GANESH_TEST(GrContext_abandonContext, reporter, options, CtsEnforcement::kApiLevel_T)
Definition:
GrContextAbandonTest.cpp:19
GrDirectContext.h
SkTypes.h
Test.h
CtsEnforcement::kApiLevel_T
@ kApiLevel_T
Definition:
CtsEnforcement.h:32
sk_gpu_test::ContextInfo
Definition:
GrContextFactory.h:102
sk_gpu_test::GrContextFactory
Definition:
GrContextFactory.h:36
sk_gpu_test::GrContextFactory::getContextInfo
ContextInfo getContextInfo(ContextType type, ContextOverrides=ContextOverrides::kNone)
Definition:
GrContextFactory.cpp:332
i
int i
Definition:
fl_socket_accessible.cc:18
sk_gpu_test
Definition:
gm_bindings.cpp:339
skgpu::kContextTypeCount
static const int kContextTypeCount
Definition:
ContextType.h:42
skgpu::ContextType
ContextType
Definition:
ContextType.h:19
GrContextOptions
Definition:
GrContextOptions.h:23
Generated on Sun Jun 23 2024 21:56:39 for Flutter Engine by
1.9.4