X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fgraphics%2Femugl%2FRenderContext.h;fp=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fgraphics%2Femugl%2FRenderContext.h;h=6e18a9bfb4687f96c818354744e679a835c16fae;hb=e26c1ec581be598521517829adba8c8dd23a768f;hp=0000000000000000000000000000000000000000;hpb=6699c1aea74eeb0eb400e6299079f0c7576f716f;p=iec.git diff --git a/src/type3_AndroidCloud/anbox-master/src/anbox/graphics/emugl/RenderContext.h b/src/type3_AndroidCloud/anbox-master/src/anbox/graphics/emugl/RenderContext.h new file mode 100644 index 0000000..6e18a9b --- /dev/null +++ b/src/type3_AndroidCloud/anbox-master/src/anbox/graphics/emugl/RenderContext.h @@ -0,0 +1,67 @@ +/* +* Copyright (C) 2011 The Android Open Source Project +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#ifndef _LIBRENDER_RENDER_CONTEXT_H +#define _LIBRENDER_RENDER_CONTEXT_H + +#include "external/android-emugl/shared/OpenglCodecCommon/GLDecoderContextData.h" + +#include + +#include + +// A class used to model a guest EGLContext. This simply wraps a host +// EGLContext, associated with an GLDecoderContextData instance that is +// used to store copies of guest-side arrays. +class RenderContext { + public: + // Create a new RenderContext instance. + // |display| is the host EGLDisplay handle. + // |config| is the host EGLConfig to use. + // |sharedContext| is either EGL_NO_CONTEXT of a host EGLContext handle. + // |isGl2| is true iff the new context will be used with GLESv2, or + // GLESv1 otherwise. + static RenderContext* create(EGLDisplay display, EGLConfig config, + EGLContext sharedContext, bool isGL2 = false); + + // Destructor. + ~RenderContext(); + + // Retrieve host EGLContext value. + EGLContext getEGLContext() const { return mContext; } + + // Return true iff this is a GLESv2 context. + bool isGL2() const { return mIsGl2; } + + // Retrieve GLDecoderContextData instance reference for this + // RenderContext instance. + GLDecoderContextData& decoderContextData() { return mContextData; } + + private: + RenderContext(); + + RenderContext(EGLDisplay display, EGLContext context, bool isGl2); + + private: + EGLDisplay mDisplay; + EGLContext mContext; + bool mIsGl2; + GLDecoderContextData mContextData; +}; + +typedef std::shared_ptr RenderContextPtr; + +#endif // _LIBRENDER_RENDER_CONTEXT_H