Flutter Engine
The Flutter Engine
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
11#include "tests/Test.h"
13#include "tools/gpu/FenceSync.h"
14
15struct GrContextOptions;
16
17using namespace sk_gpu_test;
18
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}
const char * options
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
reporter
Definition: FontMgrTest.cpp:39
DEF_GANESH_TEST(GrContext_abandonContext, reporter, options, CtsEnforcement::kApiLevel_T)
ContextInfo getContextInfo(ContextType type, ContextOverrides=ContextOverrides::kNone)
static const int kContextTypeCount
Definition: ContextType.h:42
ContextType
Definition: ContextType.h:19