• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2017 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // egl_utils.h: Utility routines specific to the EGL->EGL implementation.
8 
9 #ifndef LIBANGLE_RENDERER_GL_EGL_EGLUTILS_H_
10 #define LIBANGLE_RENDERER_GL_EGL_EGLUTILS_H_
11 
12 #include <vector>
13 
14 #include "common/platform.h"
15 #include "libANGLE/AttributeMap.h"
16 
17 namespace rx
18 {
19 
20 namespace native_egl
21 {
22 
23 using AttributeVector = std::vector<EGLint>;
24 
25 // Filter the attribute map and return a vector of attributes that can be passed to the native
26 // driver.  Does NOT append EGL_NONE to the vector.
27 AttributeVector TrimAttributeMap(const egl::AttributeMap &attributes,
28                                  const EGLint *forwardAttribs,
29                                  size_t forwardAttribsCount);
30 
31 template <size_t N>
TrimAttributeMap(const egl::AttributeMap & attributes,const EGLint (& forwardAttribs)[N])32 AttributeVector TrimAttributeMap(const egl::AttributeMap &attributes,
33                                  const EGLint (&forwardAttribs)[N])
34 {
35     return TrimAttributeMap(attributes, forwardAttribs, N);
36 }
37 
38 // Append EGL_NONE to the attribute vector so that it can be passed to a native driver.
39 void FinalizeAttributeVector(AttributeVector *attributeVector);
40 
41 }  // namespace native_egl
42 
43 }  // namespace rx
44 
45 #endif  // LIBANGLE_RENDERER_GL_EGL_EGLUTILS_H_
46