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,bool isExternalContext)14 RendererEGL::RendererEGL(std::unique_ptr<FunctionsGL> functionsGL,
15 const egl::AttributeMap &attribMap,
16 DisplayEGL *display,
17 EGLContext context,
18 bool isExternalContext)
19 : RendererGL(std::move(functionsGL), attribMap, display),
20 mDisplay(display),
21 mContext(context),
22 mIsExternalContext(isExternalContext)
23 {}
24
~RendererEGL()25 RendererEGL::~RendererEGL()
26 {
27 if (!mIsExternalContext)
28 {
29 mDisplay->destroyNativeContext(mContext);
30 mContext = nullptr;
31 }
32 }
33
getContext() const34 EGLContext RendererEGL::getContext() const
35 {
36 return mContext;
37 }
38
39 } // namespace rx
40