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 // ContextEGL.h: Context class for GL on Android/ChromeOS. Wraps a RendererEGL. 8 9 #ifndef LIBANGLE_RENDERER_GL_EGL_CONTEXTEGL_H_ 10 #define LIBANGLE_RENDERER_GL_EGL_CONTEXTEGL_H_ 11 12 #include "libANGLE/renderer/gl/ContextGL.h" 13 #include "libANGLE/renderer/gl/egl/RendererEGL.h" 14 15 namespace rx 16 { 17 18 struct ExternalContextState; 19 20 class ContextEGL : public ContextGL 21 { 22 public: 23 ContextEGL(const gl::State &state, 24 gl::ErrorSet *errorSet, 25 const std::shared_ptr<RendererEGL> &renderer, 26 RobustnessVideoMemoryPurgeStatus robustnessVideoMemoryPurgeStatus); 27 ~ContextEGL() override; 28 29 angle::Result onMakeCurrent(const gl::Context *context) override; 30 angle::Result onUnMakeCurrent(const gl::Context *context) override; 31 32 EGLContext getContext() const; 33 34 private: 35 std::shared_ptr<RendererEGL> mRendererEGL; 36 std::unique_ptr<ExternalContextState> mExtState; 37 }; 38 } // namespace rx 39 40 #endif // LIBANGLE_RENDERER_GL_EGL_RENDEREREGL_H_ 41