Hash :
56cf9af2
Author :
Date :
2015-02-17T10:16:49
Add a FunctionsGL class for loading GL entry points. BUG=angle:879 Change-Id: I35384f078d2ed86a6c72cc243753b56bc58617b0 Reviewed-on: https://chromium-review.googlesource.com/250390 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
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
//
// Copyright (c) 2015 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.
//
// DisplayGL.h: GL implementation of egl::Display
#include "libANGLE/renderer/gl/DisplayGL.h"
#include "libANGLE/AttributeMap.h"
#include "libANGLE/Context.h"
#include "libANGLE/renderer/gl/RendererGL.h"
#include <EGL/eglext.h>
namespace rx
{
DisplayGL::DisplayGL()
: mRenderer(nullptr)
{
}
DisplayGL::~DisplayGL()
{
}
egl::Error DisplayGL::initialize(egl::Display *display)
{
mRenderer = new RendererGL(getFunctionsGL());
return egl::Error(EGL_SUCCESS);
}
void DisplayGL::terminate()
{
SafeDelete(mRenderer);
}
egl::Error DisplayGL::createContext(const egl::Config *config, const gl::Context *shareContext, const egl::AttributeMap &attribs, gl::Context **outContext)
{
ASSERT(mRenderer != nullptr);
EGLint clientVersion = attribs.get(EGL_CONTEXT_CLIENT_VERSION, 1);
bool notifyResets = (attribs.get(EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT, EGL_NO_RESET_NOTIFICATION_EXT) == EGL_LOSE_CONTEXT_ON_RESET_EXT);
bool robustAccess = (attribs.get(EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT, EGL_FALSE) == EGL_TRUE);
*outContext = new gl::Context(config, clientVersion, shareContext, mRenderer, notifyResets, robustAccess);
return egl::Error(EGL_SUCCESS);
}
}