1 //
2 // Copyright 2018 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 #include "libANGLE/renderer/gl/egl/RendererEGL.h"
8
9 #include "libANGLE/renderer/gl/egl/DisplayEGL.h"
10
11 namespace rx
12 {
13
RendererEGL(std::unique_ptr<FunctionsGL> functionsGL,const egl::AttributeMap & attribMap,DisplayEGL * display,EGLContext context,const native_egl::AttributeVector attribs)14 RendererEGL::RendererEGL(std::unique_ptr<FunctionsGL> functionsGL,
15 const egl::AttributeMap &attribMap,
16 DisplayEGL *display,
17 EGLContext context,
18 const native_egl::AttributeVector attribs)
19 : RendererGL(std::move(functionsGL), attribMap, display),
20 mDisplay(display),
21 mContext(context),
22 mAttribs(attribs)
23 {}
24
~RendererEGL()25 RendererEGL::~RendererEGL()
26 {
27 mDisplay->destroyNativeContext(mContext);
28 mContext = nullptr;
29 }
30
getContext() const31 EGLContext RendererEGL::getContext() const
32 {
33 return mContext;
34 }
35
createWorkerContext(std::string * infoLog)36 WorkerContext *RendererEGL::createWorkerContext(std::string *infoLog)
37 {
38 return mDisplay->createWorkerContext(infoLog, mContext, mAttribs);
39 }
40
41 } // namespace rx
42