Hash :
4a48d9a3
Author :
Date :
2016-03-31T16:46:25
Initial implementation of ANGLE_stream_producer_d3d_texture_nv12. Add the validation and entrypoints for ANGLE_stream_producer_d3d_texture_nv12, which is a new EGL extension currently being written. The purpose of this extension is to allow insertion of D3D11 NV12 textures to be inserted into a stream. This acts as the producer of the EGL stream. BUG=angleproject:1332 Change-Id: I50d4565cc82b63f7da7632adad4ac4c77d8800f2 Reviewed-on: https://chromium-review.googlesource.com/336695 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Ian Ewell <ewell@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "libANGLE/AttributeMap.h"
namespace egl
{
AttributeMap::AttributeMap()
{
}
void AttributeMap::insert(EGLAttrib key, EGLAttrib value)
{
mAttributes[key] = value;
}
bool AttributeMap::contains(EGLAttrib key) const
{
return (mAttributes.find(key) != mAttributes.end());
}
EGLAttrib AttributeMap::get(EGLAttrib key, EGLAttrib defaultValue) const
{
std::map<EGLAttrib, EGLAttrib>::const_iterator iter = mAttributes.find(key);
return (mAttributes.find(key) != mAttributes.end()) ? iter->second : defaultValue;
}
bool AttributeMap::isEmpty() const
{
return mAttributes.empty();
}
AttributeMap::const_iterator AttributeMap::begin() const
{
return mAttributes.begin();
}
AttributeMap::const_iterator AttributeMap::end() const
{
return mAttributes.end();
}
// static
AttributeMap AttributeMap::CreateFromIntArray(const EGLint *attributes)
{
AttributeMap map;
if (attributes)
{
for (const EGLint *curAttrib = attributes; curAttrib[0] != EGL_NONE; curAttrib += 2)
{
map.insert(static_cast<EGLAttrib>(curAttrib[0]), static_cast<EGLAttrib>(curAttrib[1]));
}
}
return map;
}
// static
AttributeMap AttributeMap::CreateFromAttribArray(const EGLAttrib *attributes)
{
AttributeMap map;
if (attributes)
{
for (const EGLAttrib *curAttrib = attributes; curAttrib[0] != EGL_NONE; curAttrib += 2)
{
map.insert(curAttrib[0], curAttrib[1]);
}
}
return map;
}
}