Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
tests
GrGLExtensionsTest.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2017 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 "
tests/Test.h
"
9
10
#ifdef SK_GL
11
#include "
include/core/SkTypes.h
"
12
#include "
include/gpu/gl/GrGLExtensions.h
"
13
#include "
include/gpu/gl/GrGLTypes.h
"
14
#include "
src/gpu/ganesh/gl/GrGLDefines.h
"
15
16
const
GrGLubyte
* simpleGetString(
GrGLenum
name
) {
17
return
(
const
GrGLubyte
*)(
name
==
GR_GL_VERSION
?
"3.0"
:
""
);
18
}
19
20
void
simpleGetIntegerv(
GrGLenum
name
,
GrGLint
*
params
) {
21
if
(
name
==
GR_GL_NUM_EXTENSIONS
) {
22
*
params
= 2;
23
}
else
{
24
*
params
= 0;
25
}
26
}
27
28
const
GrGLubyte
* simpleGetStringi(
GrGLenum
name
,
GrGLuint
index) {
29
if
(
name
!=
GR_GL_EXTENSIONS
|| index >= 2)
30
return
(
const
GrGLubyte
*)
""
;
31
return
(
const
GrGLubyte
*)(index == 0 ?
"test_extension_1"
:
"test_extension_2"
);
32
}
33
34
DEF_TEST
(GrGLExtensionsTest_remove,
reporter
) {
35
GrGLExtensions
ext
;
36
ext
.init(
kGL_GrGLStandard
,
37
&simpleGetString,
38
&simpleGetStringi,
39
&simpleGetIntegerv,
40
nullptr
,
41
nullptr
);
42
43
REPORTER_ASSERT
(
reporter
,
ext
.isInitialized());
44
REPORTER_ASSERT
(
reporter
,
ext
.has(
"test_extension_1"
));
45
REPORTER_ASSERT
(
reporter
,
ext
.has(
"test_extension_2"
));
46
REPORTER_ASSERT
(
reporter
,
ext
.remove(
"test_extension_2"
));
47
REPORTER_ASSERT
(
reporter
, !
ext
.has(
"test_extension_2"
));
48
REPORTER_ASSERT
(
reporter
,
ext
.remove(
"test_extension_1"
));
49
REPORTER_ASSERT
(
reporter
, !
ext
.has(
"test_extension_1"
));
50
}
51
52
#endif
// SK_GL
reporter
reporter
Definition
FontMgrTest.cpp:39
GrGLDefines.h
GR_GL_NUM_EXTENSIONS
#define GR_GL_NUM_EXTENSIONS
Definition
GrGLDefines.h:606
GR_GL_EXTENSIONS
#define GR_GL_EXTENSIONS
Definition
GrGLDefines.h:603
GR_GL_VERSION
#define GR_GL_VERSION
Definition
GrGLDefines.h:602
GrGLExtensions.h
GrGLTypes.h
GrGLuint
unsigned int GrGLuint
Definition
GrGLTypes.h:113
kGL_GrGLStandard
@ kGL_GrGLStandard
Definition
GrGLTypes.h:21
GrGLint
int GrGLint
Definition
GrGLTypes.h:108
GrGLenum
unsigned int GrGLenum
Definition
GrGLTypes.h:102
GrGLubyte
unsigned char GrGLubyte
Definition
GrGLTypes.h:111
SkTypes.h
Test.h
DEF_TEST
#define DEF_TEST(name, reporter)
Definition
Test.h:312
REPORTER_ASSERT
#define REPORTER_ASSERT(r, cond,...)
Definition
Test.h:286
GrGLExtensions
Definition
GrGLExtensions.h:26
params
const EmbeddedViewParams * params
Definition
embedder_external_view_embedder.cc:138
name
const char * name
Definition
fuchsia.cc:50
gn.compile_sksl_tests.ext
ext
Definition
compile_sksl_tests.py:63
Generated on Fri Apr 26 2024 06:17:44 for Flutter Engine by
1.9.8