1 // 2 // Copyright 2019 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 // ContextCGL: 7 // Mac-specific subclass of ContextGL. 8 // 9 10 #ifndef LIBANGLE_RENDERER_GL_CGL_CONTEXTCGL_H_ 11 #define LIBANGLE_RENDERER_GL_CGL_CONTEXTCGL_H_ 12 13 #include "libANGLE/renderer/gl/ContextGL.h" 14 #include "libANGLE/renderer/gl/RendererGL.h" 15 16 namespace rx 17 { 18 class DisplayCGL; 19 20 class ContextCGL : public ContextGL 21 { 22 public: 23 ContextCGL(DisplayCGL *display, 24 const gl::State &state, 25 gl::ErrorSet *errorSet, 26 const std::shared_ptr<RendererGL> &renderer, 27 bool usesDiscreteGPU); 28 29 void onDestroy(const gl::Context *context) override; 30 31 egl::Error releaseHighPowerGPU(gl::Context *context) override; 32 egl::Error reacquireHighPowerGPU(gl::Context *context) override; 33 34 private: 35 bool mUsesDiscreteGpu; 36 bool mReleasedDiscreteGpu; 37 }; 38 39 } // namespace rx 40 41 #endif // LIBANGLE_RENDERER_GL_CGL_CONTEXTCGL_H_ 42