Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /* vim: set ts=8 sts=4 et sw=4 tw=80: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef WEBGLCONTEXTUNCHECKED_H
8 : #define WEBGLCONTEXTUNCHECKED_H
9 :
10 : #include "mozilla/RefPtr.h"
11 : #include "WebGLTypes.h"
12 :
13 : namespace mozilla {
14 :
15 : class WebGLBuffer;
16 : class WebGLSampler;
17 :
18 0 : class WebGLContextUnchecked
19 : {
20 : public:
21 : explicit WebGLContextUnchecked(gl::GLContext* gl);
22 :
23 : protected:
24 : // We've had issues in the past with nulling `gl` without actually releasing
25 : // all of our resources. This construction ensures that we are aware that we
26 : // should only null `gl` in DestroyResourcesAndContext.
27 : RefPtr<gl::GLContext> mGL_OnlyClearInDestroyResourcesAndContext;
28 : public:
29 : // Grab a const reference so we can see changes, but can't make changes.
30 : const decltype(mGL_OnlyClearInDestroyResourcesAndContext)& gl;
31 : };
32 :
33 : } // namespace mozilla
34 :
35 : #endif // !WEBGLCONTEXTUNCHECKED_H
|