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.cpp: Utility routines specific to the EGL->EGL implementation. 8 9 #include "libANGLE/renderer/gl/egl/egl_utils.h" 10 11 #include "common/debug.h" 12 13 namespace rx 14 { 15 16 namespace native_egl 17 { 18 TrimAttributeMap(const egl::AttributeMap & attributes,const EGLint * forwardAttribs,size_t forwardAttribsCount)19AttributeVector TrimAttributeMap(const egl::AttributeMap &attributes, 20 const EGLint *forwardAttribs, 21 size_t forwardAttribsCount) 22 { 23 AttributeVector result; 24 for (size_t forwardAttribIndex = 0; forwardAttribIndex < forwardAttribsCount; 25 forwardAttribIndex++) 26 { 27 EGLint forwardAttrib = forwardAttribs[forwardAttribIndex]; 28 if (attributes.contains(forwardAttrib)) 29 { 30 result.push_back(forwardAttrib); 31 result.push_back(static_cast<int>(attributes.get(forwardAttrib))); 32 } 33 } 34 return result; 35 } 36 FinalizeAttributeVector(AttributeVector * attributeVector)37void FinalizeAttributeVector(AttributeVector *attributeVector) 38 { 39 ASSERT(attributeVector); 40 attributeVector->push_back(EGL_NONE); 41 } 42 43 } // namespace native_egl 44 45 } // namespace rx 46