Flutter Engine
The Flutter Engine
third_party
skia
include
gpu
gl
GrGLExtensions.h
Go to the documentation of this file.
1
/*
2
* Copyright 2013 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
#ifndef GrGLExtensions_DEFINED
9
#define GrGLExtensions_DEFINED
10
11
#include "
include/core/SkString.h
"
12
#include "
include/gpu/gl/GrGLFunctions.h
"
13
#include "
include/private/base/SkTArray.h
"
14
15
#include <utility>
16
17
struct
GrGLInterface
;
18
class
SkJSONWriter
;
19
20
/**
21
* This helper queries the current GL context for its extensions, remembers them, and can be
22
* queried. It supports both glGetString- and glGetStringi-style extension string APIs and will
23
* use the latter if it is available. It also will query for EGL extensions if a eglQueryString
24
* implementation is provided.
25
*/
26
class
SK_API
GrGLExtensions
{
27
public
:
28
GrGLExtensions
() {}
29
30
GrGLExtensions
(
const
GrGLExtensions
&);
31
32
GrGLExtensions
& operator=(
const
GrGLExtensions
&);
33
34
void
swap
(
GrGLExtensions
* that) {
35
using
std::swap
;
36
swap
(fStrings, that->fStrings);
37
swap
(fInitialized, that->fInitialized);
38
}
39
40
/**
41
* We sometimes need to use this class without having yet created a GrGLInterface. This version
42
* of init expects that getString is always non-NULL while getIntegerv and getStringi are non-
43
* NULL if on desktop GL with version 3.0 or higher. Otherwise it will fail.
44
*/
45
bool
init
(
GrGLStandard
standard,
46
GrGLFunction<GrGLGetStringFn>
getString,
47
GrGLFunction<GrGLGetStringiFn>
getStringi,
48
GrGLFunction<GrGLGetIntegervFn>
getIntegerv,
49
GrGLFunction<GrEGLQueryStringFn>
queryString =
nullptr
,
50
GrEGLDisplay
eglDisplay =
nullptr
);
51
52
bool
isInitialized
()
const
{
return
fInitialized; }
53
54
/**
55
* Queries whether an extension is present. This will fail if init() has not been called.
56
*/
57
bool
has(
const
char
[])
const
;
58
59
/**
60
* Removes an extension if present. Returns true if the extension was present before the call.
61
*/
62
bool
remove
(
const
char
[]);
63
64
/**
65
* Adds an extension to list
66
*/
67
void
add(
const
char
[]);
68
69
void
reset
() { fStrings.clear(); }
70
71
void
dumpJSON(
SkJSONWriter
*)
const
;
72
73
private
:
74
bool
fInitialized =
false
;
75
skia_private::TArray<SkString>
fStrings;
76
};
77
78
#endif
GrGLFunctions.h
GrGLStandard
GrGLStandard
Definition:
GrGLTypes.h:19
GrEGLDisplay
void * GrEGLDisplay
Definition:
GrGLTypes.h:166
SK_API
#define SK_API
Definition:
SkAPI.h:35
swap
void swap(sk_sp< T > &a, sk_sp< T > &b)
Definition:
SkRefCnt.h:341
SkString.h
SkTArray.h
GrGLExtensions
Definition:
GrGLExtensions.h:26
GrGLExtensions::isInitialized
bool isInitialized() const
Definition:
GrGLExtensions.h:52
GrGLExtensions::reset
void reset()
Definition:
GrGLExtensions.h:69
GrGLExtensions::swap
void swap(GrGLExtensions *that)
Definition:
GrGLExtensions.h:34
GrGLExtensions::GrGLExtensions
GrGLExtensions()
Definition:
GrGLExtensions.h:28
GrGLFunction< GrGLGetStringFn >
SkJSONWriter
Definition:
SkJSONWriter.h:38
skia_private::TArray< SkString >
SkOpts::init
static bool init()
Definition:
SkBitmapProcState_opts.cpp:26
pdf-comparison.remove
def remove(*paths)
Definition:
pdf-comparison.py:80
GrGLInterface
Definition:
GrGLInterface.h:48
Generated on Sun Jun 23 2024 21:56:02 for Flutter Engine by
1.9.4