Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
GrContextAbandonTest.cpp File Reference
#include "include/core/SkTypes.h"
#include "include/gpu/GrDirectContext.h"
#include "tests/CtsEnforcement.h"
#include "tests/Test.h"
#include "tools/gpu/ContextType.h"
#include "tools/gpu/FenceSync.h"

Go to the source code of this file.

Functions

 DEF_GANESH_TEST (GrContext_abandonContext, reporter, options, CtsEnforcement::kApiLevel_T)
 

Function Documentation

◆ DEF_GANESH_TEST()

DEF_GANESH_TEST ( GrContext_abandonContext  ,
reporter  ,
options  ,
CtsEnforcement::kApiLevel_T   
)

Definition at line 19 of file GrContextAbandonTest.cpp.

19 {
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
static const int kContextTypeCount
Definition ContextType.h:42